在安装有nginx并使用的情况下
停止及关闭开机启动nginx
#systemctl stop nginx.service
#systemctl disable nginx.service
安装apache
#yum install httpd
编辑文件
#vi /etc/httpd/conf/httpd.conf
Listen 80
DocumentRoot "/var/www/html" 修改为 /data/www
<Directory "/data/www">
AllowOverride None #修改为:AllowOverride All (允许.htaccess)
DirectoryIndex index.html 修改为 index.php index.html index.htm
ErrorLog "/data/logs/apache/error_log"
CustomLog "/data/logs/apache/access_log" combined
<VirtualHost *:80>
DocumentRoot "/data/www/xxoo"
ServerName www.xxoo.local
</VirtualHost>
启动服务:
#systemctl start httpd.service
重启apache
#systemctl restart httpd.service
设置开机自动启动:
#systemctl enable httpd.service