Apache cannot server directory

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Moderators, Developers

Post Reply
Author
Message
zuku
Posts: 8
Joined: Thu Jun 09, 2016 2:11 am

Apache cannot server directory

#1 Post by zuku » Fri Jun 14, 2019 1:57 pm

Hi,
I'm trying to install manually cacti 1.2.4 after removing it from debian "apt purge cacti" and I'm stuck on apache2 error:

Code: Select all

 AH01276: Cannot serve directory /usr/share/cacti/site/: No matching DirectoryIndex (index.php) found, and server-generated directory index forbidden by Options directive
1.if I create info.php file at /var/www/ it shows my installed php components
2.in /etc/apache2/sites-enables I have symlink @cacti.conf to >/sites-available/cacti.conf, cacti.conf have this config:

Code: Select all

Alias /cacti /usr/share/cacti/site

<Directory /usr/share/cacti/site>
        Options +FollowSymLinks
        AllowOverride None
        <IfVersion >= 2.3>
                Require all granted
        </IfVersion>
        <IfVersion < 2.3>
                Order Allow,Deny
                Allow from all
        </IfVersion>

        AddType application/x-httpd-php .php

        <IfModule mod_php5.c>
                php_flag magic_quotes_gpc Off
                php_flag short_open_tag On
                php_flag register_globals Off
                php_flag register_argc_argv On
                php_flag track_vars On
                # this setting is necessary for some locales
                php_value mbstring.func_overload 0
                php_value include_path .
        </IfModule>

        DirectoryIndex index.php
</Directory>
I have error when go to cacti site:

Code: Select all

Forbidden
You don't have permission to access /cacti/ on this server.
Apache/2.4.25 (Debian) Server at cacti Port 80
so where is my error, how could I fix this?

eholz1
Cacti User
Posts: 161
Joined: Mon Oct 01, 2018 10:09 am

Re: Apache cannot server directory

#2 Post by eholz1 » Fri Jun 14, 2019 4:43 pm

Hello Zuku,

What are you trying to do?
You might have to troubleshoot this on the apache web site, not cacti.

I have cacti-1.2.4 running on RHEL7.6 no problem. I use the standard cacti configuration.
i.e. expand the cacti-1.2.4 in /var/www (or wherever your httpd or httpd24 is installed), then I create two symbolic
links, one in /var/www and one in /var/www/html. The link is this: ln -sf /var/www/cacti-1.2.4 cacti. This works fine.

I would guess you are complicating your install. Suggest reviewing Apache docs, if you want to use
custom directories and *.conf files in your config.

eholz1

User avatar
camerabob
Cacti User
Posts: 305
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: Apache cannot server directory

#3 Post by camerabob » Mon Jun 17, 2019 7:41 am

The second one regarding no access kicked me in the teeth for quite some time as well. This was a CentOS install using YUM. I followed the guides, did all I thought I had to, then found out that the <directory> statement isn't in the /etc/httpd/conf/httpd.conf file.

Instead, vi /etc/httpd/conf.d/cacti.conf and make the necessary changes in there.

Code: Select all

<Directory /usr/share/cacti/>
        <IfModule mod_authz_core.c>
                # httpd 2.4
                # Changed the below from 'Require host localhost'
                Require all granted
        </IfModule>
#       <IfModule !mod_authz_core.c>
#                httpd 2.2
#               Order deny,allow
#               Deny from all
#               Allow from localhost
#       </IfModule>
</Directory>
See the Cacti 1.x templates I use at: http://www.camerabob.com/cacti

Live: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.16-46.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.8-1.el7 @ CentOS 7-7.1908.0.el7 & PHP 5.4.16-46.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Post Reply