安装zabbix
需要的软件包
php-5.6.36
libmcrypt-2.5.7
mysql-5.7.26
nginx-1.10.3
zabbix-4.2.6
搭建LNMP的环境
安装依赖环境
yum -y install make apr* autoconf automake curl-devel gcc gcc-c++ openssl openssl-devel gd kernel keyutils patch perl kernel-headers compat* mpfr cpp glibc libgomp libstdc++-devel keyutils-libs-devel libcom_err-devel libsepol-devel libselinux-devel krb5-devel zlib-devel libXpm* freetype libjpeg* libpng* libtool* libxml2 libxml2-devel patch libcurl-devel bzip2-devel freetype-devel
安装libmcrypt
tar zxf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7/
./configure --prefix=/usr/local/libmcrypt && make && make install
安装php
tar zxf php-5.6.36.tar.gz
cd php-5.6.36/
./configure --prefix=/usr/local/php5.6 --with-config-file-path=/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/usr/local/mysql/mysql.sock --with-gd --with-iconv --with-libxml-dir=/usr --with-mhash --with-mcrypt --with-config-file-scan-dir=/etc/php.d --with-bz2 --with-zlib --with-freetype-dir --with-png-dir --with-jpeg-dir --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt=/usr/local/libmcrypt --with-curl
make && make install
生成php.ini配置文件
cd php-5.6.36/
cp php.ini-production /etc/php.ini
vim /etc/php.ini
找到:
;date.timezone =
修改为:
date.timezone = PRC #设置时区
找到:
expose_php = On
修改为:
expose_php = Off #禁止显示php版本的信息
找到:
short_open_tag = Off
修改为:
short_open_tag = On //支持php短标签
找到:
post_max_size = 8M
修改为:
post_max_size = 16M //上传文件大小
找到:
max_execution_time = 30
修改为:
max_execution_time = 300 //php脚本最大执行时间
找到:
max_input_time = 60
修改为:
max_input_time = 300 //以秒为单位对通过POST、GET以及PUT方式接收数据时间进行限制
always_populate_raw_post_data = -1
mbstring.func_overload = 0
创建php-fpm服务启动脚本
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
chkconfig --add php-fpm
chkconfig php-fpm on
修改php-fpm配置文件
cp /usr/local/php5.6/etc/php-fpm.conf.default /usr/local/php5.6/etc/php-fpm.conf
useradd -M -s /sbin/nologin www
vim /usr/local/php5.6/etc/php-fpm.conf
修改以下内容
pid = run/php-fpm.pid
user = www
group = www
listen =127.0.0.1:9000
pm.max_children = 300
pm.start_servers = 10
pm.min_spare_servers = 10
pm.max_spare_servers =50
启动php-fpm
/etc/init.d/php-fpm start
netstat -anplt | grep php-fpm
##查看端口
安装nginx
安装依赖环境
yum install -y gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre pcre-devel
编译安装nginx
tar zxf nginx-1.10.3.tar.gz
cd nginx-1.10