Apache2Triad Help, Support and Development Forum Index Search Profile Log in to check your private messages Log in Register Memberlist Attachments Statistics Crew/Ranks Archive
 Going Mad with Virtual hosts not redirecting....
Google
Post new topic Reply to topic
Author Message
Tastiger
 
 


Joined: 28 May 2006
Posts: 25

PostPosted: Sat Feb 24, 2007 9:44 am Reply with quoteBack to top

I am pulling my hair out here try as I may I can't seem to get my virtual hosts to point to the right directories. I've read all the posts in the forums and tried all sorts of variations but no go - both domains still point to the htdocs index.html page.

can anyone see anything wrong with the code?

Code:
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#localhost
<VirtualHost localhost:80>
   ServerName localhost
   ServerAdmin admin@polyoz.dhs.org
   DocumentRoot c:/apache2triad/htdocs
   ErrorLog logs/localhost-error_log
   CustomLog logs/localhost-access_log common
</VirtualHost>


#scm-rpg
<VirtualHost *:80>
   ServerName scm-rpg.dhs.org
   ServerAlias scm-rpg.dhs.org
   ServerAdmin admin@scm-rpg.dhs.org
   DocumentRoot c:/apache2triad/htdocs/scm
   DirectoryIndex index.htm
   ErrorLog logs/scm-error_log
   CustomLog logs/scm-access_log common
</VirtualHost>

#polyoz
<VirtualHost >:80>
   ServerName polyoz.dhs.org
   ServerAlias polyoz.dhs.org
   ServerAdmin admin@polyoz.dhs.org
   DocumentRoot c:/apache2triad/htdocs
   DirectoryIndex index.php
   ErrorLog logs/polyoz-error_log
   CustomLog logs/polyoz-access_log common
</VirtualHost>



View user's profileSend private message
lku homer
 
 


Joined: 29 May 2006
Posts: 104

PostPosted: Sat Feb 24, 2007 2:29 pm Reply with quoteBack to top

Code:
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#localhost
<VirtualHost localhost:80>
   ServerName localhost
   ServerAdmin admin@polyoz.dhs.org
   DocumentRoot c:/apache2triad/htdocs
   ErrorLog logs/localhost-error_log
   CustomLog logs/localhost-access_log common
</VirtualHost>


#scm-rpg
<VirtualHost *:80>
   ServerName scm-rpg.dhs.org
   ServerAlias scm-rpg.dhs.org
   ServerAdmin admin@scm-rpg.dhs.org
   DocumentRoot c:/apache2triad/htdocs/scm
   DirectoryIndex index.htm
   ErrorLog logs/scm-error_log
   CustomLog logs/scm-access_log common
</VirtualHost>

#polyoz
<VirtualHost >:80>
   ServerName polyoz.dhs.org
   ServerAlias polyoz.dhs.org
   ServerAdmin admin@polyoz.dhs.org
   DocumentRoot c:/apache2triad/htdocs
   DirectoryIndex index.php
   ErrorLog logs/polyoz-error_log
   CustomLog logs/polyoz-access_log common
</VirtualHost>


change to
Code:

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#localhost
<VirtualHost localhost:80>
   ServerName localhost
   ServerAdmin admin@polyoz.dhs.org
   DocumentRoot c:/apache2triad/htdocs
   ErrorLog logs/localhost-error_log
   CustomLog logs/localhost-access_log common
</VirtualHost>


#scm-rpg
<VirtualHost *:80>
   ServerName scm-rpg.dhs.org
   ServerAlias www.scm-rpg.dhs.org
   ServerAdmin admin@scm-rpg.dhs.org
   DocumentRoot c:/apache2triad/htdocs/scm
   ErrorLog logs/scm-error_log
   CustomLog logs/scm-access_log common
</VirtualHost>

#polyoz
<VirtualHost *:80>
   ServerName polyoz.dhs.org
   ServerAlias www.polyoz.dhs.org
   ServerAdmin admin@polyoz.dhs.org
   DocumentRoot c:/apache2triad/htdocs/poly #Assuming it's name is poly
   ErrorLog logs/polyoz-error_log
   CustomLog logs/polyoz-access_log common
</VirtualHost>


Make sure your host file is setup correctly, there are posts with that. The DirectoryIndex variable in the VirtualHost is a duplicate, if you look just below the VirtualHosts there is something with the DirectoryIndex.
View user's profileSend private messageAIM AddressYahoo MessengerMSN MessengerICQ Number
Tastiger
 
 


Joined: 28 May 2006
Posts: 25

PostPosted: Sun Feb 25, 2007 12:57 am Reply with quoteBack to top

OK- while I was at it I upgraded to 1.5.4 - all is now working - but I found that some of the posts on these forums are wrong about the hosts file.

I had to set my hosts to :-

127.0.0.1 localhost
192.168.0.199 polyoz.dhs.org
192.168.0.199 scm-rpg.dhs.org

in order to get the correct directories to display.

Most of the posts on this forum suggest changing the hosts to 127.0.0.1 for all VirtualHosts - I found when setup to 127.0.0.1 my local machine would only direct to the htdocs directory

Hopefully this will help others.
View user's profileSend private message
trippin7464
 
 


Joined: 07 Sep 2007
Posts: 4
Location: Florida, USA

PostPosted: Wed Apr 30, 2008 9:02 am Reply with quoteBack to top

I just wanted to ask, wouldn't changing the hosts file ONLY allow YOU to see those domains pointed to whatever folders?

Because I haven't changed my hosts file at all, just my httpd.conf file and all is working for the outside world.
View user's profileSend private messageAIM AddressYahoo MessengerMSN Messenger
Tastiger
 
 


Joined: 28 May 2006
Posts: 25

PostPosted: Wed Apr 30, 2008 5:33 pm Reply with quoteBack to top

trippin7464 wrote:
I just wanted to ask, wouldn't changing the hosts file ONLY allow YOU to see those domains pointed to whatever folders?

Because I haven't changed my hosts file at all, just my httpd.conf file and all is working for the outside world.


No because your hosts file directs only that machine to the ips stated - all works OK to outside world because of httpd.conf.

Also by using the hosts file and modifying it on all other computers on my network they can then also access the web sites.

Hope that makes sense......
View user's profileSend private message
Display posts from previous:      
Post new topic Reply to topic


 Jump to:   



View next topic
View previous topic
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
You cannot attach files in this forum
You cannot download files in this forum
Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme
All times are GMT