Cacti (home)ForumsDocumentation

Differences

This shows you the differences between two versions of the page.

manual:100:1_installation.1_install_unix.2_configure_apache [2011/06/13 11:08] (current)
Line 1: Line 1:
 +==== Configure the Webserver (Apache) ====
  
 +If you are using **Apache 1.3.x**, installation of PHP 5 is not recommended.
 +
 +Please find the file "/etc/httpd/conf/httpd.conf" or equivalent and make sure it includes:
 +
 +<code>
 +  # Load config files from the config directory "/etc/httpd/conf.d".
 +  Include conf.d/*.conf
 +</code>
 +
 +Now, please locate the PHP configuration file at "/etc/httpd/conf.d/php.conf"
 +
 +If using PHP 5, then make sure to have the following lines.
 +
 +<code>
 +  # PHP is an HTML-embedded scripting language which attempts to make it
 +  # easy for developers to write dynamically generated webpages.
 +  LoadModule php5_module modules/libphp5.so
 +  #
 +  # Cause the PHP interpreter to handle files with a .php extension.
 +  AddHandler php5-script .php
 +  AddType text/html .php
 +  #
 +  # Add index.php to the list of files that will be served as directory
 +  # indexes.
 +  DirectoryIndex index.php
 +</code>
 +
 +In case you do not install Cacti to the default web directory, put the following as cacti.conf into /etc/httpd/conf.d. Change **/your/cacti/dir** to your cacti directory name. Change the **Allow from 127.0.0.1** directive to whatever you need (e.g. the subnets in your company).
 +Follow the hints given in the comments, especially when using SELinux!
 +
 +<code>
 +# Cacti - the complete rrdtool-based graphing solution
 +
 +# Allows only localhost by default
 +#
 +# Allowing cacti to anyone other than localhost should be considered
 +# dangerous unless properly secured by SSL
 +
 +# Make sure, that httpd can read your cacti directories.
 +# At minimum, you need
 +#    chmod ugo+r -R /your/cacti/dir
 +# Make sure to replace with your directories
 +
 +# When using SELinux, set the following:
 +#    chcon -R -h -t httpd_sys_content_t /your/cacti/dir
 +# when using SELinux and you private homedir, enable
 +#    setsebool -P httpd_enable_homedirs 1
 +#    setsebool -P httpd_read_user_content 1
 +
 +Alias /cacti /your/cacti/dir
 +<Directory /your/cacti/dir>
 +   AllowOverride None
 +   Order Deny,Allow
 +   Deny from all
 +   Allow from 127.0.0.1
 +   Allow from ::1
 +   Options Indexes Includes FollowSymLinks
 +</Directory>
 +
 +# These directories do not require access over HTTP 
 +#
 +<Directory /your/cacti/dir/cli>
 +    Order Deny,Allow
 +    Deny from All
 +    Allow from None
 +</Directory>
 +</code>
 +
 +Make sure that the //httpd// web service is started as given by [[1_installation.1_install_unix.5a_start_system_services|Start System Services for Cacti]].





Personal Tools