./configure --with-select_module --with-threads --with-file-aio --with-http_ssl_module --with-http_v2_module --with-pcre=/home/dean/nginx/pcre-8.43 --with-openssl=/home/dean/nginx/openssl-master --with-zlib=/usr/local/zlib --with-http_auth_request_module
--库的地址是原地址
============
需要的库:
pcre:
/usr/local/pcre
// yum install -y gcc gcc-c++
=====================
zlib:
/usr/local/zlib
==================
openssl:
/usr/local/openssl
=============
nginx :
/usr/local/nginx
==============================
注意大坑!!!!!!!!
高版本nginx的库,不需要编译,直接--prefix=压缩文件地址 即可!!!!
添加systemctl启动项目
创建文件 vim /usr/lib/systemd/system/nginx.service
[Unit]
Description=nginx - high performance web server
After=network.target remote-fs.target nss-lookup.target[Service]:
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s stop[Install]
WantedBy=multi-user.target
说明:
[Unit]:服务的说明
Description:描述服务
After:描述服务类别
[Service]服务运行参数的设置
Type=forking是后台运行的形式
ExecStart为服务的具体运行命令
ExecReload为重启命令
ExecStop为停止命令
PrivateTmp=True表示给服务分配独立的临时空间
注意:启动、重启、停止命令全部要求使用绝对路径
[Install]服务安装的相关设置,可设置为多用户