LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-09-2009, 04:33 PM   #1
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Rep: Reputation: 30
apache access forbidden


I have started apache and sarg on my server but I don't seem to be able to view anything when I go to http://myip.xxx.xxx.xxx/sarg

just says 403 forbidden
Forbidden

You don't have permission to access /sarg on this server.
Apache/2.2.3 (FH) Server at 88.xxx.xxx.xxx Port 80

any clues as to why?

Last edited by qwertyjjj; 08-09-2009 at 04:35 PM.
 
Old 08-09-2009, 08:38 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
When troubleshooting 403's best check what user Apache runs as and verify access perms on $DOCROOT/sarg dir are sufficient (and check the httpd log for clues if you have to).
 
Old 08-10-2009, 03:49 AM   #3
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by unSpawn View Post
When troubleshooting 403's best check what user Apache runs as and verify access perms on $DOCROOT/sarg dir are sufficient (and check the httpd log for clues if you have to).
Right, how do I fine out what user apache runs as?
I assume it's as apache or web?
chmod changes perms - I couldn't find any info on google for how to list permissions on a directory. When I do locate sarg it only give me the install folder even though it's definitely there somewhere.
where is the httpd log stored? Do I need to turn logging on or is it automatic?
 
Old 08-10-2009, 03:53 AM   #4
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

Rep: Reputation: 58
Try keeping an index.html file in the directory sarg. then access this.

Other way is to turn the directory listing on in the apache conf file
 
Old 08-10-2009, 04:35 AM   #5
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by PMP View Post
Try keeping an index.html file in the directory sarg. then access this.

Other way is to turn the directory listing on in the apache conf file
But what should the index.html file point to?
 
Old 08-10-2009, 05:47 AM   #6
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

Rep: Reputation: 58
My aim for keeping the index.html inside it is to see wether your configuration is serving the request or not. whenever it finds a directory in the URL it looks for index.html or default.html file.
In your case I believe no such file is present in this directory. hence it tires to list the contents of this directory, But unfortunately in your httpd configuration file you have not allowed directory listing, thus you the forbidden error.
 
Old 08-10-2009, 05:53 AM   #7
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by PMP View Post
My aim for keeping the index.html inside it is to see wether your configuration is serving the request or not. whenever it finds a directory in the URL it looks for index.html or default.html file.
In your case I believe no such file is present in this directory. hence it tires to list the contents of this directory, But unfortunately in your httpd configuration file you have not allowed directory listing, thus you the forbidden error.
Well...if I type in http://IP.IP.IP.IP/
it gives me the default apache page of index.html saying a site has not been set up yet.
Does the sarg folder contain html files?
I jyst checked the directory in the arg folder - there is an index.html there already
chmod 755 /var/www/sarg doesn't help

Last edited by qwertyjjj; 08-10-2009 at 05:56 AM.
 
Old 08-10-2009, 06:36 AM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
Quote:
Originally Posted by qwertyjjj View Post
Right, how do I fine out what user apache runs as? I assume it's as apache or web?
Don't assume: make certain. Look at its main configuration file and the startup script.


Quote:
Originally Posted by qwertyjjj View Post
chmod changes perms - I couldn't find any info on google for how to list permissions on a directory.
Running 'ls -ld /path/to/directory' (or 'stat -c "%a %U %G" /path/to/directory') will show.


Quote:
Originally Posted by qwertyjjj View Post
When I do locate sarg it only give me the install folder even though it's definitely there somewhere.
Sarg may use its own configuration file to be included by the running webserver from say /etc/httpd/conf.d/. The configuration file may include Allow/Deny rules.


Quote:
Originally Posted by qwertyjjj View Post
where is the httpd log stored? Do I need to turn logging on or is it automatic?
Both questions can be answered by reading its main configuration file.
 
Old 08-10-2009, 06:40 AM   #9
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
I have 2 apache.conf files:
/usr/share/matrixsa-webware/WebKit/Adapters/mod_webkit/apache.conf
/usr/share/matrixsa-webware/WebKit/Adapters/mod_webkit2/apache.conf

which one does the startup?

I cannot find any log files in: /var/log/httpd/
though it seems there is an access_log folder but using cd I can't get into it, says invalid name

Last edited by qwertyjjj; 08-10-2009 at 06:50 AM.
 
Old 08-10-2009, 06:56 AM   #10
jeromeNP7
Member
 
Registered: Jun 2009
Posts: 101

