Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a new user of webmin and I have two domains site1.com and site2.net.

I have one dedicated IP for the server and I have set site1.com to use following name servers ns1.site1.com and ns2.site1.com with bind.

Now when I add site2.net on the same IP using the same method both sites open with the same content. How can I host both web sites on the same IP?

share|improve this question
up vote 0 down vote accepted

The problem is that both domains are being pointed at the same hosting folder location.

If you have 2 sites labeled siteA and siteB you should have a folder structor something like this:

/home/siteA and /home/siteB or /var/www/siteA and /var/www/siteB these folders and the way domains point to them is called 'Virtual Hosts' You need to check your virtual host configuration and ensure that both directives are set and pointing in the correct location.

Depending on your Linux version the Apache configuration file may vary in location but typically its found in something like /etc/httpd/conf/httpd.conf or sites-enabled a Google search with your Linux version should give you an idea where your config file is located.

Once you located your virtual host file it should look something like:

<VirtualHost *:80>
DocumentRoot /home/siteA/htdocs
ServerName siteA.com
ServerAlias *.siteA.com

<VirtualHost *:80>
DocumentRoot /home/siteB/htdocs
ServerName siteB.com
ServerAlias *.siteB.com

There is many online guides on how to setup multiple vhosts using Webmin should you want some more advice other than my own a simple Google search should reveal a overwhelming amount.

share|improve this answer
Thank for your help, i just found apache2.conf in /etc/apache2 and here is my virtual host setting. <VirtualHost *:80> DocumentRoot "/var/www/www.site1.net" ServerName site1.net ServerAlias *.site1.net </VirtualHost> <VirtualHost *:80> DocumentRoot "/var/www/site2.com" ServerName site2.com ServerAlias *.site2.com </VirtualHost> sites are opening separately, that's worked for me. but here is still a problem even using ServerAlias site1.net doesn't open with-out www it works with www.site1.net how to handle this prob. error is " don't have permission to access / on this server. Thanks – user838037 Mar 2 '13 at 21:28
Make sure your name servers are setup correctly with the www @ ip – Simon Hayter Mar 2 '13 at 21:39
www.site1.net.  IN  CNAME   mainsite.com.

You have setup site1.net as an alias of mainsite.com The DNS now overrides the virtual host and alters your records and redirect you to mainsite.com

Just leaving this here as a reference.

share|improve this answer

[not a answer, just to sort order my code] @bybe, still getting problem http://site1.net doesn't' work. server ip : domain registrar with rdns: mainsite.com here is my Edit Records File /var/lib/bind/

$ttl 38400
site.net.   IN  SOA 192-168-1-100.local. admin.site1.net. (
            38400 )
site1.net.  IN  A
ns1.mainsite.com.   IN  A
ns2.mainsite.com.   IN  A
site1.net.  IN  NS  ns1.mainsite.com.
site1.net.  IN  NS  ns2.mainsite.com.
www.site1.net.  IN  CNAME   mainsite.com.
*.site1.net.    IN  A
mail.site1.net. IN  A
site1.net.  IN  MX  1 site1.net.
site1.net.  IN  NS  192-168-1-100.local.

and here my virtualhost setting

<VirtualHost *:80>
DocumentRoot /var/www/www.site1.net
ServerName www.site1.net:80
<Directory "/var/www/www.site1.net">
allow from all
Options +Indexes
ServerAlias *.site.net

other site on this server working perfectly with this same configuration. but don't know here what i am doing wrong. let me know where is problem. thank you

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.