First, install the LEMP environment
Download the installation package: Wget bbs.linuxtone.org/docs/autoinstall/lemp_auto_v1.0.6.tar.gz
Package decompression: Tar zxvf lemp_auto_v1.0.6.tar.gz
Go to folder: CD Lemp
Assign permissions: chmod 777 *
Installation:./lemp.sh
Enter
Select a, enter (install nginx+mysql+php)
Enter (two steps above, directly enter, because the default is a option)
Wait for the installation to complete.
Second, download Zabbix
wget http://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/1.8.2/zabbix-1.8.2.tar.gz
Zabbix Official website: http://www.zabbix.com/download.php You can also download other versions from this address.
Unpacking the installation package
Tar zxvf zabbix-1.8.2.tar.gz
Third, start MySQL and create the Zabbix database
To the MySQL startup directory
Cd/etc/rc.d/init.d
Start MySQL
/mysqld start or directly using service mysqld start
Go to MySQL Database
Direct MySQL can be.
Create a Zabbix database
Create Database Zabbix;
MySQL Authorized remote access:
GRANT all privileges on * * to ' root ' @ '% ' identified by ' 123123 ' with GRANT OPTION;
(I'll give it all permission here.)
Refresh permissions:
Flush privileges;
Go to the directory where you downloaded the extracted Zabbix and look for the Zabbix database to create the file
My path:
/data/apps/zabbix-1.8.2/create/schema/
/data/apps/zabbix-1.8.2/create/data/
Note:/data/apps/is the directory I created myself, you need to find it in your own download directory.
Import Database:
Under the schema directory:
MySQL Zabbix < Mysql.sql
Under the Data directory:
MySQL Zabbix < Data.sql
MySQL Zabbix < Images_mysql.sql
Iv. installation of Zabbix
To the Zabbix directory, compile the installation
./configure--prefix=/usr/local/zabbix--enable-server--enable-agent--enable-proxy--with-mysql=/usr/local/ Mysql-5.1.56/bin/mysql_config--with-net-snmp--with-libcurl
Make && make install
Add Zabbix service corresponding port
Cat >>/etc/services<<eof
Zabbix-agent 10050/tcp Zabbix Agent
Zabbix-agent 10050/UDP Zabbix Agent
Zabbix-trapper 10051/tcp Zabbix Trapper
Zabbix-trapper 10051/udp Zabbix Trapper
Eof
Create the Zabbix directory under the ETC directory to put the Zabbix configuration file
cd/etc/
mkdir Zabbix
CD Zabbix
Copy the Zabbix configuration file to the/etc/zabbix directory
cp/data/apps/zabbix-1.8.2/misc/conf/*./
Create the Zabbix folder under the/data/www/wwwroot/directory
cd/data/www/wwwroot/
mkdir Zabbix
Copy configuration file
cp–r/data/apps/zabbix-1.8.2/frontends/php/*/data/www/wwwroot/zabbix
Modify the user name and password of the database in the Zabbix configuration file
cd/etc/zabbix/
Vim zabbix_server.conf
Modify User name Password:
Save and exit after modification.
Links to Zabbix startup script files for easy startup, shutdown, and restart actions.
cd/usr/local/zabbix/bin/
For i in *;d o ln-s/usr/local/zabbix/bin/${i}/usr/bin/${i};d one
For i in *;d o ln-s/usr/local/zabbix/sbin/${i}/usr/sbin/${i};d one
Add MySQL Lib library files to the system dynamic Library configuration file
echo "/usr/local/mysql-5.1.56/lib/mysql/" >>/etc/ld.so.conf
Ldconfig
Copy Zabbix startup script file to/etc/init.d/directory, it is convenient to start Zabbix later
cp/data/apps/zabbix-1.8.2/misc/init.d/redhat/8.0/zabbix_server/etc/init.d/
cp/data/apps/zabbix-1.8.2/misc/init.d/redhat/8.0/zabbix_agentd/etc/init.d/
assigning permissions
chmod 777 zabbix*
Modify the Zabbix program path location
Vim Zabbix_server
Vim Zabbix_agentd
After modification: Wq save exit.
Add Boot service:
Chkconfig--add Zabbix_server
Chkconfig--add Zabbix_agentd
Chkconfig--level 345 Zabbix_server on
Chkconfig--level 345 Zabbix_agentd on
Create a Zabbix virtual machine profile in the Nginx configuration file
Cat>/usr/local/nginx/conf/vhosts/monitor.conf<<eof
server {
Listen 80;
server_name zabbix.chanjet.com;
#access_log Logs/zabbix_access.log Main;
Location/{
Root/data/www/wwwroot/zabbix;
Index index.html index.htm index.php;
}
Location ~ \.php$ {
Root/data/www/wwwroot/zabbix;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Include Fastcgi_params;
}
}
Eof
Adjust PHP configuration file to make configuration meet Zabbix running requirements
cd/usr/local/php-5.2.17/etc/
Vim php.ini
Set up:
Date.timezone =PRC
Post_max_size = 16M
Max_execution_time = 300
Max_input_time = 300
Copy files:
cp/usr/local/php-5.2.17/sbin/php-fpm/etc/init.d/
Add permissions
chmod 777/etc/init.d/php-fpm
Restart takes effect
/ETC/INIT.D/PHP-FPM restart
Five, enter the Zabbix page installation
Finally in a constant effort to see the page, enter your IP in the browser plus Zabbix
Ip/zabbix Enter, OH!!!!!!
Go to fool installation mode, next step!!!!
Enter the fourth step of the configuration database:
Enter the user name and password we previously set permissions, click Test Connection, status OK
Enter the IP directly next.
My 7th step is an error, such as:
I clicked the Save configuration file to download it and then saved it to the prompt directory:/data/www/wwwroot/zabbix/conf
Then click on Retry,ok.
Here, the installation is complete.
Login page, enter user name and password to enter, default username admin password Zabbix
Start your Zabbix journey!!
If you encounter problems during the installation process, please ask questions. I will pay attention and answer.
CentOS Installation Zabbix cluster monitoring (pro-Test non-pit version)