General win32 Installation Step that works ...

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

4K.Darsch

General win32 Installation Step that works ...

Post by 4K.Darsch »

I was interested by cacti recently and I had many problems to install it under Windows. I finally succeeded by cumulating several post interesting which while being complementary allow a good procedure of installation that I will subject to you. That makes it possible to install cacti without service IIS and the procedure bases itself mainly on that of Khutton which did a very good work but of which it misses some specifications that I discovered in others post. I thus hope to be able to post a procedure of complete installation which will allow all beginner to install it correctly first blow without IIS. Do not hesitate to add lapses of memory of my share. Thank you.

Afflicted for my English of bad quality, I am French and continuous to learn :D

Installation instructions for Win32 platform : ( i succeeded for win XP PRO )

U requires to download :

• RRDTOOL : rrdtool-1.0.40.x86distr.zip-5.8.zip Link : (http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/ )

• PHP : php-4.3.4-Win32

• MYSQL : mysql-4.0.18-win

• Apache : apache_2.0.49-win32-x86-no_ssl

• Perl : ActivePerl-5.8.3.809-MSWin32-x86

• Cacti : cacti 0.8.5-win32

For all these installations, u can specify another folder than c:\ like c:\Project\ etc .. or c:\xxx\...
The following installation instruction is based on c:\ but u could see my .ini files that the directory is c:\Onduleur\ etc so don’t forget to check all ur directory commands.

=============================================================================

-Installing Apache

Make sure you have stopped any IIS web servers before you proceed.

Double click the .msi file to start the install.

Install it as a service.

Use the typical setup. (U can install it where u want )

Install Apache to the c:\ directory. ( yes the root of c, it automatically installs to c:\apache2 or u can install to another directory like c:\xxx\apache2 )

Create the c:\apache2\htdocs\cacti directory.

Please restart your machine after the install to make sure the service was installed correctly. When Apache monitor starts it should have the green light on the service status.

=============================================================================

-Installing PHP

Extract PHP to c:\ or same folder than ur apache2 ( c:\xxx\ )

Rename the installed directory to c:\php, it will be something like php-4.3.4 but rename it.

Copy php4ts.dll from the c:\php directory to the c:\Windows\system32 directory.

In the c:\php directory, rename php.ini-dist to php.ini and make the following edits (I have included my working php.ini at the bottom and check the directory if u didn’t installed on the c:\ root. As u can see in my php.ini mine is C:\Onduleur\ where there are apache2,php etc )
dont forget to remove the « ; « before extension=php_snmp.dll that u add

extension_dir=c:\php\extensions
extension=php_snmp.dll (just remove the ; from the beginning of the line)
include_path=c:\apache2\htdocs\cacti
register_globals=On
register_argc_argv=On
max_execution_time=200

Mine is like that :
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
include_path = " C:\Onduleur\Apache2\htdocs\cacti "
register_globals=On
register_argc_argv=On
max_execution_time=200


; The root of the PHP pages, used only if nonempty.
Etc …

In the c:\apache2\conf directory, make the following edits to httpd.conf:

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

Mine is like that :
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule php4_module c:/Onduleur/php/sapi/php4apache2.dll
AddType application/x-httpd-php .php
DirectoryIndex index.html index.htm index.php

LoadModule access_module modules/mod_access.so
Etc …


=============================================================================

-Install ActiveState Perl

The Active Perl website has very good and detailed instructions on how to install. With XP Pro.

you should not have to install any of the additional tools.

Download the Active Perl .MSI install file.

Install Perl to the c:\perl directory.

Make sure the XP default path now contains a c:\perl\bin statement.
I have installed perl in c:\perl too.

=============================================================================

Install cacti

Unzip the cacti tar.gz file to c:\apache2\htdocs directory

Rename the standard cacti directory, something like cacti-0.6.8, to cacti

Everything should be in c:\apache2\htdocs\cacti

=============================================================================

-Install rrdtool

Unzip rrdtool to c:\rrdtool and copy c:\rrdtool\src\tool_release\rrdtool.exe to c:\rrdtool

u can install it to another directory too.

=============================================================================

-Install MySQL

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

Install MySQL to the c:\mysql directory. Or another u want.

Run c:\mysql\bin\winmysqladmin.exe or ur c:\xxx\mysql\bin\winmysqladmin.exe

When entering a username and password make sure the user has read and write access to the

following directories :
c:\apache2\htdocs\cacti\rra
c:\apache2\htdocs\cacti\log

and execute, read and write access to the following directories

c:\php
c:\php\sapi

