Fast build lamp environment and Zabbix 2.0.6 under RHEL 6.2

Source: Internet
Author: User
Tags php mysql snmp

First, quickly build lamp environment

1. Configure local Yum Source

[Email protected] ~]# mount/dev/cdrom/mnt

[Email protected] ~]# Vi/etc/yum.repos.d/rhel-source.repo

[Rhel-source]

Name=rhel-source

Baseurl=file:///mnt

Enabled=1

Gpgcheck=0

#gpgkey =file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-release

[email protected] ~]# Yum Clean all

[email protected] ~]# Yum list


2, Configuration Apache2

[Email protected] ~]# yum-y install httpd

[[email protected] ~]#/etc/init.d/httpd start


3. Install MySQL

[Email protected] ~]# yum-y install MySQL Mysql-server

[[email protected] ~]#/etc/init.d/mysqld start

Change the root password to 1234

[Email protected] ~]#/usr/bin/mysqladmin-u root password ' 1234 '

Login test: [[email protected] ~]# mysql-u root-p


4, installation PHP5

[[email protected] ~]# yum-y install PHP

Restart Apache after installation to make PHP effective

[Email protected] ~]#/etc/init.d/httpd restart

To test whether the apache+php is installed correctly:

[[email protected] ~]# echo "<?php phpinfo ()?>" >/var/www/html/info.php

Open the browser, as shown in the effect:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7F/BB/wKiom1cqu7rC64TVAAItWjlZWto204.png "title=" 2016-05-05_111854.png "alt=" Wkiom1cqu7rc64tvaaitwjlzwto204.png "/>

Installing the Php-mysql module

[Email protected] ~]# yum-y install Php-mysql

Restart Apache

[Email protected] ~]#/etc/init.d/httpd restart


5. Set lamp component to boot automatically

[Email protected] ~]# chkconfig--levels 2345 httpd on

[Email protected] ~]# chkconfig--levels 2345 mysqld on


Second, build Zabbix server

1. Yum and RPM installation components

[email protected] ~]# yum install make mysql-server httpd php mysql-devel gcc net-snmp-devel curl-devel perl-dbi php-gd p Hp-mysql Php-xml

Download rpm packages for php-mbstring and Php-bcmath, then install

[Email protected] ~]# RPM-IVH php-mbstring-5.3.3-3.el6_1.3.x86_64.rpm

[Email protected] ~]# RPM-IVH php-bcmath-5.3.3-3.el6_2.8.x86_64.rpm--nodeps


2, upload zabbix-2.0.6 to the/usr/local/src/directory, and Unzip

[Email protected] ~]# cd/usr/local/src/

[Email protected] src]# Rz-ab

[Email protected] src]# tar zxf zabbix-2.0.6.tar.gz


3. New Zabbix user and CREATE Database

[Email protected] ~]# Useradd Zabbix

[Email protected] ~]# mysql-u root-p

Mysql> CREATE database Zabbix character set UTF8;

Mysql> Grant all on zabbix.* to [e-mail protected] ' localhost ' identified by ' zabbixpass ';

mysql> flush Privileges;

mysql> use Zabbix;

Mysql> Source/usr/local/src/zabbix-2.0.6/database/mysql/schema.sql

Mysql> Source/usr/local/src/zabbix-2.0.6/database/mysql/images.sql

Mysql> Source/usr/local/src/zabbix-2.0.6/database/mysql/data.sql


4. Compile and install zabbix-2.0.6

[Email protected] zabbix-2.0.6]#/configure--with-mysql--with-libcurl--with-net-snmp--enable-server-- Enable-agent--enable-proxy--prefix=/usr/local/zabbix

[[email protected] zabbix-2.0.6]# make && make install

[[email protected] zabbix-2.0.6]# date-s ' 2016-5-5 12:38:12 '


5. Add Port

[Email protected] zabbix-2.0.6]# vi/etc/services

Zabbix-agent 10050/tcp # Zabbix Agent

Zabbix-agent 10050/UDP # Zabbix Agent

Zabbix-trapper 10051/tcp # Zabbix Trapper

Zabbix-trapper 10051/UDP # Zabbix Trapper


6. Modify the configuration file

[Email protected] zabbix-2.0.6]# vi/etc/httpd/conf/httpd.conf

DirectoryIndex index.html Index.html.var index.php


[Email protected] zabbix-2.0.6]# sed-i ' s#logfile=/tmp/zabbix_server.log#logfile=/var/log/zabbix_server.log#g '/ Usr/local/zabbix/etc/zabbix_server.conf