Rep: Reputation: 19
Apache configuration files should be in /etc/httpd on RedHat based systems (like CentOS, which mimicks RHEL). Your web directory should be /var/www/html, unless you have choosen other locations during installation. My interpretation of your problem is that sarg is not within /var/www/html or it is simply an empty directory or has no index.* file(s) or directory permissions are not correct.

Linux

Last edited by jeromeNP7; 09-04-2009 at 09:51 PM.
 
Old 08-10-2009, 07:03 AM   #11
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by jeromeNP7 View Post
Apache configuration files should be in /etc/httpd on RedHat based systems (like CentOS, which mimicks RHEL). Your web directory should be /var/www/html, unless you have choosen other locations during installation. My interpretation of your problem is that sarg is not within /var/www/html or it is simply an empty directory or has no index.* file(s) or directory permissions are not correct.
sarg is in /var/www/sarg but the index file is there.
I chmodded the folder to 755.

There are no files at all in /var/www/html
The current default page when I request http://myip.myip.myip.myip loads up from /var/www/error/noindex.html

Since I can see the sarg folder and get to it on the web using http://myip.xx.xx.xx/sarg but get a 403 error, it must be permissions. But 755 should be enough shouldn't it?

Last edited by qwertyjjj; 08-10-2009 at 07:12 AM.
 
Old 08-10-2009, 07:16 AM   #12
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by qwertyjjj
Since I can see the sarg folder and get to it on the web but get a 403 error, it must be permissions. But 755 should be enough shouldn't it?
775 sure is enough but make sure that all the folders down from the root are readable by the webuser.

Quote:
Originally Posted by qwertyjjj
sarg is in /var/www/sarg but the index file is there.
I chmodded the folder to 755.
The log files should give you a hint what going on. Do a tail -f /var/log/http/acces_log and then connect to the webserver

Else I would just check on the configuration file or do a apachectl -S to get a view of all the hosts your apache is configured for.

Nother thing to try out is to create a file like "my.html" inside the /var/www/sarg folder and call it up. If this succedes you know that the permissions are right.
 
Old 08-10-2009, 07:19 AM   #13
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Try to move the sarg folder under /var/www/html and see if it is accessible.
 
Old 08-10-2009, 07:20 AM   #14
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by zhjim View Post
775 sure is enough but make sure that all the folders down from the root are readable by the webuser.



The log files should give you a hint what going on. Do a tail -f /var/log/http/acces_log and then connect to the webserver

Else I would just check on the configuration file or do a apachectl -S to get a view of all the hosts your apache is configured for.

Nother thing to try out is to create a file like "my.html" inside the /var/www/sarg folder and call it up. If this succedes you know that the permissions are right.
I can't get to access_log ?!

Code:
[root@localhost log]# cd /var/log/httpd
[root@localhost httpd]# dir
access_log  error_log  ssl_access_log  ssl_error_log  ssl_request_log
[root@localhost httpd]# cd access_log
-bash: cd: access_log: Not a directory
[root@localhost httpd]# cd /var/log/httpd/access_log
-bash: cd: /var/log/httpd/access_log: Not a directory
[root@localhost httpd]#
Quote:
Originally Posted by linuxlover.chaitanya View Post
Try to move the sarg folder under /var/www/html and see if it is accessible.
Did that but still no luck

Last edited by qwertyjjj; 08-10-2009 at 07:32 AM.
 
Old 08-10-2009, 07:37 AM   #15
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,012

Original Poster
Rep: Reputation: 30
tail -f /var/log/httpd/access_log gives this when I access the page
86.xxx.xxx.xx - - [10/Aug/2009:12:36:38 +0100] "GET /sarg HTTP/1.1" 403 281 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11"

[root@localhost ~]# apachectl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:443 localhost.localdomain (/etc/httpd/conf.d/ssl.conf:81)
Syntax OK
[root@localhost ~]#

Last edited by qwertyjjj; 08-10-2009 at 07:39 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache access forbidden to user dirs. Spudley SUSE / openSUSE 1 12-29-2005 02:53 AM
Forbidden access to soft link on apache web server bnj Linux - Software 3 05-03-2005 09:14 AM
Forbidden access to apache server wisdom Linux - Software 2 12-25-2004 10:29 PM
Error 403 Forbidden access in Apache anoop_cn Linux - Software 1 09-21-2004 10:32 AM
Apache - 403 Forbidden - Access to Subdirectories dieter Linux - Networking 2 03-25-2004 01:51 PM


All times are GMT -5. The time now is 06:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration