1.zabbix 安装
mysql使用5.7版本
yum install gcc gcc-c++ bzip2 bzip2-devel bzip2-libs python-devel -y
yum install -y libmcrypt-devel epel-release zlib-devel pcre pcre-devel apr apr-devel libxml2-devel openssl openssl-devel bzip2 bzip2-devel libpng libpng-devel freetype freetype-devel libcurl-devel libjpeg-devel libtool-ltdl-devel
yum install make cmake bison-devel ncurses-devel git libaio library glibc zlib-devel pcre pcre-devel -y
useradd -s /sbin/nologin mysql
cd /usr/local/mysql
mkdir -p /data/mysql ; chown -R mysql:mysql /data/mysql
重要一步
./bin/mysqld --initialize --user=mysql --datadir=/data/mysql/
./bin/mysql_ssl_rsa_setup --datadir=/data/mysql
设置密码
set password = password( yourpasswd );
另一种
skip-grant-tables
service mysqld restart
update user set authentication_string=password( 123333 ) where user= root ;
php
yum -y install gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel php-devel php-mysql libmcrypt-devel
Apache
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif --enable-bcmath --with-gettext
nginx
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --enable-zend-multibyte --disable-ipv6 --with-pear --with-curl --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif --enable-bcmath --with-gettext
cp php.ini-production /usr/local/php/etc/php.ini
vim /usr/local/php/etc/php-fpm.conf
[global]
pid = /usr/local/php/var/run/php-fpm.pid
error_log = /usr/local/php/var/log/php-fpm.log
[www]
listen = /tmp/www.sock
user = php-fpm
group = php-fpm
listen.owner = nobody
listen.group = nobody
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500
rlimit_files = 1024
/usr/local/php/sbin/php-fpm -t
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod 755 /etc/init.d/php-fpm
service php-fpm start
chkconfig php-fpm on
mysql数据库
create database zabbix default charset utf8;
grant all on zabbix.* to zabbix @ localhost identified by zabbix ;
mysql -uroot -p zabbix<./database/mysql/schema.sql
mysql -uroot -p zabbix<./database/mysql/images.sql
mysql -uroot -p zabbix<./database/mysql/data.sql
php
sed -i "s@;date.timezone =@date.timezone = Asia/Shanghai@g" /usr/local/php/etc/php.ini
sed -i "s@;max_execution_time = 30@max_execution_time = 300@g" /usr/local/php/etc/php.ini
sed -i "s@post_max_size = 8M@post_max_size = 16M@g" /usr/local/php/etc/php.ini
sed -i "s@max_input_time = 60@max_input_time = 300@g" /usr/local/php/etc/php.ini
sed -i "s@memory_limit = 128M@memory_limit = 128M@g" /usr/local/php/etc/php.ini
sed -i "s@memory_limit = 128M@memory_limit = 128M@g" /usr/local/php/etc/php.ini
cp -r /root/zabbix-2.4.5/frontends/php/ /var/www/html/zabbix/
zabbix
yum install gcc mysql-community-devel libxml2-devel unixODBC-devel net-snmp-devel libcurl-devel libssh2-devel OpenIPMI-devel openssl-devel openldap-devel net-snmp-devel OpenIPMI-developenssl-devel fping-devel libcurl-devel perl-DBI
useradd -s /sbin/nologin zabbix
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-mysql=/usr/local/mysql/bin/mysql_config
make
make install
chown –R zabbix.zabbix /usr/local/zabbix
cp misc/init.d/fedora/core/zabbix_server /etc/init.d/zabbix_server
cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/zabbix_agentd
service zabbix_server start
if error
Starting zabbix_server: /usr/local/zabbix/sbin/zabbix_server: error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory
then
vim /etc/ld.so.conf
/usr/local/mysql/lib
[root@netmaster ~]#ldconfig
然后配置文件
启动
安装的页面
if say "PHP databases support"
cd /usr/local/src/php-5.6.24/ext/mysqli
/usr/local/php/bin/phpize
./configure --prefix=/usr/local/mysqli --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/local/mysql/bin/mysql_config
make && make install
如果make这一步出现错误如下
/usr/local/php/include/php/main/../main/php_config.h:2204:1: 警告:这是先前定义的位置
/usr/local/src/php-5.6.24/ext/mysqli/mysqli_api.c:36:47: 错误:ext/mysqlnd/mysql_float_to_double.h:没有那个文件或目录
make: *** [mysqli_api.lo] 错误 1
[root@netmaster mysqli]# pwd
/usr/local/src/php-5.6.24/ext/mysqli
[root@netmaster mysqli]# vim mysqli_api.c
#include "/usr/local/src/php-5.6.24/ext/mysqlnd/mysql_float_to_double.h"
改成绝对路径就可以了

浙公网安备 33010602011771号