nginx 安裝配置
1.下載安裝依賴包:
安裝gcc,gcc-c++; openssl;pcre;zlib
2.下載nginx包并安裝
tar -zxvf nginx-1.10.3.tar.gz
cd nginx-1.10.3
編譯
./configure --prefix=/usr/local/nginx-1.10.3
--witch-openssl= #指的是openssl源碼路徑
--with-pcre=
--with-zlib=
--with-http_ssl_module
make
make install
3.修改nginx配置文件報錯排查
nginx: [emerg] getpwnam("nginx") failed in /usr/local/nginx-1.10.3/conf/nginx.conf:2 #第二行內容如下user nginx nginx;
解決方法: useradd nginx
nginx: [error] invalid PID number "" in "/usr/local/var/run/nginx/nginx.pid"
# ./nginx -c /usr/local/nginx-1.6/conf/nginx.conf
# ./nginx -s reload

浙公網安備 33010602011771號