1、环境准备:
服务器系统版本:CentOS 6.5
nginx软件版本:nginx-1.13.9
2、资源准备:
nginx下载地址:http://nginx.org/download/nginx-1.13.9.tar.gz
3、安装步骤:
可以执行一个安装所有缺少的依赖包:
[root@localhost ~]# yum -y install gcc gcc-c++ automake autoconf make libtool zlib zlib-devel openssl openssl-devel pcre pcre-devel
也可以分别单独安装,详情如下:
3.1、安装PCRE库
yum install pcre
yum install pcre-devel
3.2、安装Zlib库
yum install zlib
yum install zlib-devel
3.3、安装gcc、gcc-c++
yum install gcc
yum install gcc-c++
3.4、安装openssl
yum install openssl
yum install openssl-devel
3.5、安装automake、autoconf、libtool、make
yum install automake
yum install autoconf
yum install libtool
yum install make
4、进入/opt目录,下载nginx
[root@localhost ~]# cd /opt/
[root@localhost opt]# wget http://nginx.org/download/nginx-1.13.9.tar.gz
解压nginx安装包
[root@localhost opt]# tar -zxvf nginx-1.13..tar.gz
安装nginx
[root@localhost doc]# ./configure --prefix=/opt/nginx --with-http_ssl_module --with-pcre
[root@localhost doc]# make && make install
5、启动nginx
[root@localhost nginx-1.13.]# /opt/nginx/sbin/nginx
浏览器输入IP地址:http://192.168.168.134