Nginx快速搭建

Nginx快速搭建

1. 安装依赖包

yum install gcc gcc-c++ make libtool autoconf patch unzip automake libxml2 libxml2-devel -y
yum install ncurses ncurses-devel libtool-ltdl-devel libtool-ltdl libmcrypt libmcrypt-devel libpng libpng-devel libjpeg-devel -y
yum install openssl openssl-devel pcre pcre-devel curl curl-devel ncurses ncurses-devel  libaio* -y

2. 下载安装包

cd  /usr/local/src/
wget http://nginx.org/download/nginx-1.10.2.tar.gz
tar zxf nginx-1.10.2.tar.gz
cd nginx-1.10.2

3. 创建Nginx用户,用于运行Nginx服务

useradd nginx -s /sbin/nologin -M

4. 编译

./configure --prefix=/application/nginx-1.10.2 \
--user=nginx \
--group=nginx \
--with-pcre \
--with-stream \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_realip_module

5. 安装

make && make install 

6.链接,便于日后升级

ln -s /application/nginx-1.10.2 /application/nginx
posted @ 2018-05-16 18:24  西瓜瓢  阅读(182)  评论(0)    收藏  举报