一、配置httpd.conf
vim /etc/etc/httpd/conf/httpd.conf
1、将 ServerName www.example.con:80
改为 ServerName 127.0.0.1
2、在配置文件最后一行添加
Include conf.d/me.conf
二、配置me.conf
vim /etc/httpd/conf.d/me.conf
添加如下代码:
<VirtualHost *:80> ServerName localhost DocumentRoot /data/wwwroot/game <Directory ""> AllowOverride All Allow from all Require all granted </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot /var/www/html/site_b/ ServerName b.sindsun.cn </VirtualHost> <VirtualHost *:80> DocumentRoot /var/www/html/site_c/ ServerName c.sindsun.cn </VirtualHost>
三、重启Apache服务器
service httpd restart
四、在浏览器输入地下,测试,成功
版权声明:
此文为本站源创文章[或由本站编辑从网络整理改编],
转载请备注出处:
[狂码一生]
https://www.sindsun.com/articles/23/46
[若此文确切存在侵权,请联系本站管理员进行删除!]
--THE END--