1. Install Pcre, zlib, OpenSSL
Yum install-y pcre pcre-develyum install-y zlib zlib-develyum install-y OpenSSL openssl-devel
2. Installing Nginx
RPM-IVH http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpmyum-y Install Nginxyum-y php-fpmservice php-fpm restartservice nginx restartchkconfig php-fpm onchkconfig nginx on
Open the browser to access the IPof this machine if the browser appears Welcome to nginx! Indicates that Nginx is installed and running successfully.
3. Common commands
Service Nginx startservice nginx stopservice nginx Reload
4. Common Configuration
Vi/etc/nginx/conf.d/default.conf
server { listen ; server_name localhost; AutoIndex on ; #charset Koi8-r; #access_log /var/log/nginx/log/host.access.log main; Location/{ root /var/www/html; Index index.html index.htm index.php; } Location ~ \.php$ { root /var/www/html; Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_param script_filename /var/www/html$fastcgi_script_name; Include fastcgi_params; }
CentOS 6.5 Installation Configuration Nginx environment