LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-01-2008, 12:08 PM   #1
mitchell2345
Member
 
Registered: Aug 2008
Posts: 55

Rep: Reputation: 16
Apache Help


Hi,

I have appache running with no problems on my CentOS box. Serving my MythWeb and MySQLadmin page.

I am trying to get MRTG pages to display. MRTG is configure right and pulling data from my router but i cant view the html pages through apache. when trying 192.168.0.202/mrtg I get a 403 forbidden error message.

Details:
MRTG HTML files are in: /var/www/html/mrtg
Code:
[root@mythtv html]# pwd
/var/www/html
[root@mythtv html]# ls -l
total 12
drwxr-xr-x  2 apache apache 4096 Nov  1 11:50 mrtg
drwxr-xr-x 10 root   root   4096 Aug  9 13:54 mysql
drwxrwxr-x 10 apache apache 4096 Aug  9 11:24 mythweb

[root@mythtv mrtg]# ls -lh /var/www/html/mrtg/
total 1.2M
-rwxr-xr-- 1 apache apache 1.4K Nov  1 11:50 192.168.0.1_12-day.png
-rwxr-xr-- 1 apache apache 6.3K Nov  1 11:50 192.168.0.1_12.html
-rw-rw-r-- 1 apache apache  48K Nov  1 11:50 192.168.0.1_12.log
httpd.conf file:
Code:
<Directory "/var/www/html/mrtg">
    Options Indexes FollowSymLinks
    AuthType Basic
    AuthName "MRTG"
    AuthUserFile /etc/httpd/conf/httpd-passwords
    require user mitchell
    Order allow,deny
    Allow from 192.168.0.
    Satisfy any
