Putting 2 sites on 1 IP address...
I have someone wanting to have 2 of their accounts on my server share the same IP address. The first account already has its own dedicated IP and now they want the 2nd one to share that same IP (IP different from the shared IP on the server).
When I setup the account and edit the IP information in the httpd.conf file and go to my browser using the 2nd accounts domain name, the first account shows up. I tried to copy all of the same information from the first account.
I have the NameVirtualHost uncommented with the new IP address and have the VirtualHost with the new IP.
Is there another way to do this? Can this even be done?
Thanks.
Re: Putting 2 sites on 1 IP address...
Quote:
Originally posted by WebmastTroy
I have someone wanting to have 2 of their accounts on my server share the same IP address. The first account already has its own dedicated IP and now they want the 2nd one to share that same IP (IP different from the shared IP on the server).
When I setup the account and edit the IP information in the httpd.conf file and go to my browser using the 2nd accounts domain name, the first account shows up. I tried to copy all of the same information from the first account.
I have the NameVirtualHost uncommented with the new IP address and have the VirtualHost with the new IP.
Is there another way to do this? Can this even be done?
Thanks.
What you need to do is something like this..... (in httpd.conf)
NameVirtualHost xx.xx.xx.xx (where the x's ar the IP address you want to share, sounds like you did this already....)
<VirtualHost xx.xx.xx.xx>
ServerName original.com
DucmentRoot /path/to/original
.... something here
.... something here
</VirtualHost>
<VirtualHost xx.xx.xx.xx> (note: same IP as before)
ServerName second.com
DocumentRoot /path/to/second
.... something here
.... something here
</VirtualHost>
That should do it. Make sure you restart Apache for the changes to take effect. There are other ways of doing it... but it sounds like this is the way you attempted to do it? did you re-start apache?
Re: Re: Putting 2 sites on 1 IP address...
Quote:
Originally posted by elsmore1
What you need to do is something like this..... (in httpd.conf)
NameVirtualHost xx.xx.xx.xx (where the x's ar the IP address you want to share, sounds like you did this already....)
<VirtualHost xx.xx.xx.xx>
ServerName original.com
DucmentRoot /path/to/original
.... something here
.... something here
</VirtualHost>
<VirtualHost xx.xx.xx.xx> (note: same IP as before)
ServerName second.com
DocumentRoot /path/to/second
.... something here
.... something here
</VirtualHost>
That should do it. Make sure you restart Apache for the changes to take effect. There are other ways of doing it... but it sounds like this is the way you attempted to do it? did you re-start apache?
Thats pretty much what I tried. Both accounts were added through WHM. The first account was created with the new IP, and the other one was with the server's default shared IP. I went into httpd.conf and changed the 2nd accounts settings to the new IP (like you showed) and restarted Apache via WHM. When I go to the domain, it still takes me to the 1st domain.
:rolleyes: