| View previous topic :: View next topic |
| Author |
Message |
Tastiger
Joined: 28 May 2006
Posts: 25
|
| Posted: Sat Feb 24, 2007 9:44 am Post subject: Going Mad with Virtual hosts not redirecting.... |
|
|
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>
|
|
| Back to top |
|
lku homer
Joined: 29 May 2006
Posts: 104
|
| Posted: Sat Feb 24, 2007 2:29 pm Post subject: |
|
|
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. |
|
| Back to top |
|
Tastiger
Joined: 28 May 2006
Posts: 25
|
| Posted: Sun Feb 25, 2007 12:57 am Post subject: |
|
|
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. |
|
| Back to top |
|
trippin7464
Joined: 07 Sep 2007
Posts: 4
Location: Florida, USA
|
| Posted: Wed Apr 30, 2008 9:02 am Post subject: |
|
|
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. |
|
| Back to top |
|
Tastiger
Joined: 28 May 2006
Posts: 25
|
| Posted: Wed Apr 30, 2008 5:33 pm Post subject: |
|
|
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...... |
|
| Back to top |
|
| |