Apache2 doesn't give files away

7,106

Solution 1

Issues lies on the apache configuration for munin . As default apache config for munin will allow only the localhost. As you have used http://myhost/munin/. So, we have to modify the apache for the munin to access from all .You can find the default apache config for munin in dir /etc/munin/ as apache.conf .

Look for

Allow from localhost 127.0.0.0/8 ::1

Change to

Allow from all

After modifying restart the apache

Solution 2

I just ran into this problem. It turns out that the .htaccess file was not changed when I ran these commands

sudo chown -R munin:www-data *
sudo chmod -R g+r *

from /var/www/munin. The '*' file glob excludes 'hidden' files who's name start with '.'

An explicit chown for the .htaccess file

sudo chown -R www-data:www-data .htaccess

fixed the problem. (No need to give munin ownership of the .htaccess file.)

Share:
7,106

Related videos on Youtube

Worker
Author by

Worker

Updated on September 18, 2022

Comments

  • Worker
    Worker 9 months

    what could it be a reason for such an error:

    If I go: http://myhost/munin/

    I get 403 Error: Forbidden. You don't have permission to access /munin/ on this server.

    Permissions for files are the following:

    max@ubuntu:/var/www$ ls -l
    total 8
    -rw-r--r-- 1 www-data www-data  180 2011-12-28 16:06 index.html
    drwxr-xr-x 3 www-data www-data 4096 2011-12-28 08:55 munin
    

    ADDITIONAL:

    Thank you very much for your help! I did fix it by deleting the dir and targeting munin output html to another dir (actually with the same permissions). I use that apache only for munin, so that strange behavior is ignored.

    I did try to access that my numin stats via DNS name. All files in the same www dir were available, also all files in sub/sub/sub/dirs were also available. Only ../munin dir was not working as I expected for some unidentified reason.

    • Worker
      Worker over 11 years
      So, I deleted /var/www/munin and pointed munin to another just created folder, now it works. Permissions are exactly the same.. Strange thing. If I create munin folder again - there is no way I can get into it via browser - 403 Error always. This is not my first munin setup, but this case I see for the first time.
    • Admin
      Admin over 11 years
      Also... do a 'tail -f' on the Apache log file for a clue as well?
    • aneeshep
      aneeshep over 11 years
      And also the url that you used to access it. Are you using 'localhost' or the ip address?.
    • duffydack
      duffydack over 11 years
      if by 'give files' you mean you want a file listing, you might need to add the Indexes override. in /etc/apache2/sites-enabled/000-default either set AllowOverride None to AllowOverride Indexes in the DocumentRoot section (not recommended) or add a new directory config like so. pastebin.com/rsfDiAe4 or if you just want a page loading up you might just need an index.html/index.php file in the folder. dont forget to restart apache2 sudo service apache2 restart
  • Worker
    Worker over 11 years
    No, there was index.html, I did check it.
  • Worker
    Worker over 11 years
    I use separately fresh installed Apache2. Is it perfectly working with all other files and sub/sub/diers but /munin. I moved munin output to another dir, so now it is just fine.