Home >Backend Development >PHP Tutorial >ubuntu compile nginx

ubuntu compile nginx

WBOY
WBOYOriginal
2016-08-08 09:32:05963browse

One-click compilation and installation of nginx

#nginx地址官网安装
cd /opt/ && wget http://nginx.org/download/nginx-1.7.9.tar.gz && tar xvf nginx-1.7.9.tar.gz  && cd nginx-1.7.9 && sudo apt-get install -y libpcre3 libpcre3-dev libssl-dev && ./configure && make && make install


#githubdi地址安装
cd /opt/ && wget https://github.com/nginx/nginx/archive/master.zip && unzip master.zip  && cd  nginx-master && sudo apt-get install -y libpcre3 libpcre3-dev libssl-dev && ./configure && make && make install

Step-by-step installation

1. Get the download address


2. Download

3. Unzip

4. Enter the directory and compile


5. Missing pcre package dependency reporting error

./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= option


6. Add pcre package dependency


7. Missing zlib package dependency

./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 by using –with-zlib= option.


8. Add zlib package dependency (install libssl-dev libssl-dev depends on zlib1g-dev package to automatically download)


9. Dependency check is normal


10. Compile and install


11. Installation is successful


12. Start nginx


13. Check if it is started



vim Exit command: q or switch to background mode ctrl+z to return to the main control console

The above introduces ubuntu compilation nginx, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn