centos7 apache2 yum安装环境下 修改虚拟主机配置文件

xiaoxiao2021-02-27  151

httpd.conf在/etc/httpd/conf下 默认自动引用 /etc/httpd/conf.d/下的所有.conf文件 所以我们把 vhost.conf建立在 /etc/httpd/conf.d/目录下 cd /etc/httpd/conf.d/ vim vhost.conf添加:

<VirtualHost *:80> ServerAdmin service@xxx.cn directoryIndex index.html index.php index.htm ServerName x.xxx.net DocumentRoot /www/web <Directory "/www/web"> Options -Indexes AllowOverride All Require all granted </Directory> </VirtualHost>编辑完了别忘了  httpd -t

测试没问题了再重启apache

转载请注明原文地址: https://www.6miu.com/read-16551.html

最新回复(0)