Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apache2 vhosts problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
akira420
n00b
n00b


Joined: 17 May 2003
Posts: 45

PostPosted: Sat Oct 09, 2004 7:29 am    Post subject: apache2 vhosts problem Reply with quote

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
View user's profile Send private message
nobspangle
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1318
Location: Manchester, UK

PostPosted: Sat Oct 09, 2004 10:03 am    Post subject: Reply with quote

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
View user's profile Send private message
akira420
n00b
n00b


Joined: 17 May 2003
Posts: 45

PostPosted: Sat Oct 09, 2004 8:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum