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

来源:互联网 发布:日本 衰落 知乎 编辑:程序博客网 时间:2024/06/08 07:45
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.cndirectoryIndex  index.html index.php index.htmServerName x.xxx.netDocumentRoot /www/web<Directory "/www/web">    Options -Indexes    AllowOverride All    Require all granted</Directory></VirtualHost>
编辑完了别忘了 
httpd -t 

测试没问题了再重启apache

0 0
原创粉丝点击