关于zabbix及相关服务软件版本:
Linux:centos 6.6
nginx:1.9.15
MySQL:5.5.49
PHP:5.5.35
一、安装nginx:
安装依赖包:
yum -y install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre* make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel
创建用户:
useradd nginx -s /sbin/nologin -M
下载nginx软件包并进入到目录中:
wget http://nginx.org/download/nginx-1.9.15.tar.gz && tar xvf nginx-1.9.15.tar.gz && cd nginx-1.9.15
编译:
./configure --prefix=/usr/local/product/nginx1.9.14 --user=www --group=www --with-http_ssl_module --with-http_v2_module --with-http_stub_status_module --with-pcre make && make installln -s /usr/local/product/nginx1.9.14 /usr/local/nginx ==>创建软链接
参数解释:
--with-http_stub_status_module:支持nginx状态查询--with-http_ssl_module:支持https--with-http_spdy_module:支持google的spdy,想了解请百度spdy,这个必须有ssl的支持--with-pcre:为了支持rewrite重写功能,必须制定pcre
二、安装PHP
下载PHP安装包:
wget http://cn2.php.net/get/php-5.5.35.tar.gz/from/this/mirror
解压并编译:
mv mirror php-5.5.35.tar.gz && tar xvf php-5.5.35.tar.gz && cd php-5.5.35./configure --prefix=/usr/local/product/php-5.5.35 --with-config-file-path=/usr/local/product/php-5.5.35/etc --with-bz2 --with-curl --enable-ftp --enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --enable-gd-native-ttf --with-iconv-dir=/usr/local --enable-mbstring --enable-calendar --with-gettext --with-libxml-dir=/usr/local --with-zlib --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --enable-dom --enable-xml --enable-fpm --with-libdir=lib64 --enable-bcmathmake && make installln -s /usr/local/product/php-5.5.35 /usr/local/phpcp php.ini-production /usr/local/php/etc/php.inicd /usr/local/php/etc/cp php-fpm.conf.default php-fpm.conf
修改php.ini参数:(zabbix环境需要修改的参数)
max_execution_time = 300 memory_limit = 128M post_max_size = 16M upload_max_filesize = 2M max_input_time = 300 date.timezone = PRC
三、安装MySQL
添加mysql用户,创建mysql的数据目录:
groupadd mysqlmkdir -pv /data/mysqluseradd -r -g mysql -d /data/mysql -s /sbin/nologin mysqlchown -R mysql.mysql /data/mysql
安装cmake及依赖:
yum install cmake gcc* ncurses-devel -y
下载MySQL安装包:
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.49.tar.gz
编译安装MySQL:
tar -xvf mysql-5.5.49.tar.gz && cd mysql-5.5.49cmake -DCMAKE_INSTALL_PREFIX=/usr/local/product/mysql5.5.49 -DDEFAULT_CHARSET=utf8 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/data/mysql -DWITH_EXTRA_CHARSETS=all -DWITH_READLINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_TCP_PORT=3306 -DDEFAULT_COLLATION=utf8_general_cimake && make installln -s /usr/local/product/mysql5.5.49 /usr/local/mysqlchown -R mysql.mysql /usr/local/mysql
新闻热点
疑难解答