Chapter 3. Installing Under Windows

Install PHP

  1. Extract PHP to c:\ and rename the new directory to 'php'.

  2. Copy the files in c:\php\dlls to c:\winnt\system32.

  3. Copy the file c:\php\php4ts.dll to c:\winnt\system32.

  4. Move all MIB files from c:\php\mibs to c:\usr\mibs.

  5. Create the directory c:\tmp.

  6. In the c:\php directory, rename the php.ini-dist file to php.ini, copy it to c:\winnt, and make the following changes to the file:

    extension_dir = c:/php/extensions
    extension=php_snmp.dll
    session.save_path=c:\tmp
    

Configure the Webserver (Apache)

  1. Install the Apache web server. This is as simple as double clicking the .msi file and following the prompts. Make sure to install it as a service and for the sake of the HOWTO, install it to c:\apache or c:\apache2.

  2. If you are using Apache 1.3.x, add the following lines to your httpd.conf file in the c:\apache\conf directory:

    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
    
  3. If you are using Apache 2.x, add the following lines to your httpd.conf file in the c:\apache2\conf directory:

    LoadModule php4_module c:\php\sapi\php4apache2.dll
    AddType application/x-httpd-php .php
    DirectoryIndex index.html index.htm index.php
    

Configure the Webserver (IIS)

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

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

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

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

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

    net stop iisadmin
    net start w3svc
    

Install MySQL

  1. Extract the MySQL zip file to a temp directory and run setup.exe.

  2. Install MySQL to the c:\mysql directory.

  3. Start MySQL by running c:\mysql\bin\winmysqladmin.exe.

  4. Set a password for the root user

    shell> cd mysql\bin
    shell> mysqladmin ?-user=root password somepassword
    shell> mysqladmin --user=root --password reload
    
  5. Create the MySQL database:

    shell> mysqladmin --user=root --password create cacti
    
  6. Import the default Cacti database:

    shell> mysql --user=root --password cacti < c:\apache2\htdocs\cacti\cacti.sql
    
  7. Optional: Create a MySQL username and password for Cacti.

    shell> mysql --user=root --password mysql
    mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';
    mysql> flush privileges;
    

Install Cacti

  1. Extract the distribution archive. 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. Edit include/config.php and specify the MySQL user, password and database for your Cacti configuration.

    $database_default = "cacti";
    $database_hostname = "localhost";
    $database_username = "cactiuser";
    $database_password = "cacti";
    
  4. 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's 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:\apache2\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.

  5. 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 immediately. 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