Nginx Installation
Linux systems need to install the necessary development packages, such as gcc,gcc-c++
1.
OpenSSL (HTTPS supported)
Https://www.openssl.org/source/openssl-1.0.2.tar.gz
TAR-ZXVF openssl-1.0.2.tar.gz # Download and unzip, then CD to the installation directory, the same as
./config--prefix=/usr/local--openssldir=/usr/local/opensslmake
2.
Pcre: (Supports forwarding components)
3.
Nginx:
./configure--with-http_stub_status_module--with-http_ssl_module--with-http_realip_module--with-openssl=/opt/ Package/openssl-1.0.2amake &&
Note if the./configure tip error:the HTTP gzip module requires the Zlib library ..., you can yum-y install Zlib-devel or manually install Zlib-deve L, if you do not need this feature, you can add--without-http_gzip_module to the./configure
Note:--with-openssl=/usr/local/openssl modifies the decompression directory of the OpenSSL compression pack, and my test machine is/opt/package/openssl-1.0.2a
Reference: Other nginx Common compilation options to open the Http_realip_module module
--with-http_realip_module : Get real ip,--with-http_stub_status_module--with-http_ssl_module after Nginx agent
Start Nginx,
Cd/usr/local/nginx/sbin./nginx
Start no error indicating that Nginx has been operating properly
Troubleshoot error while loading shared libraries:libpcre.so.1
/usr/local/webserver/nginx/sbin/nginx:error while loading shared Libraries:libpcre.so.1:cannot open Shared object file : No such file or directory
Workaround:
Ln-s/usr/local/lib/libpcre.so.1/lib
Other Nginx Command Reference
NGINX-T # Check that the configuration file syntax is correct nginx-s reload #重新加载修改后的配置文件 nginx-v # View compilation Parameters Nignx-v # view version
Linux under the source installation Nginx service