1、安装pcre-8.41
tar -xvf pcre-8.4.1.tar.gz
cd pcre-8.4.1
./configure
make && make install
2、安装zlib-1.2.11
3、安装nginx
tar -xvf nginx-1.12.2.tar.gz
cd nginx-1.12.2
./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-pcre=../pcre-8.41 --with-zlib=../zlib-1.2.11
make && make install
4、nginx开机自启动
4.1 vim /etc/init.d/nginx (红色两行一定要添加)
#! /bin/sh
# chkconfig: - 85 15 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="nginx daemon" set -e do_start() { do_stop() { do_reload() { case "$1" in exit 0 |
chkconfig --add nginx
chkconfig nginx on
至此,开机启动配置完成
来源:https://www.cnblogs.com/bury12/p/8048175.html