logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: 403 Forbidden when trying to connect to http://myserver/
Author
sandworm



Joined: 29 Jun 2010
Posts: 4

PostPosted: Tue 29 Jun '10 17:41    Post subject: 403 Forbidden when trying to connect to http://myserver/ Reply with quote

Have Wamp set up on a windows box and all is working fine when connecting to http://localhost/ but when I try and connect to http://myserver/ - which I've set with:
Code:
ServerName myserver:80


I get 403 forbidden.

Have added a line to hosts

Code:
127.0.0.1       localhost myserver


And can ping and get a result for ip, localhost and myserver.

I maybe remembering wrong but I'm sure I've done this in the past and everything worked.

Am only using the whole thing for testing locally.

Any help gratefully received.

Thanks
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Tue 29 Jun '10 18:14    Post subject: Reply with quote

First thought would be DocumentRoot for myserver is different than that of localhost. For each docroot there must be a corresponding <Directory> container with few exceptions.

If Docroots are same then the <Directory> stuff for localhost is most likely inside a <VirtualHost> at which point that <Directory> stuff is connected only to localhost, options then are either duplicate it in the myserver VHost or simply pull it out from inside the localhost's vhost and put anywhere outside of all VHosts becoming server wide at that point.
Back to top
sandworm



Joined: 29 Jun 2010
Posts: 4

PostPosted: Wed 30 Jun '10 9:57    Post subject: Reply with quote

Thanks glsmith.

The doc root and directory are both c:/webserver/www/public_html/

You mention Vhosts I havent defined any, should I?

Thanks
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Wed 30 Jun '10 20:23    Post subject: Reply with quote

Hmmmmm ok,

Are both, so, you have two server names in the open?

ServerName localhost:80
ServerName myserver:80

It honestly should not matter, even tho one will be ignored, or worse, Apache mail fail to start. ServerAlias is what you would want to use when using multile names into a single document root, especially in the server wide section.

But for now, what is in the error log about this 403
Client denied for what reason?
Back to top
sandworm



Joined: 29 Jun 2010
Posts: 4

PostPosted: Thu 01 Jul '10 12:57    Post subject: Reply with quote

Thanks again.

No just the one server name

ServerName myserver:80

Thats what is confusing me. I assumed (and am sure I've set this up ok when using apache in the past) that changing the default of ServerName localhost:80 in httpd.conf to SeverName aName:80 would allow me to have intranet type connections to http://aName.

Anyway I get this in the apache_error.log

Code:
[error] [client <ipaddress>] client denied by server configuration: C:/webserver/www/public_html/
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 02 Jul '10 23:06    Post subject: Reply with quote

put this at the bottom of httpd.conf, restart and give it a try

<Directory "C:/webserver/www/public_html">
Options Indexes FollowSymLinks
AllowOverride FileInfo
Order Allow,Deny
Allow from all
</Directory>

Or better, below the ServerName & Docroot you changed the are two of these Directory containers, one with just a / and the second should show the old docroot, if it does, just change it. Make sure the Options Indexes is there OR make sure there is an index.html file there.

Every Docroot needs a matching Directory container to give access to the location on the filesystem. Sorry I missed this post of yours yesterday.
Back to top
sandworm



Joined: 29 Jun 2010
Posts: 4

PostPosted: Tue 06 Jul '10 10:25    Post subject: Reply with quote

Thanks again. Tried both of the above suggestions with no luck. So I uninstalled Wamp and have reinstalled Apache, php and mysql manually. Now everything is working fine (so far:)!)

Again many thanks for you help.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Tue 06 Jul '10 10:31    Post subject: Reply with quote

Good ... besides .. Wamp is old (2.2.11) and manually installing them isn't that hard.
Back to top


Reply to topic   Topic: 403 Forbidden when trying to connect to http://myserver/ View previous topic :: View next topic
Post new topic   Forum Index -> Apache