CentOS 7 源码安装 Nginx

Nginx源码安装需要注意的事项
(1)提前安装基础环境gcc、pcre、zlib等。
(2)新建用户nginx。
(3)指定编译:安装路径、tcp支持、https支持。
(4)更改目录用户及授权。

源码编译安装

yum -y install gcc gcc-c++
yum -y install pcre pcre-devel zlib zlib-devel gd-devel openssl*
groupadd nginx
useradd -r -g nginx nginx
cd /home
tar -zxvf nginx-1.16.0.tar.gz
cd nginx-1.16.0
./configure --prefix=/usr/local/nginx --with-stream --with-http_ssl_module
make
make install
chown -R nginx:nginx /usr/local/nginx/
chmod -R 777 /usr/local/nginx/
发布了116 篇原创文章 · 获赞 57 · 访问量 24万+

猜你喜欢

转载自blog.csdn.net/xc_gxf/article/details/104531482