4 Mayıs 2012 Cuma

Windows üzerine manuel cacti kurulumu


Windows üzerine cacti kurulumu

Kurulum için lazım olan dosyalar

·         Cacti = http://www.cacti.net/download_cacti.php adresinden son versiyon cactiyi indirelim(kurulumda kullandığım versiyon cacti-0.8.7g.zip )
·         RRDTool = http://www.cacti.net/downloads/rrdtool/win32/ adresinden son versiyonu indirelim (kurulumda kullandığım versiyon rrdtool-1.2.15-cygwin-1.5.20.zip)
·         PHP = http://www.php.net/downloads.php  adresinden son versiyonu indirelim (kurulumda kullandığım versiyon php-5.2.17-nts-Win32-VC6-x86.msi)
·         MySQL = http://dev.mysql.com/downloads/mysql/ adresinden son versiyonu indirelim ama ben özellikle 64 bit kullandım siz bilirsiniz. (kurulumda kullandığım versiyon mysql-5.6.2-m5-winx64.msi)
·         NetSNMP = http://net-snmp.sourceforge.net/download.html  adresinden son versiyonu indirelim ama ben özellikle 64 bit kullandım siz bilirsiniz. (kurulumda kullandığım versiyon net-snmp-5.5.0-2.x64.exe)

Kurulacak olan Sistem Hakkında Bilgi

Bu makalede cactiyi Windows Server 2008 R2 64 üzerine kurmaya çalışacağız.Biliyorsunuz cacti Php destekli site üzerinden yayın yapan bir program.Bunu göz önüne alarak web server olarak ben IIS 7 tercih ettim.Ve IIS 7 yi php yerine asp desteklediÄŸi için IIS7 yi Php yide  destekler hala getirmemiz gerekiyor.

İndirilen Dosyaların Temel Kurulumları

·         IIS
 
·       
 Php
Ä°ndirdiÄŸimiz dosyayı “C:\PHP\” klasörüne kuralım.
Not1:Kesinlikle “C:\Program Files\PHP” yoluna kurmayalım.
Not2: PHP 5.2.10 versiyonundan sonra ISAPI yerine FastCGI kullanılır oldu.Bu yüzden bizde IIS 7 hazırlama aşamasında FastCGI modullu kurduk.
Kurulum aşamaları:
1.       Next diyoruz
2.       “Iagree” diyerek lisansı kabul ediyoruz.
3.       Kurulum Yolunu Note1 de dediÄŸim gibi deÄŸiÅŸtirmeliyiz.change the path to: C:\PHP yapıyoruz. 
Sonra Next
4.       PHP 5.2.10 veya üst sürümler için : select IIS FastCGI and click Next.
5.       Bu kısmı Türkçe yazmaya gerek duymuyorum.Kurulum penceremiz zaten Ä°ngilizce.
·         Click on the Program folder and select entire feature will be installed on local hard drive. The icon should now be white
·         Click on the Script Executable folder and select entire feature will be installed on local hard drive. The icon should now be White
·         Under the Extensions folder, select MySQL, SNMP, and Sockets to be installed. If you want to use LDAP authentication in Cacti, also enable the LDAP extension
·         Next
6.       Ä°nstall diyoruz
7.       Finish diyerek kurulum tamamlanıyor
8.       “C:\PHP\” klasörünün altına Uploadtem, Session Ve MIBS , Extras klasörleri oluÅŸturalım.
9.       “C:\usr\mibs” klasörünü  “C:\PHP\Extras\mibs” klasörüne taşıyalım.



·         Cacti
Ä°ndiriÄŸimiz dosyayı C:\Inetpub\wwwroot\cacti\ adresine çıkartalım. Klasörün adı “ cacti” olsun kesinlikle. ilerde siteden cacti olarak çağıracağız. C:\Inetpub\wwwroot\ yoluna koymamızın sebebi IIS kullandığımız için

