一、软件概述
[root@webserver ~]# cat /etc/redhat-release
CentOS Linux release7.2.1511(Core)
[root@webserver~]# uname -r3.10.0-327.el7.x86_64
[root@webserver ~]# nginx -V
nginx version: nginx/1.10.3
二、软件安装
1. 通过yum安装必要的开发包到操作系统
[root@webserver ~]# wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
[root@webserver ~]# yum install -y gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel ssse2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers ncurses ncurses-devel curl curl-devel gd libtool libtool-libs kernel-devel autoconf fontconfig-devel libXpm-devel php-mcrypt libmcrypt-devel
2. 安装nginx
[root@webserver ~]# cd /usr/local/src/[root@webserver/usr/local/src]# wget https://www.openssl.org/source/openssl-1.1.0b.tar.gz[root@webserver /usr/local/src]# tar xf openssl-1.1.0b.tar.gz
[root@webserver /usr/local/src]# cd
[root@webserver ~]# groupadd nginx
[root@webserver~]# useradd -g nginx -d /usr/local/nginx -s /sbin/nologin nginx
[root@webserver~]# wget http://nginx.org/download/nginx-1.10.3.tar.gz
[root@webserver ~]# tar xf nginx-1.10.3.tar.gz
[root@webserver~]# cd nginx-1.10.3/[root@webserver~/nginx-1.10.3]# ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-openssl=/usr/local/src/openssl-1.1.0b --with-http_v2_module
[root@webserver~/nginx-1.10.3]# make[root@webserver~/nginx-1.10.3]# make install[root@webserver~]# nginx
[root@webserver~]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp0 0 0.0.0.0:80 0.0.0.0:* LISTEN 28380/nginx: master
tcp0 0 0.0.0.0:22 0.0.0.0:* LISTEN 832/sshd
tcp0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 840/zabbix_agentd
tcp60 0 :::22 :::* LISTEN 832/sshd
tcp60 0 :::10050 :::* LISTEN 840/zabbix_agentd
3. yum安装mariadb,如果要安装MySQL,请参照下面链接:
https://www.cnblogs.com/cyleon/p/10040728.html
[root@webserver ~]# yum install mariadb mariadb-server mariadb-devel -y
4. 安装PHP
A. 下载安装libmcrypt库(加密算法扩展)
[root@webserver ~]#wget http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.bz2
[root@webserver ~]#tar xf libmcrypt-2.5.8.tar.bz2
[root@webserver ~]#cd libmcrypt-2.5.8/[root@webserver libmcrypt-2.5.8~]#./configure && make && make install
B. 下载安装mhash库(提供了一个统一的接口,有大量的