1、环境准备:
服务器系统版本:CentOS 6.5
nginx软件版本:nginx-1.13.9
2、资源准备:
nginx下载地址:http://nginx.org/download/nginx-1.13.9.tar.gz
3、安装步骤:
可以执行一个安装所有缺少的依赖包:
[[email protected] ~]# 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
[[email protected] ~]# cd /opt/ [[email protected] opt]# wget http://nginx.org/download/nginx-1.13.9.tar.gz
解压nginx安装包
[[email protected] opt]# tar -zxvf nginx-1.13.9.tar.gz
安装nginx
[[email protected] doc]# ./configure --prefix=/opt/nginx --with-http_ssl_module --with-pcre [[email protected] doc]# make && make install
5、启动nginx
[[email protected] nginx-1.13.9]# /opt/nginx/sbin/nginx
浏览器输入IP地址:http://192.168.168.134
原文地址:https://www.cnblogs.com/alsodzy/p/8523842.html
时间: 2024-10-08 14:16:04