·         MySQL
Ä°ndirdiÄŸimiz dosyayı “C:\MySQL\” klasörüne kuralım.
Not1:Kesinlikle “C:\Program Files\MySQL” yoluna kurmayalım.
1.       mysql-5.6.2-m5-winx64.msi isimli dosyayı çalıştıtalım.
2.       Welcome ekranı ; Next
3.       Setup Type ekranında Custom seçelim.
4.       Change diyerek kurulum yolunu “C:\MySQL\” yapalım
5.       Next
6.       Ä°nstall
7.       Configure MySQL server now seçeneÄŸini iÅŸaretleyelim.ve Finish
8.       Next
9.       Detailed Confiiguration seçelim ve Next
10.   Server Machine seçelim ve Next
11.   Non- Transaction Database Only seçelim ve next
12.   Decision Support OLAP seçelim ve next
13.    Enabled TCP/IP networking  seçelim port numarası aynı kalsın ama Enable Strict Mode iÅŸaretlenmesin.Burası önemli….Next
14.   Standard Character Set seçelim ve next
15.   Install as Windows Service and Include Bin Directory in Windows PATH. seçelim ve next
16.    Root ÅŸifremizi oluÅŸturalım.sonra next
17.   Execute diyerek ilerleyelim
18.   Finish diyerek bitirelim

·         RRDTool
Ä°ndiriÄŸimiz dosyayı C:\ RRDTool\ adresine çıkartalım. Klasörün adı “RRDTool” olsun kesinlikle.

·         Net-SNMP
Ä°ndirdiÄŸimiz dosyayı “C:\Net-SNMP\” klasörüne kuralım.
1.       Welcome Ekranı, Next
2.       Lisansı kabul edelim, Next
3.       Ekrana gelen companentleri ÅŸu ÅŸekilde yapalım.
                                                                          i.      Check Base Components.
                                                                        ii.      Under Net-SNMP Agent Service, check With Windows Extension DLL support.
                                                                      iii.      Uncheck Net-SNMP trap service
                                                                      iv.      Uncheck Perl SNMP modules
                                                                        v.      Uncheck Development files
                                                                      vi.       
4.       Sonra Next
5.       C:\Net-SNMP\” klasörüne yol olarak gösterip next
6.       Ä°nstall
7.       Finish

Kurulan Dosyaların Ayarlarının Yapılması

·         Php
a)      “C:\php” kurulum sırasında Windows sistem deÄŸiÅŸkenlerine eklenmesi gerekiyor.Biz kontrolumuzu yapalım.
1.       Control Panel\All Control Panel Items\System ---Advanced system setting kısmında advanced sekmesinde environment variable kısmını açalım
2.       System  variables kısmında “path” variable bulup içinde “C:\php” olup olmadığını kontrol edelim.yoksa ekleyelim.
b)      system variable içine PHPRC. Yolu  C:\PHP\” olsun
c)       system variable içine MIBDIRS oluÅŸturalım.  Yolu “C:\PHP\Extras\mibs” olsun
d)       C:\PHP\php.ini dosyasını notepad ile açıp aÅŸağıdaki toplaya göre düzelmemiz lazım. Başında “;” varsa silelim.
fastcgi.impersonate = 1
register_argc_argv = On
safe_mode = Off
cgi.fix_pathinfo = 1
cgi.force_redirect = 0
upload_tmp_dir = "C:\PHP\Uploadtemp"
session.save_path="C:\PHP\Session"

max_execution_time = 60 ; Maximum execution time of each script, in seconds
max_input_time = 120; Maximum amount of time each script may spend parsing request data
memory_limit = 128M ; Maximum amount of memory a script may consume (8MB)

e)      C:\PHP\Uploadtemp
C:\PHP\Session
Klasörlerini güvenlik ayarlarını düzenlememiz lazım. NTFS permissions ayarlarına Modify rights to the IUSR_ and IIS_USRS



