Cacti Installation (Windows)

Dependencies

Cacti requires:

Install PHP (With Apache)

  1. Install the Apache web server. (I installed it in C:\Apache)

  2. Extract PHP somewhere and rename the folder to "PHP". (I installed it in C:\PHP)

  3. Move the php4ts.dll file to your system directory (winnt/system32).

  4. Rename the php.ini-dist file to php.ini, copy it to your winnt/ directory and make the following changes to the file:

    extension_dir = c:/php/extensions
    extension=php_snmp.dll
    include_path=c:/apache/htdocs/cacti
    register_globals = On
    register_argc_argv = On
    max_execution_time = 200

    Make sure to replace c:/apache/htdocs/cacti with your full path to cacti.

  5. Add the following lines to Apache's httpd.conf file:

    LoadModule php4_module c:/php/sapi/php4apache.dll
    AddModule mod_php4.c
    AddType application/x-httpd-php .php
    DirectoryIndex index.html index.htm index.php

    Make sure to replace c:/php/sapi/php4apache.dll with your full path to the php4apache.dll file.

Install PHP (With IIS)

  1. Extract PHP somewhere and rename the folder to "PHP". (I installed it in C:\PHP)

  2. Rename the php.ini-dist file to php.ini, copy it to your winnt/ directory and make the following changes to the file:

    extension_dir = c:/php/extensions
    extension=php_snmp.dll
    include_path=c:/inetpub/wwwroot/cacti
    register_globals = On
    register_argc_argv = On
    max_execution_time = 200

    Make sure to replace c:/inetpub/wwwroot/cacti with your full path to cacti.

  3. Start the Microsoft Management Console, right click on Default Web Server (in most cases) and select Properties.

  4. Under the Home Directory tab, select Configuration and click Add. Browse to the path of php4isapi.dll, and type in .php as the extension.

  5. Under the ISAPI Filters tab, click add and browse to the php4isapi.dll file. Name the filter "php" and click OK.

  6. Under the Documents tab, add index.php to the list.

  7. Completely stop and start the IIS service using the following commands:

    net stop iisadmin
    net start w3svc

Installation Instructions

  1. Extract the distribution archive. You can use a program like WinZip to open .tar.gz files. These instructions will assume that the archive has been extracted to C:\Apache\htdocs\cacti, although you can use a different path if you wish. Make sure you extract with "Use folder names" enabled, so that the necessary sub-folders will be used.

  2. Unzip rrdtool and copy rrdtool.exe from the src/tool_release directory to somewhere such as C:\rrdtool

  3. Install MySQL (I installed it in C:\mysql) and start the MySQL service.

  4. Create the MySQL database:

    C:\> cd Apache\htdocs\cacti
    C:\Apache\htdocs\cacti> mysqladmin create cacti


    Note These examples assume that the MySQL executables directory (commonly C:\mysql\Bin) is in your %PATH%.

  5. Import the default cacti database:

    C:\Apache\htdocs\cacti> mysql cacti < cacti.sql


  6. Optional: Create a MySQL username and password for cacti.

    C:\Apache\htdocs\cacti> mysql --user=root mysql
    mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';
    mysql> flush privileges;


  7. Edit include/config.php.

  8. If you are using NTFS security, make sure the I_USR_ user has write access to both the log/ and rra/ sub-directories. Also, please insure that the I_ USR_<hostname> user has execute permissions to the C:\PHP and C:\PHP\SAPI directories. If you do not do this, the ISAPI process will fail.

  9. You are going to need to schedule a task, so cmd.php can run every 5 minutes. Make sure the Task Scheduler service is started and open up the Scheduled Tasks control panel item. Add a new task, browse to your php.exe file and click Next. Have the task run daily (for now) and click Next twice until you are at the username/password screen. You must enter a user that has read/write permissions to cacti rra/ and log/ directories here. Click Next, check the box to open Advanced Properties and click Finish.

    You are going to have to enter the full command line in the Run textbox. Using default paths, your command line should look something like:

    c:\php\php.exe c:\apache\htdocs\cacti\cmd.php

    Select the Schedule tab and click Advanced. Check the Repeat task checkbox and change it to every 5 minutes, then change the Duration to 24 hours. That should schedule cmd.php to run every 5 minutes. Note: If you do not want the annoying DOS boxes showing up on your screen, schedule the event using an NT service ID such as "cacti_service". Doing this will remove those messages from your screen during the execution of the scheduled event.

  10. Point your web browser to:

    http://your-server/cacti/

    Log in the with a username/password of admin. You will be required to change this password immediatly. Using the default paths described in this document, your paths should look something like:

    PHP Binary Path:

    c:/php/php.exe

    rrdtool Binary Path:

    c:/rrdtool/rrdtool.exe

    cacti Web Root:

    /cacti

    Web Server Document Root:

    (Apache Default)

    c:/apache/htdocs

    (IIS Default)

    c:/inetpub/wwwroot