New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

[SOLVED] Webserver "Forbidden" everything else OK.

Got problems with your B2 or B3? Share and get helped!
Post Reply
agkbill
Posts: 27
Joined: 15 Jan 2010, 13:44

[SOLVED] Webserver "Forbidden" everything else OK.

Post by agkbill »

Hi all bubba users,


I have a problem to access the webserver from LAN 192.168.10.1

I get:
Forbidden

You don't have permission to access / on this server.
Apache/2.2.9 (Debian) mod_fastcgi/2.4.2 PHP/5.2.6-5ex1 with Suhosin-Patch mod_ssl/2.2.9 OpenSSL/0.9.8c Server at 192.168.10.1 Port 80
but ssh works ok and also my NFS to my bubba works ok.

Rights on my web folder are:
drwxrwxr-- 4 christer users 4096 2010-07-20 22:17 web
bubba:/home/web# ls -l
total 32
-rw-r--r-- 1 christer users 1150 2009-11-05 08:46 favicon.ico
-rw-r--r-- 1 christer users 926 2009-11-05 08:46 ie6.css
drwxr-xr-x 2 christer users 4096 2009-12-19 15:19 images
-rwxr-xr-x 1 christer users 927 2010-04-07 13:48 index.html
-rw-r--r-- 1 christer users 2874 2009-11-05 08:46 index.html.old
drwxr-xr-x 3 christer users 4096 2009-12-19 15:19 js
-rw-r--r-- 1 christer users 5572 2009-11-05 08:46 screen.css
bubba:/home/web#

I really dont know were to look, any ideas what might have happen?


Thank you!

All the best,
/Christer
Last edited by agkbill on 10 Dec 2010, 10:11, edited 1 time in total.
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: Webserver "Forbidden" everything else OK.

Post by Ubi »

The access is forbidden by the web server. THis is because your web server is running under a different user id than regular users for security reasons. For some reason you made your webdir non-executable for world, which means apache cannot get into that folder and you get an access denied.
agkbill
Posts: 27
Joined: 15 Jan 2010, 13:44

Re: Webserver "Forbidden" everything else OK.

Post by agkbill »

Thank you Ubi,

Yes I realized it have to do with access, and I did changes on user right a while back to get my NFS setup to work. Maybe I got this wrong by that.

Anyway, I think I might solved it.

I did:

Code: Select all

chmod -R a+rx ./web
giving x and w right for all in bubba2 /home/web folder and everything under it.

Is it OK from a security point of view to do this?

Now I can access my webpage OK.

Best regards,
/Christer
ryz
Posts: 183
Joined: 12 Feb 2009, 06:03

Re: Webserver "Forbidden" everything else OK.

Post by ryz »

Well that should do the trick but now you have said that all files under web/ are executable which are most likely not what you want. This could potently be a security risk and lead to problems ahead.

The questions is if there is any file under web/ that really are an executable if not you could run this command to remove the execution bit on all the files while keeping them on all the directories. Directories needs both the read and the execution bit to be set to be fully accessible.

Code: Select all

find ./web -type f -exec chmod a-x {} \;
If you did have the group permission intact the easiest way would then have been to run these two commands

Code: Select all

chmod -R o=g ./web
chmod -R 0-w ./web
Where you first give others the same permission as the group and then made sure to remove any write permission from others. Since you decided to write over all permissions you do not longer have that option unfortunatly.
agkbill
Posts: 27
Joined: 15 Jan 2010, 13:44

Re: [SOLVED] Webserver "Forbidden" everything else OK.

Post by agkbill »

It all works og now, thank for helping.


Best regards,
/Christer
Post Reply