C:\PHP>php –info  komut satırına bu ÅŸekilde girdiÄŸimizde bilgiler geliyorsa sorunsuz php kurulmuÅŸ oluyor.
IIS üzerinde ayar
Configure IIS 7 to handle PHP requests by using IIS Manager
1.     Open IIS Manager. At the server level, double-click Handler Mappings.
IIS Manager açıyoruz. Handler Mappings bulup tıklıyoruz
   

 2. In the Actions pane, click Add Module Mapping.... In the Add Module Mapping dialog box, specify the configuration settings as follows:
·  Request path: *.php
·  Module: FastCgiModule
·  Executable: "C:\[Path to your PHP installation]\php-cgi.exe"
·  Name: PHP via FastCGI
3. Click OK.
   
4. In the Add Module Mapping confirmation dialog box that asks if you want to create a FastCGI application for this executable, click Yes.
5. Test that the handler mapping works correctly by creating a phpinfo.php file in the C:\inetpub\wwwroot folder that contains the following code:
<?php phpinfo(); ?>
6. Open a browser and navigate to http://localhost/phpinfo.php. If everything was setup correctly, you will see the standard PHP information page.
  1. Under the Default Web Site, right click on Cacti folder and select Properties.
    1. Click on the Documents tab
    2. Click on Add....
    3. In the Default Document Name field, type in: index.php and click OK.


Give the COMPUTERNAME\IUSR_ and COMPUTERNAME\IIS_WPG users Read & Execute permissions to the file C:\Windows\system32\cmd.exe
  1. Both IUSR_ and IIS_WPG users will also need read permissions on C:\Inetpub\wwwroot\cacti\ and its subfolders.
    1. Right click on the folder C:\Inetpub\wwwroot\cacti and select Properties.
Give the IUSR_ and IIS_WPG users modify permissions to the folders C:\Inetpub\wwwroot\cacti\log and C:\Inetpub\wwwroot\cacti\rra
  1. Verify PHP is functional by running: php -m at the command prompt.

    Note: If messages with, Cannot find module appearing, then there is something wrong with the MIBDIRS variable or missing mib files in the PHP\Extras\mib folder.  Make sure the MySQL, SNMP and Sockets PHP modules are in the list.
2.  c:\> php -m
3.  [PHP Modules]
4.  bcmath
5.  calendar
6.  com_dotnet
7.  ctype
8.  date
9.  dom
10.filter
11.ftp
12.hash
13.iconv
14.json
15.libxml
16.mssql
17.mysql
18.odbc
19.pcre
20.Reflection
21.session
22.SimpleXML
23.snmp
24.sockets
25.SPL
26.standard
27.tokenizer
28.wddx
29.xml
30.xmlreader
31.xmlwriter
32.zlib
33. 
[Zend Modules]

1.      Create the MySQL database:
c:\> mysqladmin --user=root --password create cacti
2.      Import the default Cacti database:
c:\> mysql --user=root --password cacti < c:\inetpub\wwwroot\cacti\cacti.sql

  1. Create a MySQL username and password for Cacti.
c:\> mysql --user=root --password mysql
mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactipw';
mysql> flush privileges;
  1. You will also need to update the cactiuser account with the old password style:
3.  mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('cactipw') WHERE Host = 'localhost' AND User = 'cactiuser';
mysql> FLUSH PRIVILEGES;
mysql> exit

Cacti
  1. Reboot your server.  Some times environment variables and services need to be reset in order for everything to work properly.
  2. Edit c:\inetpub\wwwroot\cacti\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 = "cactipw";
 


Anlatımını Yarım bıraktığım bir çalışma en kısa sürede tamamlamayı düşünüyorum.Hem yarım bile olsa kaybolmaması hemde tamamlamayı unutmak için buraya ekliyorum. Sağlıcakla kalın...

Hiç yorum yok:

Yorum Gönder