centos6.1 installation configuration nginx and php
Deploy nginx, php (including fastcgi), virtual host configuration in CentOS 6.1 environment, friends who need it can refer to the following Deployment time: 2012-07-24 OS environment: CentOS 6.1 nginx: nginx-1.2.2 PHP: PHP5.3.14 0. Install dependent packages yum install openssl-devel pcre-devel zlib-devel libjpeg-devel libpng-devel freetype-devel gcc make 1. Add www user to execute nginx useradd -M -r -s /sbin/nologin -d /opt/web/www 2. Create a temporary directory mkdir -p /var/tmp/nginx/client/ mkdir -p /var/tmp/nginx/proxy/ mkdir -p /var/tmp/nginx/fcgi/ 3. Download the latest stable source code of nginx cd /usr/local/src/ wget http://nginx.org/download/nginx-1.2.2.tar.gz 4. Unzip, compile, and install tar vxzf nginx-1.2.2.tar.gz cd nginx-1.2.2/ ./configure \ –prefix=/opt/web/nginx \ –error-log-path=/var/log/nginx/error.log \ –pid-path=/var/run/nginx/nginx.pid \ –lock-path=/var/lock/nginx.lock \ –user=www \ –group=www \ –with-http_ssl_module \ –with-http_stub_status_module \ –with-http_gzip_static_module \ –http-log-path=/var/log/nginx/access.log \ –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/ \ –http-uwsgi-temp-path=/var/tmp/nginx/uwsgi/ make make install 5. Configure nginx vim /opt/web/nginx/conf/nginx.conf # Specify the starting user: user www www; # The number of processes, the author of nginx thinks that one is enough, modify it according to your own visits worker_processes 1; # Set error log: #error_log logs/error.log notice; #error_log logs/error.log info; error_log /var/log/nginx/error.default.log; pid /opt/web/nginx/nginx.pid; events { use epoll; worker_connections 1024; } http { charset utf-8; include mime.types; default_type application/octet-stream; #log_format main ‘$remote_addr – $remote_user [$time_local]…