安装步骤
cd usr/local
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
mkdir nginx
cd nginx/
wget http://nginx.org/download/nginx-1.13.7.tar.gz
tar -xvf nginx-1.13.7.tar.gz
cd nginx-1.13.7
./configure --with-http_stub_status_module --with-http_ssl_module
make
make install
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
安装过程中问题
- 执行make过程中报错
make -f objs/Makefile
make[1]: Entering directory '/usr/local/nginx/nginx-1.13.7'
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/os/unix/ngx_user.o \
src/os/unix/ngx_user.c
src/os/unix/ngx_user.c: In function ‘ngx_libc_crypt’:
src/os/unix/ngx_user.c:26:7: error: ‘struct crypt_data’ has no member named ‘current_salt’
cd.current_salt[0] = ~salt[0];
^
make[1]: *** [objs/Makefile:791: objs/src/os/unix/ngx_user.o] Error 1
make[1]: Leaving directory '/usr/local/nginx/nginx-1.13.7'
make: *** [Makefile:8: build] Error 2
修改 vim objs/Makefile 将-Werror去掉