VirtualHost problem on port other than 80
Posted by: cpj (123.208.59.---)
Date: February 01, 2010 02:10PM

I can't run WAMP on port 80 so have set it up on port 82. This appears to be working as I get the wamp configuration page when i hit http:// localhost :82. So WAMP is running ok.

My problem is that the virtual host I have set up is not working. The page (index.php in the root of my virtualhost root is not returned when in hit it's URL.

My settings are below. When i hit http:// myserver :82 i get the WAMP configuration page in c:\wamp\www not index.php in c:\wamp\www\myserver

Any help apreciated. thanks.

==============
httpd.conf

Listen 82

ServerName localhost:82

DocumentRoot "c:/wamp/www/"

==============
httpd-vhosts.conf

NameVirtualHost *:82

<VirtualHost *:82>
ServerName localhost
DocumentRoot "C:/wamp/www"
</VirtualHost>

<VirtualHost *:82>
ServerName myserver
DocumentRoot "C:/wamp/www/myserver"
ErrorLog "C:/wamp/www/myserver/logs/error.log"
CustomLog "C:/wamp/www/myserver/logs/access.log" common
</VirtualHost>

==============
C:\WINDOWS\system32\drivers\etc\hosts

127.0.0.1 myserver

Options: ReplyQuote
Re: VirtualHost problem on port other than 80
Posted by: cpj (123.208.59.---)
Date: February 01, 2010 02:16PM

just to be clear.. I want to hit "c:\wamp\www\myserver\index.php" when I use the URL: http:// myserver :82

thanks

Options: ReplyQuote
Re: VirtualHost problem on port other than 80
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: February 01, 2010 04:57PM

switch the order around. put localhost at the bottom

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: VirtualHost problem on port other than 80
Posted by: cpj (123.208.59.---)
Date: February 01, 2010 05:27PM

Thanks for the feedback Steven, I switched the order of the VirtualHost sections.. but no luck. When I use the URL http:// myserver:82 Apache still returns /index.php. It's not feeding out the DocumentRoot of "myserver"

There are no errors in the logs either...

access.log is showing:

127.0.0.1 - - [01/Feb/2010:16:19:13 +0000] "GET / HTTP/1.1" 200 4101

So it's like Apache is not configured right. The VirtualHost "myserver" is not working.. I can't see why though.

Options: ReplyQuote
Re: VirtualHost problem on port other than 80
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: February 01, 2010 05:33PM

oh sorry didnt realise you had chnage things in the httpd.conf too


at the end of the httpd.conf u need to enable the vhosts file

did u do this?


u remove the # from the line

#include httpd-vhosts.conf (roughly like this, about 10 lines from end)

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: VirtualHost problem on port other than 80
Posted by: cpj (123.208.59.---)
Date: February 01, 2010 05:40PM

AHA! Thanks a million Steven. That was it.

i needed to uncomment:

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

in httpd.conf

Options: ReplyQuote


Sorry, only registered users may post in this forum.