Reboot your machine.

If winmysqladmin.exe does not run automatically when you restart, run

c:\mysql\bin\winmysqladmin.exe

Once this starts, it may put itself in the task bar as a stoplight, open it up.

Select the databases tab.

Right mouse click on your machine ip/name.

select create database.

Name the database cacti.

Now edit ur cacti.sql in ur cacti directory and remove « =============== « at the beginning. It should be like that :
-- MySQL dump 9.09
--
-- Host: localhost Database: dev_cacti_2
--
-- Server version 4.0.15-standard

--
-- Table structure for table `cdef`
--

CREATE TABLE cdef ( etc … or just erase all before CREATE TABLE … )
Import the default cacti database by:
From the c:\MySQL\bin directory, execute the following command:

mysql cacti < c:\apache2\htdocs\cacti\cacti.sql

In the c:\apache2\htdocs\cacti\include directory, make the following edits to config.php

$database_default = "cacti";
$database_hostname = "localhost";
$database_server_os = "win32";

The following entries should match what is in your my.ini file (username and password you set

when you installed MySQL). To view your my.ini file you can open winmysqladmin.exe and click on

tht my.ini tab or look at the my.ini file in c:\windows.
$database_username = "cactiuser";
$database_password = "cacti";

Move all MIB files from c:\php\mibs to c:\usr\mibs or ur c:\xxx\usr\mibs.

Create a folder tmp in ur c:\xxx or c:\temp directory. It depends where u installed all programs.

Reboot your machine

=============================================================================

Reboot your machine

=============================================================================

Creating the scheduled task to run every five minutes:

Select Start--> Settings--> Control Panel

Double click on Scheduled Tasks.

Double click on Add Scheduled Task.

Hit next.

Hit browse.

Go to c:\php and select php.exe.

Select daily and hit next.

Hit next again without changing the time or settings.

When entering a username and password make sure the user has read and write access to the

following directories:

c:\apache2\htdocs\cacti\rra
c:\apache2\htdocs\cacti\log

read, write and execute access to the following directories

c:\php
c:\php\sapi

Hit next.

Hit finish.

Now Right mouse click on the task you just created, and select properties.

Select the Schedule tab.

Make sure Daily is selected and hit the advanced button.

Check the Repeat task box, set it for 5 minutes and set the duration for 24 hours.

Hit Ok.

In the Run box enter text to make the statement say this:

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

The start in box should say c:\apache\htdocs\cacti

I have noticed this quirk. Ever time you edit the task you must re-enter the password for the

account you are using.

Hit Ok

==============================================================================

Go to the : http://www.raxnet.net/downloads/cacti/p ... e-patched/
And download all .php and replaces olds.


You must now access the site by going to http://your-server-ip/cacti and follow the simple setup steps.
If i add a snmp device like i did...to be sure it works...when ur snmp device is found. Its written in black in Devices like :

SNMP Information
System: MGE UPS SNMP FIJI Board, V4.07
Uptime: 54435564
Hostname:


I hope this could help everybody that begin with cacti.
If u have any problems..advice me.
thks
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

I saw some pretty good stuff in here, so I thought it would be nice to contribute some of this back to the official Windows install document. I went through it tonight and added/removed a few items throughout the entire document. Overall I would say this really helped clear up a few points that I often hear from users. You may also notice that I basically rewrote the section on the scheduled task to match your style here.

Thanks for the awesome contribution!

-Ian
docc

Post by docc »

salut 4K.Darsch
Moi ce ne marche pas ! si tu peux m'aider
http://www.raxnet.net/board/viewtopic.php?t=4091
thx
DJ Prem
Posts: 16
Joined: Sun May 02, 2004 6:33 pm
Contact:

Post by DJ Prem »

I don't see an option to create a new database? How did you do that?
Attachments
1.JPG
1.JPG (71.28 KiB) Viewed 10722 times
DJ Prem
Posts: 16
Joined: Sun May 02, 2004 6:33 pm
Contact:

Re: General win32 Installation Step that works ...

Post by DJ Prem »

Now edit ur cacti.sql in ur cacti directory and remove « =============== « at the beginning. It should be like that :
-- MySQL dump 9.09
--
-- Host: localhost Database: dev_cacti_2
--
-- Server version 4.0.15-standard

--
-- Table structure for table `cdef`
--

CREATE TABLE cdef ( etc … or just erase all before CREATE TABLE … )
What are we suppose to remove, is it « =============== « cos I dont have that in the Cact.sql I have attached my Cacti.sql for you to check out
Attachments
cacti.txt
(165.42 KiB) Downloaded 289 times
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

