Compile and install ngnix and pcre
(1) first install pcre, which enables ngnix to support rewrite.
Yum-y install make zlib-devel gcc-c ++ libtool
Mkdir-p/home/oldboy/tools
Cd/home/oldboy/tools
Wget http://sourceforge.jp/frs/g_redir.php? M1_jaist&f=%2fpcre%2fpcre%2f8.30%2fpcre-8.30.tar.gz
Tar zxf pcre-8.30.tar.gz
Cd pcre-8.30/
./Configure
Make & make install
Cd ../
(2) install nginx
Cd/home/oldboy/tools
Wget http://nginx.org/download/nginx-1.2.3.tar.gz
Useradd nginx-s/sbin/nologin-M
Tar zxf nginx-1.2.3.tar.gz
Cd nginx-1.2.3
./Configure -- user = nginx -- group = nginx -- prefix =/application/nginx-1.2.3 -- with-http_stub_status_module -- with-http_ssl_module (if an error is reported, yum-y install openssl *)
Make & make install
Ln-s/application/nginx-1.2.3/application/nginx
Application/nginx/sbin/nginx-t check syntax. If an error is reported, run
[Root @ testvpn nginx-1.2.3] # find/-name libpcre. so *
/Lib64/libpcre. so.0.0.1
/Lib64/libpcre. so.0
/Usr/local/lib/libpcre. so.1
/Usr/local/lib/libpcre. so
/Usr/local/lib/libpcre. so.1.0.0
/Home/oldboy/tools/pcre-8.30/. libs/libpcre. so.1
/Home/oldboy/tools/pcre-8.30/. libs/libpcre. so
/Home/oldboy/tools/pcre-8.30/. libs/libpcre. so.1.0.0
[Root @ testvpn nginx-1.2.3] # vi/etc/ld. so. conf
Include ld. so. conf. d/*. conf
/Usr/local/lib # Add the find search path
[Root @ testvpn nginx-1.2.3] # ldconfig # Run this command again
[Root @ testvpn nginx-1.2.3] #/application/nginx/sbin/nginx # Start nginx
# The following three check commands
Netstat-lnt check whether port 80 exists
Ps-ef | grep nginx ### a master and a work process by default
Lsof-I: 80. Check whether 80 is nginx instead of apache.
If the wget htttp: // ip mode is installed, or welcome nginx does not appear during url access, disable the firewall and selinux.
# Check whether html is the nginx webpage directory
[Root @ testvpn html] # grep html/application/nginx/conf/nginx. conf
Root html; # This is the directory for storing web pages
Index index.html index.htm;
# Error_page 404/404 .html;
# Redirect server error pages to the static page/50x.html
Error_page 500 502 503 x.html;
Location =/50x.html {
Root html;
# Root html;
# Root html;
# Index index.html index.htm;
# Root html;
# Index index.html index.htm; directory/appalication/nginx/html is the website directory
Nginx details: click here
Nginx: click here
Deployment of Nginx + MySQL + PHP in CentOS 6.2
Build a WEB server using Nginx
Build a Web server based on Linux6.3 + Nginx1.2 + PHP5 + MySQL5.5
Performance Tuning for Nginx in CentOS 6.3
Configure Nginx to load the ngx_pagespeed module in CentOS 6.3
Install and configure Nginx + Pcre + php-fpm in CentOS 6.4
[Content navigation] |
Page 1: Previous |
Page 2nd: Middle |