Run the command in the/usr directory to download the latest nginxSource code:
Wget http://nginx.org/download/nginx-1.2.0.tar.gz
After decompression you can see the nginx-1.2.0 directory:
Tar zxvf nginx-1.2.0.tar.gz
Install the PCRE Library
Yum-y install PCRE-devel
Install the OpenSSL library
Yum-y install OpenSSL-devel
Generate the make file:
./Configure -- prefix =/usr/nginx
The results should be carefully checked. Some important information is as follows:
Creating objs/makefileconfiguration Summary + using system PCRE Library + OpenSSL library is not used + MD5: using system crypto library + sha1: using system crypto library + using system zlib library nginx path Prefix: "/usr/nginx" nginx binary file: "/usr/nginx/sbin/nginx" nginx configuration Prefix: "/usr/nginx/conf" nginx configuration file: "/usr/nginx/CONF/nginx. conf "nginx PID file:"/usr/nginx/logs/nginx. PID "nginx Error Log File:"/usr/nginx/logs/error. log "nginx HTTP access log file:"/usr/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"
For example, PID file, error log file, and access log file.
Compile and install now:
Make make install
Go to the/usr/nginx/sbin directory and run nginxProgramStart.
To modify the port, modify the/usr/nginx/CONF/nginx. conf file, for example:
The server {Listen 8081;