Detailed steps for Zabbix Server installation and deployment under CentOS6.8

Source: Internet
Author: User

Detailed steps for Zabbix Server installation and deployment under CentOS6.8
Required environment: apache php mysql. apache and mysql have been installed in advance, for details about the installation, refer to the installation method of apache and mysql. The installation may be messy due to many problems encountered during php installation. prepare the source code package of zabbixHttp://www.zabbix.com/download.phpZabbix-2.4.8.tar.gz here is the 2.4.8 version decompression [root @ linux1 ~] # Tar-zxvf zabbix-2.4.8.tar.gz [root @ linux1 ~] # Cd zabbix-2.4.82. New User Group [root @ linux1 ~] # Groupadd zabbix [root @ linux1 ~] # Useradd-g zabbix zabbix3.zabbix database creation import mysql> create database zabbix character set utf8; mysql> use zabbixmysql> grant all privileges on zabbix. * to zabbix @ localhost identified by "zabbix"; mysql> flush privileges; mysql> source/root/zabbix-2.4.8/database/mysql/schema. sqlmysql> source/root/zabbix-2.4.8/database/mysql/images. sqlmysql> source/root/zabbix-2.4.8/database/mysql/data. sql4. compile and install zabbix [ro Ot @ linux1 ~] # Cd zabbix-2.4.8 [root @ linux1 zabbix-2.4.8] #. /configure -- prefix =/usr/local/zabbix -- with-mysql -- with-net-snmp -- with-libcurl -- enable-server -- enable-agent -- enable-proxy may be missing some packages, check the error message, install the [root @ linux1 zabbix-2.4.8] # make [root @ linux1 zabbix-2.4.8] # make install5. add service port [root @ linux1 zabbix-2.4.8] # vim/etc/serviceszabbix-agent 10050/ tcp # Zabbix Agentzabbix-agent 10050/udp # Zabbix Agentzabbi X-trapper 10051/tcp # Zabbix Trapperzabbix-trapper 10051/udp # Zabbix Trapper6. modify the zabbix configuration file [root @ linux1 ~] # Cd/usr/local/zabbix/etc [root @ linux1 ~] # Vim zabbix_server.confDBName = zabbix # Database Name DBUser = zabbix # database username DBPassword = zabbix # Database Password DBPort = 3306 # My machine database port is 3306 DBSocket =/tmp/mysql. sockListenIP = 192.168.1.120 # Database IP address 7. set the startup script zabbix to the default startup script under/usr/local/zabbix/sbin/[root @ linux1 ~] # Cp/usr/local/zabbix/sbin/zabbix_server/etc/init. d/zabbix_server [root @ linux1 ~] # Cp/usr/local/zabbix/sbin/zabbix_agentd/etc/init. d/zabbix_agentd [root @ linux1 ~] # Chkconfig zabbix_server on # Add boot start [root @ linux1 ~] # Chkconfig zabbix_agentd on # Add boot start 8. Set the zabbix web site [root @ linux1 ~] # Mkdir/usr/local/apache/zabbix [root @ linux1 ~] # Cp/root/zabbix-2.4.8/frontends/php/*/usr/local/apache/zabbix/modify apache configuration file [root @ linux1 ~] # Vim/usr/local/apache2/conf/httpd. confAlias/zabbix/usr/local/apache2/zabbix <Directory/usr/local/apache2/zabbix> Options FollowSymLinks AllowOverride None Order deny, allow Allow from all </Directory> <IfModule dir_module> DirectoryIndex index.html index. php adds index after this. php </IfModule> after the two rows, AddType application/x-compress. ZAddType application/x-gzip. gz. add AddType application/x-httpd-php to tgz. phpAddType application/x-httpd-php-source. phps9. download the php source code packageHttp://www.php.net/downloads.phpUnzip the php-5.6.29.tar.gz [root @ linux1 ~] # Tar-zxvf php-5.6.29.tar.gz10. Compile and install php [root @ linux1 ~] # Cd php-5.6.29 [root @ linux1 php-5.6.29] #. /configure \ -- prefix =/usr/local/php \ -- with-apxs2 =/usr/local/apache2/bin/apxs \ -- enable-bcmath \ -- enable-sockets \ --- libxml-dir \ -- with-zlib \ -- with-curl \ -- with-gd \ -- with-jpeg-dir \ -- with-png-dir \ -- with-zlib-dir \ -- with-freetype-dir \ -- with-gettext \ -- enable-mbstring \ -- with-mcrypt \ -- with-mysql =/usr/local/mysql \ -- with-pdo-mysql =/usr/local/mysql/bin/mysql_config \ -- with-mysqli =/usr/local/mysql/bin/mysql_config \ -- enable-zip \ -- with-bz2 \ -- enable-soap \ -- with-pear \ -- with-pcre-dir \ -- with-openssl \ -- with-config-file-path =/usr/local/php/etc \ -- enable-shmop \ -- enable-intl many packages may be missing in the middle, for more information about how to report errors, see PHP compilation and installation.Http://www.poluoluo.com/jzxy/201505/364819.html[Root @ linux1 php-5.6.29] # make [root @ linux1 php-5.6.29] # make install11. test whether apache can resolve php (this step is no problem can not be done, because it was stuck here for a long time) on the/usr/local/apache2/htdocs/create a php page [root @ linux1 htdocs] # vi info. php <? Phpphpinfo () ;?>; Restart apache [root @ linux1 htdocs] # service httpd restart to open 192.168.1.120/info in the browser. in php, the above interface shows that php can be run, and the specific configuration information of php can be seen here * the problem I encountered here is that apache cannot parse php because the libphp5.so module is not loaded in apache, this module is compiled and installed php should be imported into apache, the configuration command is as follows -- with-apxs2 =/usr/local/apache2/bin/apxs but the result is not libphp5.so module in apache, I don't know why. At first I compiled php5.5. After I couldn't find the cause, I downloaded version 5.6 again for compilation and installation. It was found that libphp5.so was imported successfully. apache can run php12. modify php. ini [root @ linux1 ~] # Vi/usr/local/php/etc/php. inidate. timezone = Asia/Shanghaimax_execution_time = 300post_max_size = 32Mmax_input_time = 300memory_limit = 128Mmbstring. func_overload = 0always_populate_raw_post_data =-1 ** refer to the official document ** Pre-requisiteMinimum valueDescriptionPHP version5.3.0PHP memory_limit option128MBIn php. ini: memory_limit = 128 MPHP post_max_size option16MBIn php. ini: post_max_size = 16 MPHP upload_max_filesi Ze option2MBIn php. ini: upload_max_filesize = 2 MPHP max_execution_time option300 secondsIn php. ini: max_execution_time = 300PHP max_input_time option300 secondsIn php. ini: max_input_time = 300PHP session. auto_start optionmust be disabledIn php. ini: session. auto_start = 0. database supportOne of: IBM DB2, MySQL, Oracle, PostgreSQL, SQLiteOne of the following modules must be installed: ibm_db2, mysql, oci 8, pgsql, sqlite3bcmathphp-bcmathmbstringphp-mbstringPHP mbstring. func_overload optionmust be disabledIn php. ini: mbstring. func_overload = 0.PHP always_populate_raw_post_data optionmust be set to-1 Required only for PHP versions 5.6.0 or newer. in php. ini: always_populate_raw_post_data =-1socketsphp-net-socket. required for user script support. gd2.0 or higherphp-gd. php gd extension must support PNG Images (-- with-png-dir), JPEG (-- with-jpeg-dir) images and FreeType 2 (-- with-freetype-dir ). libxml2.6.15php-xml or php5-domxmlwriterphp-xmlwriterxmlreaderphp-xmlreaderctypephp-ctypesessionphp-sessiongettextphp-gettextSince Zabbix 2.2.1, the PHP gettext extension is not a mandatory requirement for installing Zabbix. if gettext is not installed, the frontend will work as usual, however, the transla Tions will not be available. Then, according to the official manual, mbstring. func_overload must be disabled, and lways_populate_raw_post_data option must be set to 113. Restart apache [root @ linux1 ~] # Service httpd restart14. open 192.168.1.120/zabbix in the browser --> next Detection Environment --> check the database after seeing OK --> enter the configured username and password --> Test connection --> OK --> next --> enter the zabbix server address --> next --> Create a configuration file, there may be a problem here, for example, but the above has already provided a clear solution --> finish. Now Zabbix Server has been deployed ~~

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.