I try to configure virtual hosts. All I do step by step like here
My config:
root@ubuntu:/etc/apache2/sites-available# cat mmv.com.conf
# create new for [mmv.com]
<VirtualHost *:80>
ServerName www.mmv.com
ServerAdmin [email protected]
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>
My index.html in root folder
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>
My /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
Looks like all I did right but if I try to open site www.mmv.com and I see default apache page.
Help me to find where I did mistake.
Thanks!
3
Answers
I found a solution! That right config:
And in file /etc/hosts have to be this:
Try this:
Then restart your apache server.
Stupid guess: the file is in sites-available, but was it enabled?
If you have debian you can use a2ensite mmv.com, otherwise you have to use ln -s as Kiani advised in ^^^.