[Email protected] zabbix-2.0.6]# echo "dbpassword=1234" >>/usr/local/zabbix/etc/zabbix_server.conf

[Email protected] zabbix-2.0.6]# grep-ven ' ^#| ' | ^$ '/usr/local/zabbix/etc/zabbix_server.conf

[Email protected] zabbix-2.0.6]# Touch/var/log/zabbix_server.log

[Email protected] zabbix-2.0.6]# chmod 777/var/log/zabbix_server.log


[email protected] zabbix-2.0.6]# CP misc/init.d/fedora/core5/zabbix_server/etc/init.d/

[email protected] zabbix-2.0.6]# CP misc/init.d/fedora/core5/zabbix_agentd/etc/init.d/

[Email protected] zabbix-2.0.6]# chmod 777/etc/init.d/zabbix_*


[Email protected] zabbix-2.0.6]# sed-i ' s#zabbix_bin= "/usr/local/sbin/zabbix_server" #ZABBIX_BIN = "/usr/local/ Zabbix/sbin/zabbix_server "#g '/etc/init.d/zabbix_server

[Email protected] zabbix-2.0.6]# Head-n 21/etc/init.d/zabbix_server | Tail-n 1


[Email protected] zabbix-2.0.6]# sed-i ' s#zabbix_bin= "/usr/local/sbin/zabbix_agentd" #ZABBIX_BIN = "/usr/local/ Zabbix/sbin/zabbix_agentd "#g '/etc/init.d/zabbix_agentd

[Email protected] zabbix-2.0.6]# Head-n 21/etc/init.d/zabbix_agentd | Tail-n 1


7. Start the service and set the Add to boot entry

[[email protected] zabbix-2.0.6]#/etc/init.d/zabbix_server start

[[email protected] zabbix-2.0.6]#/etc/init.d/zabbix_agentd start

[Email protected] zabbix-2.0.6]# chkconfig zabbix_server on

[Email protected] zabbix-2.0.6]# chkconfig zabbix_agentd on


8. Modify PHP parameters and configure PHP files

[Email protected] zabbix-2.0.6]# Vi/etc/php.ini

Max_execution_time = 300

Max_input_time = 300

Date.timezone = PRC

Post_max_size = 32M


[Email protected] zabbix-2.0.6]# CD frontends/

[Email protected] frontends]# CP-RF php/var/www/html/

[Email protected] frontends]# cd/var/www/html/

[Email protected] html]# mv PHP Zabbix

[Email protected] html]# chown-r Zabbix:zabbix Zabbix


9. Install Zabbix (shown)

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7F/BC/wKiom1cq1ZOyqskKAALJERttPAY214.png "style=" float: none; "title=" 2016-05-05_130442.png "alt=" Wkiom1cq1zoyqskkaaljerttpay214.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7F/BA/wKioL1cq1mzQYZ-OAAISzwS5y_0262.png "style=" float: none; "title=" 2016-05-05_130450.png "alt=" Wkiol1cq1mzqyz-oaaiszws5y_0262.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7F/BC/wKiom1cq1ZfxFEgYAAH-92XEx8E146.png "style=" float: none; "title=" 2016-05-05_130537.png "alt=" Wkiom1cq1zfxfegyaah-92xex8e146.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7F/BC/wKiom1cq1ZmCk0HVAAH7_X9jk10775.png "style=" float: none; "title=" 2016-05-05_130551.png "alt=" Wkiom1cq1zmck0hvaah7_x9jk10775.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/7F/BC/wKiom1cq1ZuD3DoYAAIQ4aJqDps597.png "style=" float: none; "title=" 2016-05-05_130557.png "alt=" Wkiom1cq1zud3doyaaiq4ajqdps597.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7F/BC/wKiom1cq1ZzzbHZEAAHsN9Wj7Uc172.png "style=" float: none; "title=" 2016-05-05_130828.png "alt=" Wkiom1cq1zzzbhzeaahsn9wj7uc172.png "/>

Note: If failed appears, you need to do the following

1) Click on the download below to download the file

2) CD to the directory where the file is located, execute:

[Email protected] html]# cp/root/downloads/zabbix.conf.php/var/www/html/zabbix/conf/


650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7F/BA/wKioL1cq1nWjA4NMAAIn1CNdqVg457.png "style=" float: none; "title=" 2016-05-05_130845.png "alt=" Wkiol1cq1nwja4nmaain1cndqvg457.png "/>

Default login Name: admin Password: Zabbix





This article is from the "11382081" blog, please be sure to keep this source http://11392081.blog.51cto.com/11382081/1770368

Fast lamp environment and Zabbix 2.0.6 under RHEL 6.2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.