Forum Moderators: phranque

Message Too Old, No Replies

"Forbidden" Error

I tried to setup 2 websites, neither work

         

nrodes

1:43 am on Nov 22, 2008 (gmt 0)

10+ Year Member



I have recently installed Apache (with Wamo Server2) on my computer. I got one website (example2.com) setup. I have now attempted to setup another website as the default (example.com). When I go to example2.com or example.com I get a FORBIDDEN error. How come it does this? When I go to localhost it shows the contents of example.com like it should. How can I fix it and why does localhost work when example2.com and example.com fail?

Here is my virtual host config:

NameVirtualHost *:80

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

<VirtualHost *:80>
ServerName www.example2.com
ServerAlias example2.com example2
DocumentRoot C:/wamp/www/example2
ErrorLog C:/wamp/www/example2./logs/error.log
CustomLog C:/wamp/www/example2/logs/access.log common
</VirtualHost>
Thanks for any help.

[edited by: jdMorgan at 1:49 am (utc) on Nov. 22, 2008]
[edit reason] example.com [/edit]

jdMorgan

1:57 am on Nov 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm suspicious of the domain names without TLDs, as in the "example2" in this line:
 ServerAlias example2.com example2 

See [httpd.apache.org...]

Also, I'm not sure which version of Apache you are running. Versions previous to 1.3.12 will require an IP address in the <VirtualHost> and NameVirtualHost directive.

Jim

jdMorgan

2:02 am on Nov 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also, I presume you have pointed your two domains to your computer's LAN IP address in the 'hosts' file of your computer. Its location varies, but regardless of the operating system, the name of the file is 'hosts' -- all lowercase, no file extension. It usually contains examples for its own use, or is accompanied by an example file called 'hosts.sam'

Jim

nrodes

7:25 pm on Nov 22, 2008 (gmt 0)

10+ Year Member



I did change the hosts file. I am still getting the same error. this is what it looks like now:

NameVirtualHost 192.168.0.140:80

<VirtualHost 192.168.0.140:80>
ServerName www.example.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 www.example2.com
DocumentRoot C:/wamp/www/najisite
ErrorLog C:/wamp/www/najisite./logs/error.log
CustomLog C:/wamp/www/najisite/logs/access.log common
</VirtualHost>

[edited by: eelixduppy at 10:03 pm (utc) on Nov. 24, 2008]
[edit reason] exemplified [/edit]

jdMorgan

1:24 am on Dec 2, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



These problems are often hard to debug. Is there any useful information in the server error log or the operating system's error event log?

Jim