【发布时间】:2019-10-09 17:41:36
【问题描述】:
我尝试配置虚拟主机。我所做的一切就像here
我的配置:
root@ubuntu:/etc/apache2/sites-available# cat mmv.com.conf
# create new for [mmv.com]
<VirtualHost *:80>
ServerName www.mmv.com
ServerAdmin webmaster@virtual.host
DocumentRoot /var/www/mmv.com
ErrorLog /var/log/apache2/mmv.com.error.log
CustomLog /var/log/apache2/mmv.com.access.log combined
LogLevel warn
</VirtualHost>
我在根文件夹中的 index.html
cat /var/www/mmv.com/index.html
<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
Virtual Host Test Page
</div>
</body>
</html>
我的 /etc/hosts
127.0.0.1 localhost
127.0.1.1 ubuntu
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
192.168.125.137 www.mmv.com
看起来我所做的一切都是正确的,但如果我尝试打开网站 www.mmv.com 并看到默认的 apache 页面。 帮我找出我做错的地方。 谢谢!
【问题讨论】:
标签: linux apache ubuntu webserver virtualhost