温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

LNMP-Nginx部署(适合新人)

发布时间:2020-06-27 15:10:58 来源:网络 阅读:911 作者:独孤天血 栏目:建站服务器

一、安装支持库(两种方式)

  1. 快速安装支持库

yum install pcre-devel pcre openssl-devel
  1. 编译安装支持库(建议)

  • 安装PCRE(正则)

wget  

tar zxvf pcre-8.42.tar.gz 
cd pcre-8.42/
./configure --prefix=/usr/local/pcre

make && make install

ln -sv /usr/local/pcre/lib/libpcre.so.1 /usr/lib64/libpcre.so.1
ln -sv /usr/local/pcre/lib/libpcre.so.1.2.9 /usr/lib64/libpcre.so.1.2.9
  • 安装OPENSSL(ssl)

wget https://www.openssl.org/source/openssl-1.1.0i.tar.gz
tar zxvf openssl-1.1.0i.tar.gz
cd openssl-1.1.0i/

yum install perl
./config --prefix=/usr/local/openssl
make 
make install


  • 安装zlib(Gzip依赖)

wget http://www.zlib.net/zlib-1.2.11.tar.gz
tar zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11/

./configure --prefix=/usr/local/zlib
make
make install

二、Nginx安装:

  1. 下载Nginx源码包:

wget http://nginx.org/download/nginx-1.14.0.tar.gz
  1. 创建用户:

groupadd www
useradd -g www www -s /sbin/nologin
  1. 创建目录:

mkdir -p /data/{www,logs,mysql}
chmod +w /data/www
chown -R www:www /data/www/
  1. 编译安装Nginx:

tar zxvf nginx-1.14.0.tar.gz
cd nginx-1.14.0/

./configure --prefix=/usr/local/nginx \
--user=www --group=www \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_sub_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-http_v2_module \
--with-openssl=/usr/local/src/openssl-1.1.0i \
--with-zlib=/usr/local/src/zlib-1.2.11 \
--with-pcre=/usr/local/src/pcre-8.42 \
--with-stream
make && make install


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI