Compile the pcre, zlib, and other packages into nginx.

Source: Internet
Author: User
Author Ayou: http: sudone.com: when compiling nginx, you must first install external support programs such as pcre and zlib, and then specify the location of these external support programs when compiling and installing nginx, in this way, nginx will dynamically load these items each time it is started. The following describes another method to compile these programs into nginx.

Author Ayou: http ://SuDone.com

During nginx compilation, you must first install external support programs such as pcre and zlib, and then specify the location of these external support programs during nginx compilation and installation. This way, nginx is started every time, these things will be loaded dynamically.

Next we will introduce another way to compile these programs into nginx, so that nginx will not load them dynamically at startup. It can be learned from the ancient spectrum that this method is more efficient than dynamic loading.

Download:

1. wget http://www.openssl.org/source/openssl-0.9.8l.tar.gz
2. wgetFtp: // Ftp. csx. cam. ac. uk/pub/software/programming/pcre/pcre-8.00.tar.bz2
3. wget http://www.zlib.net/zlib-1.2.3.tar.bz2
4. wget http://nginx.org/download/nginx-0.8.30.tar.gz

Solve all these thingsCompressionThen there will be:

1. openssl-0.9.8l
2. pcre-8.00
3. zlib-1.2.3
4. nginx-0.8.30

I put these directories in/data/download/. In the original method, we need to compile and install them in the openssl, pcre, and zlib directories, directly go to the nginx directory.

1.CdNginx-0.8.30
2./configure -- prefix =/data/nginx -- with-http_realip_moDuLe -- with-http_sub_module -- with-http_flv_module -- with-http_dav_module -- with-http_gZip_StatIc_module -- with-http_stub_status_module -- with-http_aDdItion_module -- with-pcre =/data/download/pcre-8.00 -- with-openssl =/data/download/openssl-0.9.8l -- with-http_ssl_module -- with-zlib =/data/download/zlib-1.2.3
3. make
4. make install

The installation can be completed. It takes a long time to install this method, because you need to compile the external program first. It is worth noting that the-j multi-process method cannot be added to make, only single-process make can be used, otherwise it will fail. If your application does not require openssl, you do not need to download openssl and remove it in configure. In addition, nginx's google_perftooLs_ Module cannot be compiled in this way, so you must install google_perftools externally.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.