您现在的位置是:首页>博客详情

Linux中nginx源码安装

FreshMan2021年04月30日 16:551295

简介由于nginx源码安装需要依赖部分库文件,需要提前准备好:zlib-1.2.11 pcre-8.33 openssl-1.0.1j。--配置./configure --user=root --prefix=/usr/local/nginx --with-pcre=../pcre-8.38/ --with-zlib=../zlib-1.2.11/ --with-openssl=../openssl-

由于nginx源码安装需要依赖部分库文件,需要提前准备好:zlib-1.2.11 pcre-8.33 openssl-1.0.1j。

--配置

./configure --user=root --prefix=/usr/local/nginx --with-pcre=../pcre-8.38/ --with-zlib=../zlib-1.2.11/ --with-openssl=../openssl-1.0.1j/ --with-http_auth_request_module

--编译

make

--安装

make install

--配置自启动

vi /etc/init.d/nginx

--添加可执行权限

chmod a+x /etc/init.d/nginx

 

--先将nginx服务加入chkconfig管理列表:

chkconfig --add /etc/init.d/nginx

--加完这个之后,就可以使用service对nginx进行启动,重启等操作了。

service nginx start

service nginx stop

 

--设置终端模式开机启动:

chkconfig nginx on


下载地址:

文件名称:zlibopensslpcre.zip

文件大小:6740KB

更新日期:2021/04/30