Link to home
Start Free TrialLog in
Avatar of free4vn
free4vn

asked on

Default site in Webmin

My web server is running under Ubuntu OS. I am using Webmin to manage the sites. I created many Virtual hosts in Webmin. When I access to my server's IP (http://xxx.xxx.xxx.xxx) then Webmin automatically choose one of the Virtual host to display. How can I control what will be displayed when someone tries to access directly to server's IP?
Avatar of DMTechGrooup
DMTechGrooup
Flag of United States of America image

If you are adding virtual hosts to an existing web server, you must also create a <VirtualHost> block for the existing host. The ServerName and DocumentRoot included in this virtual host should be the same as the global ServerName and DocumentRoot. List this virtual host first in the configuration file so that it will act as the default host.

http://httpd.apache.org/docs/1.3/vhosts/name-based.html
Avatar of free4vn
free4vn

ASKER

The problem is that I am using Webmin with Ubuntu. Each virtual host configuration is stored in a file in /etc/apache2/site-enabled/. The file /etc/apache2/httpd.conf is empty. In the file /etc/apache2/apache2.conf, the last line is an include command:  Include /etc/apache2/sites-enabled/

So, how Webmin decide the default virtual host?

Moreover, after adding a virtual host, when the DNS settings haven't updated yet, how can I access the website?  It often takes about 24 hours to 48 hours for DNS propagting. In centos, I can access by http://server.ip/~username, but it does not work in Ubuntu with Webmin. Is there any solution?

ASKER CERTIFIED SOLUTION
Avatar of DMTechGrooup
DMTechGrooup
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial