标签:
1.安装pcre ,zlib ,openssl
yum install -y pcre pcre-devel yum install -y zlib zlib-devel yum install -y openssl openssl-devel
2.安装nginx
rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm yum -y install nginx yum -y php-fpm service php-fpm restart service nginx restart chkconfig php-fpm on chkconfig nginx on
打开浏览器访问此机器的 IP,如果浏览器出现 Welcome to nginx! 则表示 Nginx 已经安装并运行成功。
3.常用命令
service nginx start service nginx stop service nginx reload
4.常用配置
vi /etc/nginx/conf.d/default.conf
server { listen 80; 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; }
标签:
原文地址:http://www.cnblogs.com/tiger2soft/p/4866058.html