Apache cannot server directory

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

Moderators: Developers, Moderators

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

Apache cannot server directory

Post by zuku »

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: 254
Joined: Mon Oct 01, 2018 10:09 am

Re: Apache cannot server directory

Post by eholz1 »

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: 386
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: Apache cannot server directory

Post by camerabob »

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>
Prod: Cacti 1.2.15 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Temp: Cacti 1.2.3 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Router Configs @ 1.3.4
Syslog Monitoring @ 2.1
Thold @ 1.2.4
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest