在学习Linux的WebServer的过程中,尝试使用虚拟主机服务,在/data/www目录下创建了一个html文件,配置完/etc/httpd/conf/httpd.conf
之后,也就是这样:
<VirtualHost *:80>
ServerName www.test.com
DocumentRoot /data/www
<Directory "/data/www">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
发现用浏览器打开的还是centos的默认界面。

然后使用了setenforce 0命令,
sudo setenforce 0
再刷新页面,就可以了~

ps: windows中,可以在hosts文件中,绑定自定义的域名和IP地址。
C:\Windows\System32\drivers\etc\hosts
当然,也有可能是配置完之后没有重启服务,或者配置的内容、格式出问题了、防火墙的原因。。。或者其他(我就知道这些了。。)

1万+

被折叠的 条评论
为什么被折叠?



