# Nginx-Library **Repository Path**: jiony/Nginx-Library ## Basic Information - **Project Name**: Nginx-Library - **Description**: Install Nginx of Linux dependency library - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2016-09-14 - **Last Updated**: 2021-03-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #Nginx-Library: **这里是存放的是Linux下安装Nginx的所依赖的Library** **先通过svn co svn://git.oschina.net/jiony/Nginx-Library /usr/local/src/** **再按照以下步骤进行安装即可:** 1、mkdir -p /opt/src 2、cd /opt/src 3、wget http://nginx.org/download/nginx-1.10.1.tar.gz 4、解压文件 ``` tar -zxvf nginx-1.10.1.tar.gz tar -zxvf ngx_cache_purge-2.3.tar.gz tar -zxvf openssl-1.0.2e.tar.gz tar -zxvf pcre-8.38.tar.gz tar -zxvf zlib-1.2.8.tar.gz ``` 5、cd nginx-1.10.1/ 6.1、 ``` ./configure --prefix=/opt/nginx \ --sbin-path=/opt/nginx/sbin/nginx \ --conf-path=/opt/nginx/conf/nginx.conf \ --error-log-path=/opt/nginx/logs/error.log \ --http-log-path=/opt/nginx/logs/access.log \ --pid-path=/opt/nginx/run/nginx.pid \ --lock-path=/opt/nginx/run/nginx.lock \ --http-client-body-temp-path=/opt/nginx/cache/nginx/client_temp \ --http-proxy-temp-path=/opt/nginx/cache/nginx/proxy_temp \ --http-fastcgi-temp-path=/opt/nginx/cache/nginx/fastcgi_temp \ --http-uwsgi-temp-path=/opt/nginx/cache/nginx/uwsgi_temp \ --http-scgi-temp-path=/opt/nginx/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-ipv6 \ --with-openssl-opt=enable-tlsext \ --add-module=/opt/src/ngx_cache_purge-2.3 \ --with-pcre=/opt/src/pcre-8.38 \ --with-zlib=/opt/src/zlib-1.2.8 \ --with-openssl=/opt/src/openssl-1.0.2e \ 可选: --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' ``` 6.2、make 6.3、make install 7、安装完后配置目录 mkdir -p /opt/nginx/cache/nginx/client_temp mkdir -p /data/logs/nginx mkdir -p /data/cache/nginx 8、创建软连接 mv /opt/nginx/cache/nginx /data/cache/nginx rm -rf /opt/nginx/logs ln -s /data/logs/nginx /opt/nginx/logs ln -s /data/cache/nginx /opt/nginx/cache/nginx 9、执行nginx: 启动: /opt/nginx/sbin/nginx -c /opt/nginx/conf/nginx.conf 关闭:/opt/nginx/sbin/nginx -s stop ======================================================================= ``` 注意: 1、遇到nginx: [emerg] getpwnam("nginx")? 解决:请检查nginx.conf配置,是否有配置user或者用户及分组是否存在,如下配置: user nginx nginx; ```