howto change httpd.conf from Apache2 to show cacti ?

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

Moderators: Developers, Moderators

Post Reply
cc
Cacti User
Posts: 71
Joined: Fri Sep 27, 2002 3:09 am
Location: CH

howto change httpd.conf from Apache2 to show cacti ?

Post by cc »

hi

I've installed cacti via ports on freeBSD 5.2.1
and cacti is generally working.

But I have a big problem with the webserver Apache2:
# apachectl -v
Server version: Apache/2.0.52
Server built: Oct 15 2004 11:25:29

it works only if I try in the browser:

http://localhost/cacti/
or
http://localhost/cacti/index.php

and

http://localhost/cacti

doesn't work and I get following error:

" Not Found
The requested URL /cacti was not found on this server.
Apache/2.0.52 (FreeBSD) PHP/4.3.9 Server at 127.0.0.1 Port 80 "

cacti is installed at:

/usr/local/share/cacti

and I've added to to Apache's httpd.conf the following:

Code: Select all


Alias /cacti/ "/usr/local/share/cacti/"

<Directory "/usr/local/share/cacti">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
<IfModule mod_php4.c>
    AddType application/x-httpd-php .php
    php_flag magic_quotes_gpc Off
    php_flag short_open_tag On
    php_flag register_globals On
    php_flag register_argc_argv On
    php_flag track_vars On
    php_value include_path .
    DirectoryIndex index.php
</IfModule>
</Directory>
knows someone what's wrong and how can I fix this problem ?
Hip
Posts: 18
Joined: Wed Sep 01, 2004 5:21 am
Location: Switzerland

Re: howto change httpd.conf from Apache2 to show cacti ?

Post by Hip »

Hi,
cc wrote:

Code: Select all

Alias /cacti/ "/usr/local/share/cacti/"
knows someone what's wrong and how can I fix this problem ?
Try to change the Alias line and remove the trailing slashes:

Code: Select all

Alias /cacti /usr/local/share/cacti
This may solve your problem, as trailing slashes in Alias directives don't work when the requested URL doesn't contain a trailing slash ...

Hip
Guest

Post by Guest »

hi

I've tried and changed to:

Code: Select all

Alias /cacti /usr/local/share/cacti 
but still it doesn't help !

after apache restart I get:

Code: Select all

Not Found
The requested URL /cacti was not found on this server.
Apache/2.0.52 (FreeBSD) PHP/4.3.9 Server at 10.41.1.50 Port 80
Hip
Posts: 18
Joined: Wed Sep 01, 2004 5:21 am
Location: Switzerland

Post by Hip »

Hi,

Mmmh ... Let's try something else ...

The Apache module that normally redirects requests when the trailing slash is missing is called mod_dir. Are you sure it is correctly loaded into Apache ? Do you see in your configuration an uncommented line loading this mod_dir ? Also ensure that there's no "DirectorySlash Off" directive (it disables trailing slash redirection).

Hip
Guest

Post by Guest »

Code: Select all

LoadModule dir_module libexec/apache2/mod_dir.so

is in httpd.conf active (enabled).

and what you mean with "DirectorySlash Off" exactly ?
Hip
Posts: 18
Joined: Wed Sep 01, 2004 5:21 am
Location: Switzerland

Post by Hip »

Okey, one last check about this mod_dir module ... What is the output of the PHP function phpinfo( ) ? In the apache2handler section, you should see mod_dir in the list of "Loaded Modules". Do you see it ?

The "DirectorySlash" directive is used to enable / disable trailing slash redirection. In case it is set to Off, Apache won't redirect you if you request /cacti instead of /cacti/ ...

Mmmh very strange, sorry but I don't have any further idea on how to resolve this problem :/
cc
Cacti User
Posts: 71
Joined: Fri Sep 27, 2002 3:09 am
Location: CH

Post by cc »

Hip wrote:Okey, one last check about this mod_dir module ... What is the output of the PHP function phpinfo( ) ? In the apache2handler section, you should see mod_dir in the list of "Loaded Modules". Do you see it ?
howto check PHP function phpinfo( ) ?

greetings
cc
Hip
Posts: 18
Joined: Wed Sep 01, 2004 5:21 am
Location: Switzerland

Post by Hip »

Hi,

Just create a PHP script with the following content :

Code: Select all

<?php
phpinfo( );
?>
Point your browser to the script you just created and have a look at the apache2handler section ...

Hip
cc
Cacti User
Posts: 71
Joined: Fri Sep 27, 2002 3:09 am
Location: CH

Post by cc »

hi

mod_dir should be installed.

Code: Select all

Loaded Modules:

core prefork http_core mod_so mod_access mod_auth mod_auth_anon mod_auth_dbm mod_charset_lite mod_include mod_deflate mod_log_config mod_logio mod_env mod_mime_magic mod_cern_meta mod_expires mod_headers mod_usertrack mod_unique_id mod_setenvif mod_mime mod_status mod_autoindex mod_asis mod_info mod_cgi mod_vhost_alias mod_negotiation mod_dir mod_imap mod_actions mod_speling mod_userdir mod_alias mod_rewrite sapi_apache2
cc
Cacti User
Posts: 71
Joined: Fri Sep 27, 2002 3:09 am
Location: CH

Post by cc »

with

Code: Select all

Alias /cacti/ "/usr/local/share/cacti/"

<Directory "/usr/local/share/cacti/">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory> 
it seems to work !
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests