Mobile app version of vmapp.org
Login or Join
Heady270

: How to Add Two Domains ON 1 IP using webmin 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

@Heady270

Posted in: #Domains #IpAddress #Virtualhost #WebHosting #Webmin

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?

10.04% popularity Vote Up Vote Down


Login to follow query

More posts by @Heady270

4 Comments

Sorted by latest first Latest Oldest Best

 

@Bryan171

Open your webmin
Go to servers
Go to Apache Webserver
Create virtual host
Check if it works from Existing virtual hosts and it well look like below:

10% popularity Vote Up Vote Down


 

@Mendez628

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.

10% popularity Vote Up Vote Down


 

@Bryan171

[not a answer, just to sort order my code] @bybe , still getting problem site1.net doesn't' work.
server ip : 192.168.1.100
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. (
1317411372
10800
3600
604800
38400 )
site1.net. IN A 192.168.1.100
ns1.mainsite.com. IN A 192.168.1.100
ns2.mainsite.com. IN A 192.168.1.100
site1.net. IN NS ns1.mainsite.com.
site1.net. IN NS ns2.mainsite.com. site1.net. IN CNAME mainsite.com.
*.site1.net. IN A 192.168.1.100
mail.site1.net. IN A 192.168.1.100
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 site1.net:80 <Directory "/var/www/www.site1.net">
allow from all
Options +Indexes
</Directory>
ServerAlias *.site.net
</VirtualHost>


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

10% popularity Vote Up Vote Down


 

@Nimeshi995

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>


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


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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme