Cascade Posted January 11, 2007 Share Posted January 11, 2007 Hey everyone , me and drace are having some problems getting our virtual host to work properly , here is the code we have[code]<VirtualHost *> ServerName www.paranoiaonline.co.uk ServerAlias paranoiaonline.co.uk DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/pwd/"</VirtualHost>#<VirtualHost *> ServerName www.cascade-online.com ServerAlias cascade-online.com DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/cascade"</VirtualHost><VirtualHost *> ServerName www.gamingsearch.co.uk ServerAlias gamingsearch.co.uk DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/cheats"</VirtualHost>[/code]www.paranoiaonline.co.uk works fine , it goes to the correct page , but as soon as we try www.cascade-online.com it doesnt work but we have found if we put www.cascade-online.com/cascade it does work , we dont know why we think there is an error somewhere in our code can someone please clarify it for us Link to comment Share on other sites More sharing options...
steviewdr Posted January 11, 2007 Share Posted January 11, 2007 Could it simply be that you are missing a trailing slash /DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/cascade"should be:DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/cascade/"-steve Link to comment Share on other sites More sharing options...
Drace Posted January 11, 2007 Share Posted January 11, 2007 Added the slashes, but it didn't make any difference other, it still needed the "/cascade" on the end to go to the correct site, although one thing Cascade missed out was that, the document root in the httpd file is set to:DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/pwd/"should this be changed to any thing in particular? Link to comment Share on other sites More sharing options...
Stray_Bullet Posted January 11, 2007 Share Posted January 11, 2007 Okay... Sorry havent been around. See you got one working...Did you forget to add this... [code]# For Name Based Virtual HostsNameVirtualHost *[/code]Before your vhost section like I told you in the other [url=http://www.phpfreaks.com/forums/index.php/topic,121040.msg498323.html#msg498323]forum post[/url]?Second you do not need the trailing slash... I gave you an example of what your vhost section should look like... Link to comment Share on other sites More sharing options...
Stray_Bullet Posted January 11, 2007 Share Posted January 11, 2007 Oops I meant this [url=http://www.phpfreaks.com/forums/index.php/topic,121040.msg498351.html#msg498351]Forum post[/url]!It should look like this...[code]## # $---> Section 1: HTTP Virtual Host Configuration <---$## # For Name Based Virtual HostsNameVirtualHost *#<VirtualHost *> ServerName www.paranoiaonline.co.uk ServerAlias paranoiaonline.co.uk DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/pwd"</VirtualHost>#<VirtualHost *> ServerName www.cascade-online.com ServerAlias cascade-online.com DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/cascade"</VirtualHost><VirtualHost *> ServerName www.gamingsearch.co.uk ServerAlias gamingsearch.co.uk DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/cheats"</VirtualHost>[/code] Link to comment Share on other sites More sharing options...
Drace Posted January 12, 2007 Share Posted January 12, 2007 We changed the VH as we were missing the code at the top, however after putting the updated VH and restarting apache we still have the same problem, they all load the paranoiaonline.co.uk site, this is really annoying me at the moment, any suggestions?? Also, could this be because of the DocumentRoot in the httpd file being set too:DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/pwd" Although, I've changed this to each of the web site directories e.g. pwd to cascade etc, and they all seem to be served with the paranoiaonline.co.uk web site, this is seriously messing me about at the mo, so any help is greatly appreciated folksDrace Link to comment Share on other sites More sharing options...
praeses Posted January 13, 2007 Share Posted January 13, 2007 I am having the exact same sympoms. Been beating my head against the wall for the past 4 hours, even started the httpd.conf from scratch, gone through replacing everythign with ips, tried making bogus virtual hosts or even additional strange ones. It doesn't matter what I do, everything always gets "caught" from the first one. Getting sick of re-reading the documentation over and over again. Sorry for sounding dismal, just putting in my few thoughts.Will be watching this thread very closely ^_^;; Link to comment Share on other sites More sharing options...
praeses Posted January 13, 2007 Share Posted January 13, 2007 Oh, the first one is working though, it follows the document root properly, and differs from the default one specified in the httpd.conf, when I had it there. Also tried specifying ports to get around the mod_ssl problem which shouldn't impact me for NameVirtualHost. (damn, cant edit after a couple mins of posting :( ) Link to comment Share on other sites More sharing options...
Stray_Bullet Posted January 13, 2007 Share Posted January 13, 2007 I have no idea then... It works good for me... If you pm me with your email addy I could send you all my config files but I dont see how that will help... I will if you think it would help... :-\ Link to comment Share on other sites More sharing options...
praeses Posted January 13, 2007 Share Posted January 13, 2007 I figure somehow I must be repeating the same mistakes... Just haven't been able to figure out what exactly. Link to comment Share on other sites More sharing options...
steviewdr Posted January 13, 2007 Share Posted January 13, 2007 Just a few ideas:Should the slashes be the other way? ->C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\cheats\Is your httpd.conf in dos format text? Edit it via notepad only.Is there any error logs?Its as if your VirtualHosts are NOT been registered. Is apache setup correctly to use VirtualHosts??Remove your VirtualHosts altogether - and I bet you will still get the same page.I dont know will this change things but, my config is like this:Listen 80#ommited usual configsServerName HostingServer.comNameVirtualHost *:80<VirtualHost *:80> ServerName www.paranoiaonline.co.uk ServerAlias paranoiaonline.co.uk DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/pwd/"</VirtualHost><VirtualHost *:80> ServerName www.gamingsearch.co.uk ServerAlias gamingsearch.co.uk DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/cheats/"</VirtualHost>-steve Link to comment Share on other sites More sharing options...
Drace Posted January 13, 2007 Share Posted January 13, 2007 im a complete noob when it comes to apache, you said something about is it set up correctly to use VirtualHosts, how would i know if it was???I apologise for my complete ignorance when it comes to this Link to comment Share on other sites More sharing options...
steviewdr Posted January 13, 2007 Share Posted January 13, 2007 Off hand it should just work.Apache2.2 has other command line commands apart from starting and stoping apache.apache2 -L apache2 -lapache2 -Vapache2 -t -D DUMP_VHOSTSapache2 -Sapache2 -t the above will check all your apache2 syntax.Now you may have to run the above commands via apachectl if you dont have apache2.exe etc.Lastly - perhaps just go with apache2 instead of apache2.2 Anyways - keep googling.-steve Link to comment Share on other sites More sharing options...
Drace Posted January 13, 2007 Share Posted January 13, 2007 Im curious, i have httpd.conf file and a seperate file for the VH (httpd-vhosts) could this be the root of my problems or not?? Link to comment Share on other sites More sharing options...
steviewdr Posted January 13, 2007 Share Posted January 13, 2007 yes - if httpd-vhosts is not included in httpd.confYou should have something like:Include /path/to/httpd-vhosts in httpd.conf-steve Link to comment Share on other sites More sharing options...
Recommended Posts