</Directory>
(this should work as i use the same code for Mythweb

Logs:
error_log:
Code:
[Sat Nov 01 12:03:25 2008] [error] [client 192.168.0.149] client denied by server configuration: /var/www/mrtg
access_log:
Code:
192.168.0.149 - - [01/Nov/2008:12:03:25 -0500] "GET /mrtg/ HTTP/1.1" 403 285 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3 (.NET CLR 3.5.30729)"
Why am I getting this 403 error?

Thanks,
Mitchell
 
Old 11-01-2008, 12:21 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Do you need to set up an Alias for that directory?

Quote:
<Directory "/var/www/html/mrtg">
...
client denied by server configuration: /var/www/mrtg
/var/www/html/mrtg != /var/www/mrtg

Maybe you are more restrictive at the / directory, so you're seeing this error. (Again, you could make a /mrtg Alias.)

---------

Edit: I take it back. I just tested out a config similar to your own, and an Alias was not required. (i.e. My DocumentRoot is /var/www/html.)

I'm not sure what your issue is.

Last edited by anomie; 11-01-2008 at 12:27 PM.
 
Old 11-01-2008, 12:26 PM   #3
mitchell2345
Member
 
Registered: Aug 2008
Posts: 55

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by anomie View Post
Do you need to set up an Alias for that directory?



/var/www/html/mrtg != /var/www/mrtg

Maybe you are more restrictive at the / directory, so you're seeing this error. (Again, you could make a /mrtg Alias.)
I noticed that from the logs but i dont know where /var/www/mrtg is coming from. I dont have a /var/www/mrtg:

Code:
[root@mythtv cfg]# ls /var/www/
cgi-bin  error  html  icons  manual  usage
Ideas on how to fix that?

Mitchell
 
Old 11-01-2008, 12:33 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
In light of my edit (in my first post), I would double check your DocumentRoot. If you changed it to /var/www then that might explain the error.
 
Old 11-01-2008, 12:50 PM   #5
mitchell2345
Member
 
Registered: Aug 2008
Posts: 55

Original Poster
Rep: Reputation: 16
nope, document root is correct:

DocumentRoot "/var/www/html"

Im really confused becuase 192.168.0.202/mythweb works but 192.168.0.202/mrtg gives 403!

AHHH.
 
Old 11-01-2008, 01:46 PM   #6
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
Remove all access restrictions (auth and 'allow from') from the mrtg directory and try browsing again. The apache logs might then give a better indication of what's happening.
 
Old 11-01-2008, 01:53 PM   #7
mitchell2345
Member
 
Registered: Aug 2008
Posts: 55

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by sleddog View Post
Remove all access restrictions (auth and 'allow from') from the mrtg directory and try browsing again. The apache logs might then give a better indication of what's happening.
Ok, so my new file has:

#<Directory "/var/www/html/mrtg">
# Options Indexes FollowSymLinks
# AuthType Basic
# AuthName "MRTG"
# AuthUserFile /etc/httpd/conf/httpd-passwords
# require user mitchell
# Order allow,deny
# Allow from 192.168.0.
# Satisfy any
#</Directory>

I posted my logs from apache ealier but here they are again. I have cat /dev/null'ed them before hitting the page so this is what is generated when i hit that exact page.

Code:
[root@mythtv httpd]# cat access_log 
192.168.0.149 - - [01/Nov/2008:13:51:46 -0500] "GET /mrtg/index.html HTTP/1.1" 403 295 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3 (.NET CLR 3.5.30729)"
[root@mythtv httpd]# cat error_log 
[Sat Nov 01 13:51:46 2008] [error] [client 192.168.0.149] client denied by server configuration: /var/www/mrtg
Again, where the heck is that /var/www/mrtg coming from?!

Mitchell
 
Old 11-01-2008, 01:59 PM   #8
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Rep: Reputation: 73
Man look at additional include configuration files for apache, if especial you install mtrg and apache from centos repo, I think they are in /etc/httpd/conf.d/mtrg.conf or something like that.

You should have in /etc/httpd/conf/httpd.conf some entry:

Include /etc/httpd/conf.d/*

Just check...

Check coz you are confusing the server having maybe 2 entries.
 
Old 11-01-2008, 02:04 PM   #9
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
If you make another directory under 'html', e.g., 'test', and put an html file in it, can you browse it OK?

If no, then there's an issue with your httpd.conf. Check httpd.conf to make sure there aren't two DocumentRoot lines. Review configuration for the / directory.

If you can browse it OK, then the problem is specific to the 'mrtg' directory. Is there an .htaccess file in the mrtg directory? Check its contents. grep for any occurrence of 'mrtg' in httpd.conf, or in any file included in httpd.conf.
 
Old 11-01-2008, 02:45 PM   #10
mitchell2345
Member
 
Registered: Aug 2008
Posts: 55

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by robertjinx View Post
Man look at additional include configuration files for apache, if especial you install mtrg and apache from centos repo, I think they are in /etc/httpd/conf.d/mtrg.conf or something like that.

You should have in /etc/httpd/conf/httpd.conf some entry:

Include /etc/httpd/conf.d/*

Just check...

Check coz you are confusing the server having maybe 2 entries.
THANK YOU THANK YOU THANK YOU!!!!

That was it.

Originally mrtg.conf was:
Code:
[root@mythtv www]# cat /etc/httpd/conf.d/mrtg.conf
#
# This configuration file maps the mrtg output (generated daily)
# into the URL space.  By default these results are only accessible
# from the local host.
# 
Alias /mrtg /var/www/mrtg

<Location /mrtg>
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
    Allow from ::1
    # Allow from .example.com
</Location>
Changed it to:
Code:
[root@mythtv ~]# cat /etc/httpd/conf.d/mrtg.conf
#
# This configuration file maps the mrtg output (generated daily)
# into the URL space.  By default these results are only accessible
# from the local host.
# 
Alias /mrtg /var/www/html/mrtg

<Location /mrtg>
    Order deny,allow
    Deny from all
    Allow from 192.168.0.
</Location>
And to give authentication to the outside I changed my httpd.conf file back to:
Code:
<Directory "/var/www/html/mrtg">
    Options Indexes FollowSymLinks
    AuthType Basic
    AuthName "MRTG"
    AuthUserFile /etc/httpd/conf/httpd-passwords
    require user mitchell
    Order allow,deny
    Allow from 192.168.0.
    Satisfy any
</Directory>
Restarted apache and BINGO.

This makes no sense..Why would MRTG rpms make the config file for web pages point to /var/www when the default Apache root directory is /var/www/html!

Well its working now!

Thank You!
Mitchell
 
Old 11-01-2008, 06:49 PM   #11
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by robertjinx
Man look at additional include configuration files for apache, if especial
you install mtrg and apache from centos repo, I think they are in /etc/httpd/conf.d/mtrg.conf
or something like that.
Good catch. IIRC, rpms for webalizer, awstats, etc. on CentOS also install config files in conf.d.
 
  


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 program writes files in the apache group, how can I change? muskiediver Linux - Security 5 01-17-2007 12:27 PM
Mail from Apache being rejected - Cannot route to sender apache@localhost.localdomain jimwillsher Linux - Networking 2 01-19-2006 12:41 AM
Apache 1.3.33 (debian built) and Apache SSL does not respond to the proper ports lqorg_user Linux - Networking 0 11-06-2005 04:11 PM
Apache Webserver 403 Forbidden Errors (User not in apache group?) Mankind75 Mandriva 4 07-08-2004 05:30 AM
apache benchmarks (apache v13 / apache v20) ; large differences between benchmarking markus1982 Linux - Software 0 02-08-2003 10:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:10 AM.

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
Open Source Consulting | Domain Registration