1. First you need to install the necessary libraries, Pcre,zlibsudo apt-get install libpcre3 Libpcre3-dev If the file is not found, download the source file for installation.
2. Unzip the downloaded Nginx source code. Go to Folder: sudo./configure the resulting output such as the following: Configuration summary
+ Using System PCRE Library
+ OpenSSL Library is not used
+ Using BUILTIN MD5 code
+ SHA1 Library is not found
+ Using System zlib Library
Nginx path prefix: "/usr/local/nginx"
Nginx binary file: "/usr/local/nginx/sbin/nginx"
Nginx configuration prefix: "/usr/local/nginx/conf"
Nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
Nginx pid file: "/usr/local/nginx/logs/nginx.pid"
Nginx error log file: "/usr/local/nginx/logs/error.log"
Nginx HTTP access log file: "/usr/local/nginx/logs/access.log"
Nginx HTTP client request body Temporary files: "Client_body_temp"
Nginx HTTP proxy temporary files: "Proxy_temp"
Nginx http fastcgi temporary files: "Fastcgi_temp"
Nginx http Uwsgi temporary files: "Uwsgi_temp"
Nginx http scgi temporary files: "Scgi_temp"
3. Sudo make4. sudo make install 5. Review the configuration file and start [email protected]:~/nginx-1.0.15$sudo/usr/local/nginx/sbin/nginx-t
Nginx:the configuration file/usr/local/nginx/conf/nginx.conf syntax is OK
Nginx:configuration file/usr/local/nginx/conf/nginx.conf Test is successful
[Email protected]:~/nginx-1.0.15$Sudo/usr/local/nginx/sbin/nginx
At this point the viewing process is:vonz[email protected]:~/nginx-1.0.15$ Ps-axu | grep nginx
root 9723 0.0 0.0 22536 592?
Ss 22:49 0:00 Nginx:master Process/usr/local/nginx/sbin/nginx
Nobody 9724 0.0 0.0 22936 1052?
S 22:49 0:00 Nginx:worker Process
6. You can then simply test the index page via curl: [Email protected]:~$Curl http://localhost:80/
<title>welcome to Nginx!</title>
<body bgcolor= "white" text= "Black" >
<center></body>
Based on the configuration of the nginx.conf. The response file is a html/index.html page: server {
Listen 80;
server_name localhost;
Location/{
root HTML;
Index index.html index.htm;
}}
Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.
Nginx in installation Getting Started