WebmastTroy
07-12-2002, 06:11 AM
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.
ffeingol
07-12-2002, 07:12 AM
I read this post a couple of times and it does not make sense to me (sorry). How about posting the relavant parts of your httpd.conf? That should make it a lot clearer for everyone.
Frank
elsmore1
07-12-2002, 02:06 PM
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?
WebmastTroy
07-13-2002, 12:09 AM
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:
davidb
07-13-2002, 12:17 AM
It might be cached, try hitting ctrl + refresh. Also you might of accedently missed something. Why dont you post your code here.
elsmore1
07-13-2002, 12:23 AM
If you just changed the IP in the second domain's VirtualHost container... and the second domain worked before, it ought to work as you want now.
Just to be sure.... the DocumentRoot directive for the second domain is correct?
If you have shell access, you could do .../usr/sbin/httpd -S (use the path to where your httpd binary is) to get a printout of what Apache thinks is on each IP address.... Other than that, it has got to be something being over-looked.
WebmastTroy
07-13-2002, 12:38 AM
I apologize for wasting all your time.
Turns out, I had the wrong IP address in the VirtualHost entry of the 2nd domain. Thats what I get for trying to modify httpd.conf at 5am.
Thanks!