windows系统安装cacti

Installing Cacti on Windows
=================================
Installations

   1. Download and install the following pieces of software:
          * (optional) Apache and install it to c:apache or c:apache2.  Make sure to install it as a service.
          * Cacti and extract it to the root of your web server directory.  Typically c:inetpubwwwroot or c:apache2.
          * Cactid and extract it to c:cactid.
          * RRDTool and extract it to c:rrdtool.
          * PHP 4.3.6+ or 5.x and extract it to c:php.
          * MySQL 4.0 or MySQL 4.1.  5.0 is not supported under Cacti 0.8.6g.  Install it to c:mysql.
          * (optional) Cygwin. Download setup.exe and keep it around until later used in the document.
          * (optional) Net-SNMP and install to c:net-snmp.

Configure PHP

   1.

      If using PHP 4, move the files in c:phpdlls to c:php.
   2.

      Add the following to your Windows PATH environment variable c:php. The Windows path can be accessed via the Control Panel at: System | Advanced | Environment Variables | System Variables..
   3.

      Add the following two new environment variables to your system using the procedure above: PHPRC=c:php.
         1. If using PHP 4, create this variable:  MIBDIRS=c:phpmibs
         2. If using PHP 5, create this variable:  MIBDIRS=c:phpextrasmibs
   4.

      If using PHP 4.3.5 or less (not recommended), create the following directory c:tmp.
   5.

      Rename the file c:phpphp.ini.dist to php.ini, and make the following changes to it:

      If using PHP 4 uncomment the following lines:

extension_dir = c:phpextensions
extension=php_snmp.dll
extension=php_sockets.dll
   

      If using PHP 5 uncomment the following lines:

extension_dir = c:phpext
extension=php_mysql.dll
extension=php_snmp.dll
extension=php_sockets.dll
   

      If using PHP 4.3.5 or less include the following line. If using 4.3.6 or greater, you should remove this line if present.

session.save_path=c:tmp
   

   6.

      If you have had previous versions of PHP installed, you had likely moved the PHP system files to in the Windows directory structure. If so, you will have to remove those files. Please review your PHP installation documentation for instructions on removing those files.
   7. If you want to allow template importing, uncomment the following line:

file_uploads = On

   8. Give the user who will be running the scheduled task, modify rights to:

c:phpmibs.index

Configure the Webserver (Apache)

   1.

      Make sure you have stopped any IIS web servers before you proceed with Apache installation.
   2.

      If you are using Apache 1.3.x, installation of PHP 5 is not recommended. If using PHP 4, add the following lines to your httpd.conf file in the c:apacheconf directory:

LoadModule php4_module c:phpsapiphp4apache.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:apache2conf directory:

      If using PHP 4, then add the following lines:

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

      If using PHP 5, then add the following lines:

LoadModule php5_module c:phpphp5apache2.dll
AddType application/x-httpd-php .php
DirectoryIndex index.html index.htm index.php
   

Configure the Webserver (IIS)

   1.

      Start the Internet Information Services (IIS) Manager, right click on Default Web Site (in most cases) and select Properties.
   2.

      Under the Home Directory tab, select Configuration and click Add. Browse to the path of php4isapi.dll or php5isapi.dll, and type in .php as the extension.
      IIS6: Enable All Verbs and Script Engine.
   3.

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

      Under the Documents tab, add index.php to the top of the list.
   5. If using IIS6, go to Web Service Extensions and add a new Web Service Extension.  Name the extension "php", click Add and browse to the php4isapi.dll or php5isapi.dll file,  enable Set Extension status to Enable, and click OK.
   6. Under the Default Web Site, right click on Cacti and select Properties.
   7. Under the Directory tab, click the Write checkbox..
   8. Give the IUSR_XXXX and IIS_WPG users read & execute permissions to the file %windir%system32cmd.exe.  They will also need read permissions on <web root>/cacti/ and its subfolders.
   9. IIS6: Give the IIS_WPG user modify permissions to the folders /cacti/log and /cacti/rrd.
  10.

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

net stop iisadmin
net start w3svc
   

Install Cygwin (optional)

   1. Installing a single instance of Cygwin, and using it for all applications that require it is recommended so you do not have different versions of the Cygwin dlls laying around on your system, which can cause conflicts.
   2. Run setup.exe you previously downloaded.
   3. Once you reach the portion of setup entitled Select Packages, install the following:

Base (whole thing)
Libs
libart_lgpl
     libfreetype26
     libpng12
     zlib
Utils
patch
Web
wget

   4. Add c:cygwinbin to your system path.
   5. Move setup.exe to c:cygwin for future use.

Install RRDTool

   1. If you have Cygwin installed, remove the DLL files from the c:rrdtool directory.

Configure MySQL

   1.

      Start MySQL by running c:mysqlbinwinmysqladmin.exe.
   2.

      Set a password for the root user

shell> cd mysqlbin
shell> mysqladmin --user=root password somepassword
shell> mysqladmin --user=root --password reload
   

   3.

      Create the MySQL database:

shell> mysqladmin --user=root --password create cacti
   

   4.

      Import the default Cacti database:

shell> mysql --user=root --password cacti < c:apache2htdocscacticacti.sql
   

   5.

      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;

   6. If you're running MySQL 4.1 or newer with PHP 4.x, then you will need to apply the old password trick for user authentication to work with Cacti.

shell> SET PASSWORD FOR 'cacti'@'localhost' = OLD_PASSWORD('newpwd');
mysql> FLUSH PRIVILEGES;


      You will also need to modify your MySQL configuration file, typically my.ini in c:mysql.   Stop the MySQL service and add the following line:

--old-passwords

你可能感兴趣的:(C++,windows,PHP,mysql,C#)