1. Build nginx environment under ubuntu server 14

Foreword: I originally wanted to install the configuration directly on the mac, but later I thought that I rarely used mac as a server, so I switched to linux, just to learn to use linnux;

environment: ubuntu server 14
Here I want to explain, yum and apt- get,
ap-get is a software installation method under ubuntu, it is based on debain
yum is a software installation method under redhat and centos, it is based on Linux There are many detailed instructions for the
two online, and I also found them online , mine is ubuntu, so I use apt-get

method 1, network installation
=> apt-get install nginx is
simple and rude, keeping the network unblocked, one command is done.

The second method is to compile the source code and install it. Compile the source code for installation, so you must first prepare the compilation environment and the program library used.
1. The compilation environment and program library -----------------------
What I came across:
=>apt-get install libpcre3 libpcre3-dev
=>apt-get install openssl libssl-dev
may need
=>apt-get install build-essential
=>apt-get install libtool
=>apt-get update
= >apt-get install zlib1g-dev
=>apt-get install gcc-c++
Note: These are just what I encountered during the installation process. Different environments and versions may require different compilation and program libraries. It is recommended to compile and install directly, and then install the required environment libraries one by one according to the prompts;
2 , Installation ----------------------------- It is
recommended to add a user group before installation
=>groupadd -r nginx
=>useradd -r -g nginx -M nginx
decompress nginx archive,
cd to decompression directory
=>./configure \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error. log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx .lock \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/tmp/nginx/client/ \
--http-proxy-temp-path=/var/tmp/nginx/proxy/ \
--http-fastcgi-temp- path=/var/tmp/nginx/fcgi/ \
--with-pcre
=>make && make install
=>mkdir -p /var/tmp/nginx/client

=>nginx -t
nginx: the configuration file /etc/nginx /nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
indicates that the installation is successful

Note : The error I encountered during installation

1. When Ubuntu installs nginx, it prompts error: the HTTP rewrite module requires the PCRE library
solution:
you need to install the pcre package.
sudo apt-get update
sudo apt-get install libpcre3 libpcre3-dev
You may also need to install 
sudo apt-get install openssl libssl-dev


-------------------------------------------------- -----------------
If there are other questions or errors in the text, please point them out to me in time, so that
I can correct them in time and let us make progress together.
email : [email protected]
qq : 1035862795 Stepping
stone: Code composes life

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326770656&siteId=291194637