- Download nginx.tar.gz source package from official website
- Copy to Linux system for decompression TAR-ZXVF nginx.tar.gz
- Enter the extracted directory, need./configure, this step will report multiple errors, such as the installation of GCC when not installed GCC, etc.
When the./configure, the error may be as follows:./configure:error:the HTTP Rewrite module requires the PCRE library. You can either disable the module by using--without-http_rewrite_module option, or install the PCRE library into the System, or build the PCRE library statically from the source with Nginx by using--with-pcre=<path> option.
- The solution is to install Pcre-devel this package, yum-y install pcre-devel in order to rewrite rewrite
- After installing the above package, will also error, hint./configure:error:the HTTP gzip module requires the Zlib library. You can either disable the module by using--without-http_gzip_module option, or install the Zlib library into the system, or build the Zlib library statically from the source with Nginx
- The Zlib-devel package needs to be installed at this time, yum-y install Zlib-devel for gzip compression
4.make
5.make Install or 4 and 5 combined, make && make install
6. The program compiled and installed will be saved in the/usr/local directory, as follows:
7. Run the command./sbin/nginx will start Nginx, via Ps-ef | grep nginx or by NETSTAT-ANPL | grep 80 to view process or port status
- To access Firefox localhost:80, if the following interface appears, the Nginx boot success:
1.linux Source Installation Nginx