本文共 2167 字,大约阅读时间需要 7 分钟。
yum groupinstall "Development Tools" -yyum install wget zlib-devel openssl-devel pcre-devel -yyum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel gd gd-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers pcre pcre-devel ImageMagick ImageMagick-devel gitcd /usr/local/srcwget http://nginx.org/download/nginx-1.12.1.tar.gztar zxvf nginx-1.12.1.tar.gzcd nginx-1.12.1groupadd -g 58 nginxuseradd -u 58 -g 58 -M nginx -s /sbin/nologinmkdir -p /var/tmp/nginx/{client,proxy,fastcgi,uwsgi,scgi}mkdir -p /var/cache/nginx/client_temp./configure \--user=nginx --group=nginx \--prefix=/etc/nginx \--sbin-path=/usr/sbin/nginx \--conf-path=/etc/nginx/nginx.conf \--error-log-path=/var/log/nginx/error.log \--http-log-path=/var/log/nginx/access.log \--pid-path=/var/run/nginx.pid \--lock-path=/var/run/nginx.lock \--http-client-body-temp-path=/var/cache/nginx/client_temp \--http-proxy-temp-path=/var/cache/nginx/proxy_temp \--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \--http-scgi-temp-path=/var/cache/nginx/scgi_temp \--user=nginx \--group=nginx \--with-http_ssl_module \--with-http_realip_module \--with-http_addition_module \--with-http_sub_module \--with-http_dav_module \--with-http_flv_module \--with-http_mp4_module \--with-http_gunzip_module \--with-http_gzip_static_module \--with-http_random_index_module \--with-http_secure_link_module \--with-http_stub_status_module \--with-http_auth_request_module \--with-threads \--with-stream \--with-stream_ssl_module \--with-http_slice_module \--with-mail \--with-mail_ssl_module \--with-file-aio \--with-http_v2_module \--with-ipv6make && make installnginx -V cat >> /lib/systemd/system/nginx.service < > /etc/nginx/nginx.conf < > /var/log/nginx/log.sh < /dev/null 2&1
转载于:https://blog.51cto.com/hequan/1981306