I updated my distribution script in 0.8.5a to automatically remove these lines from the cacti.sql file. This step can probably be removed from the howto.

-Ian
bdc

What is the purpose of the c:\usr\MIBS & c:\tmp director

Post by bdc »

What is the purpose of the c:\usr\MIBS and c:\tmp directories? I know that the MIBS are required for snmp to work correctly but how does it all work? Does Cacti reference this directory or does PHP?

Thanks in Advance
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

PHP uses this directory, not Cacti. The MIB files are only used to translate names like:

Code: Select all

sysDescr.0
Into:

Code: Select all

.1.3.6.1.2.1.1.1.0
Typically I recommend that all users use the numeric equivlant where ever possible to eliminate potential problems with this translation. This step is mainly included in the Cacti installation for Windows to shut php.exe up when it's run ;-).

-Ian
andespoint
Posts: 6
Joined: Thu Aug 05, 2004 12:38 pm

Post by andespoint »

DJ Prem wrote:I don't see an option to create a new database? How did you do that?
I have the same issue, I don't see the create database option anyone have any solutions . . .Thanks
andespoint
Posts: 6
Joined: Thu Aug 05, 2004 12:38 pm

Post by andespoint »

I followed your directions and got the following error . . .

Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in C:\Apache2\htdocs\cacti\lib\adodb\drivers\adodb-mysql.inc.php on line 318

Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'.

any thoughts?

Thanks :D
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

andespoint wrote:
DJ Prem wrote:I don't see an option to create a new database? How did you do that?
I have the same issue, I don't see the create database option anyone have any solutions . . .Thanks
My WinMySQLadmin doesn't have a "create database" option either. This step is pretty easy to do from the command line using mysqladmin. Open up a new command prompt and type:

Code: Select all

mysqladmin -u root -p create cacti
You will be prompted for your MySQL root password and the database will be created afterward. If you get a "file not found" or similar error after typing this error, you may need to locate the 'mysqladmin' binary and specify the complete path to it.

-Ian
npersad

Problems with Windows install

Post by npersad »

Hello,
I tried this install guide with on Windows 2000, mysql 4.0.18 (in my sql used my Windows logon name and password and have installed the MySQL OBDC driver) and Apache2 web server and received the following error when i try to access the website. in my sql used my Windows logon name and password and have installed the MySQL OBDC driver

Warning: session_start(): open(/tmp\sess_b4d956d6f1c6f4d94ff19323f321cf53, O_RDWR) failed: No such file or directory (2) in C:\Apache\Apache2\htdocs\cacti\include\config.php on line 75

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at C:\Apache\Apache2\htdocs\cacti\include\config.php:75) in C:\Apache\Apache2\htdocs\cacti\include\config.php on line 75

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at C:\Apache\Apache2\htdocs\cacti\include\config.php:75) in C:\Apache\Apache2\htdocs\cacti\include\config.php on line 75

Warning: mysql_connect(): Access denied for user: 'npersad@10.19.1.110' (Using password: YES) in C:\Apache\Apache2\htdocs\cacti\lib\adodb\drivers\adodb-mysql.inc.php on line 318

Cannot connect to MySQL server on 'houcactitest.eogresources.com'. Please make sure you have specified a valid MySQL database name in 'include/config.php'.
Warning: Unknown(): open(/tmp\sess_b4d956d6f1c6f4d94ff19323f321cf53, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

As indicated in step 6 of the offcial Windows install doc, you need to specify a valid session save path.

-Ian
npersad
Posts: 2
Joined: Mon Aug 30, 2004 1:49 pm

MYSQL access

Post by npersad »

Thank RaX, I got past that point now and I am receiving this error below
even though I have cactiuser as an Administrator on this system and full privileges on all the required directories and cactiuser is setup as the only user with all rights on the mysql server. Do I need to have root there also?


Warning: mysql_connect(): Access denied for user: 'cactiuser@localhost' (Using password: YES) in C:\Apache\Apache2\htdocs\cacti\lib\adodb\drivers\adodb-mysql.inc.php on line 318

Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'
When will tomorrow end?
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

You certainly don't need to use the MySQL 'root' user, but that is one possible solution. For some reason the 'cactiuser' user does not appear to have sufficient rights to Cacti's database on your system. You should make sure 'cactiuser' has the following or greater permissions on Cacti's database:

SELECT,UPDATE,DELETE,ALTER,CREATE,INDEX,DROP

-Ian
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest