1.依赖库安装
yum -y install openssl openssl-devel gcc perl-devel perl-ExtUtils-Embed
2.nginx编译安装
root用户操作
./configure \
--prefix=/usr/local/nginx \
--error-log-path=/usr/local/nginx/logs/error.log \
--http-log-path=/usr/local/nginx/logs/access.log \
--pid-path=/usr/local/nginx/nginx.pid \
--lock-path=/usr/local/nginx/nginx.lock \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_realip_module \
--with-http_sub_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-http_perl_module \
--http-client-body-temp-path=/usr/local/nginx/client_temp/ \
--http-proxy-temp-path=/usr/local/nginx/proxy_temp/ \
--http-fastcgi-temp-path=/usr/local/nginx/fcgi_temp/ \
--http-uwsgi-temp-path=/usr/local/nginx/uwsgi_temp/ \
--http-scgi-temp-path=/usr/local/nginx/scgi_temp/ \
--add-module=/root/nginx_upstream_check_module-master/ \ #此行可去除
--with-pcre
make && make install
chown -R nmcuser:nmc /usr/local/nginx
chmod -R 755 /usr/local/nginx
chown root:root /usr/local/nginx/sbin/nginx
chmod 755 /usr/local/nginx/sbin/nginx
chmod u+s /usr/local/nginx/sbin/nginx
3.nginx基本操作
启动 /usr/local/nginx/sbin/nginx
指定配置文件启动 /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
重新加载配置文件 /usr/local/nginx/sbin/nginx -s reload
关闭 /usr/local/nginx/sbin/nginx -s stop
重启 /usr/local/nginx/sbin/nginx -s reopen
|