View previous topic :: View next topic |
Author |
Message |
akira420 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 17 May 2003 Posts: 45
|
Posted: Sat Oct 09, 2004 7:29 am Post subject: apache2 vhosts problem |
|
|
Hello. I've been trying to get virtual host to work, pretty much here's what i want to do:
1) have people trying to connect via my want ip (63.196.244.xxx) load /var/www/localhost/htdocs/
2) anybody connecting locally (192.168.0.102) to be sent to /var/www/test
as it stands, all request are being forwarded to /var/www/test regardless of the address in the url, here's my code:
/etc/apache2/conf/vhosts/vhosts.conf
Code: |
ServerName 127.0.0.1
################# Named VirtualHosts
NameVirtualHost *:80
<VirtualHost 63.196.244.xxx:80>
ServerName 63.196.244.xxx
DocumentRoot /var/www/localhost/htdocs
</VirtualHost>
<VirtualHost 192.168.0.102:80>
ServerName 192.168.0.102
DocumentRoot /var/www/test/
</VirtualHost>
|
_________________ you can pick your friends, and you can pick your nose, but you can't pick your friends nose |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
nobspangle Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/210249061640b0c1d626f5b.gif)
Joined: 23 Mar 2004 Posts: 1318 Location: Manchester, UK
|
Posted: Sat Oct 09, 2004 10:03 am Post subject: |
|
|
Is the 63.196.244.xxx address a physical address on your system?
If not then your virtualhosts should be like this
Code: | NameVirtualHost *:80
<VirtualHost *:80>
ServerName 63.196.244.xxx
DocumentRoot /var/www/localhost/htdocs
</VirtualHost>
<VirtualHost *:80>
ServerName 192.168.0.102
DocumentRoot /var/www/test/
</VirtualHost> |
Otherwise you are trying to bind apache to an address it never sees due to the NAT on your router. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
akira420 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 17 May 2003 Posts: 45
|
Posted: Sat Oct 09, 2004 8:22 pm Post subject: |
|
|
Thank you. It worked _________________ you can pick your friends, and you can pick your nose, but you can't pick your friends nose |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|