Apache Virtual Host Problem

  • nrodes
  • Born
  • Born
  • nrodes
  • Posts: 3

Post 3+ Months Ago

I installed Wamp Server 2 on my computer. I succesfully hosted one website. I found directions to setup virtual hosts. Now neither of my websites work.

Virtual host config:
Quote:
NameVirtualHost 192.168.0.140:80

<VirtualHost 192.168.0.140:80>
ServerName http://www.soaringserver.com
DocumentRoot C:/wamp/www/soaringserver
ErrorLog C:/wamp/www/soaringserver/logs/error.log
CustomLog C:/wamp/www/soaringserver/logs/access.log common
</VirtualHost>

<VirtualHost 192.168.0.140:80>
ServerName http://www.najisite.com
DocumentRoot C:/wamp/www/najisite
ErrorLog C:/wamp/www/najisite./logs/error.log
CustomLog C:/wamp/www/najisite/logs/access.log common
</VirtualHost>


Here is my hosts file:
Quote:
127.0.0.1 localhost
127.0.0.1 soaringserver.com
127.0.0.1 http://www.soaringserver.com
127.0.0.1 najisite.com
127.0.0.1 http://www.najisite.com


does anyone know whats wrong?

thanks for any help :)
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Tell us about what you did, start from the beginning and spare no details.
  • nrodes
  • Born
  • Born
  • nrodes
  • Posts: 3

Post 3+ Months Ago

Ok, first I bought a domain name, najisite.com. Then I downloaded Abyss Web Server. My website didn't work remotely so I configured my router with a virtual server to forward requests to my computer. A little while later I decided I wanted to put a forum on najisite.com. I had already setup php with Abyss. I tried to setup MySQL but it was very difficult and everybody told me it was a waste of time. I uninstalled Abyss and installed Wamp Server 2, free php, apache & MySQL server software. This worked fine. Some of my friends wanted websites so I thought maybe I could setup name-based virtual hosts. I bought soaringserver.com as a place for people to go to edit their websites and also as a test for the virtual hosting. I found directions(http://guides.jlbn.net/setvh/setvh1.html) for virtual hosts made specifically for Wamp Server 2 and I followed them. It gave me a FORBIDDEN error. I changed different parts of what it told me to do thinking maybe they had made a mistake. It still didn't work. I went to severaal different forums asking for help and nobody seemed to know what was wrong. I found this forum with a google search and here I am.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

"Forbidden" errors are usually a problem with permissions for one of the folders Apache (yes wamp is using Apache) needs to use.

Did you copy/paste those virtualhost containers directly from your configuration ?

I can see a likely typo in one line. Note the period/dot after the word "najisite".
Code: [ Select ]
ErrorLog C:/wamp/www/najisite./logs/error.log


What doesn't make sense is that both sites would give you a forbidden error after adding a second virtual host. :scratchhead:
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

Try this:
Code: [ Select ]
NameVirtualHost *:80

<VirtualHost *:80>
ServerName http://www.soaringserver.com
DocumentRoot C:/wamp/www/soaringserver
ErrorLog C:/wamp/www/soaringserver/logs/error.log
CustomLog C:/wamp/www/soaringserver/logs/access.log common
</VirtualHost>

<VirtualHost *:80>
ServerName http://www.najisite.com
DocumentRoot C:/wamp/www/najisite
ErrorLog C:/wamp/www/najisite./logs/error.log
CustomLog C:/wamp/www/najisite/logs/access.log common
</VirtualHost>
  1. NameVirtualHost *:80
  2. <VirtualHost *:80>
  3. ServerName http://www.soaringserver.com
  4. DocumentRoot C:/wamp/www/soaringserver
  5. ErrorLog C:/wamp/www/soaringserver/logs/error.log
  6. CustomLog C:/wamp/www/soaringserver/logs/access.log common
  7. </VirtualHost>
  8. <VirtualHost *:80>
  9. ServerName http://www.najisite.com
  10. DocumentRoot C:/wamp/www/najisite
  11. ErrorLog C:/wamp/www/najisite./logs/error.log
  12. CustomLog C:/wamp/www/najisite/logs/access.log common
  13. </VirtualHost>


I am not familiar with the Window's env as it relates to Apache, however I have not hear of adding protocols to the ServerName directive.
Also make sure you removed the default entries for virtual hosts.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Those ServerName directive looked odd to me too, but sure enough,

http://httpd.apache.org/docs/2.2/mod/co ... servername
Code: [ Select ]
Syntax: ServerName [scheme://]fully-qualified-domain-name[:port]
  • nrodes
  • Born
  • Born
  • nrodes
  • Posts: 3

Post 3+ Months Ago

Thanks for everyone's suggestions. I've used all of them and I still get the same error. I'd still appreciate suggestions, I'm just letting you guys know that none of them work so far.

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 18 guests
  • 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 post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.