Docs/linux基础/nginx/nginx安装.md
2022-10-18 16:59:37 +08:00

27 lines
No EOL
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

```
groupadd -g 501 www
useradd -u 501 -g 501 www
yum -y install pcre pcre-devel gcc-c++ perl perl-devel perl-ExtUtils-Embed openssl-devel
./configure --prefix=/usr/local/nginx \
--with-http_ssl_module --with-http_v2_module \
--with-http_realip_module --with-http_gunzip_module \
--with-http_gzip_static_module --with-http_stub_status_module \
--with-http_perl_module --with-stream \
--with-stream_ssl_module --with-stream_realip_module --with-pcre
make
make install
```
若make时失败提示
```
relocation R_X86_64_32 against `.rodata' can not be used when making a shared object;
```
在configure前加上CFLAGS="-O3 -fPIC",即
```
CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/nginx \
--with-http_ssl_module --with-http_v2_module \
--with-http_realip_module --with-http_gunzip_module \
--with-http_gzip_static_module --with-http_stub_status_module \
--with-http_perl_module --with-stream \
--with-stream_ssl_module --with-stream_realip_module --with-pcre
```