1.Apache安裝
yum install httpd
systemctl start httpd.service #啟動
systemctl stop httpd.service#停止
systemctl restart httpd.service #重啟
設置開機啟動/關閉
systemctl enable httpd.service #開機啟動
systemctl disable httpd.service #開機不啟動
檢查httpd狀態
systemctl status httpd.service
關閉防火牆關閉:systemctl stop firewalld.service
查看狀態:systemctl status firewalld.service
2.PHP安裝
yum -y install php
php各項服務安裝
yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel php-mysql
3.安裝MariaDB數據庫
CentOS 7.0中,已經使用MariaDB替代了MySQL數據庫
安裝:yum -y install mariadb-server mariadb-client
啟動:systemctl start mariadb.service
停止:systemctl stop mariadb.service
查看狀態:systemctl status mariadb.service
開機啟動:systemctl enable mariadb.service
重啟:systemctl restart mariadb.service