裸奔的鸡蛋 发表于 2011-10-10 08:25:27

window下nginx+php配置安装篇

<div id="blog_text" class="cnt" >
Nginx (&quot;engine x&quot;) 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,它已经在该站点运行超过两年半了。Igor 将源代码以类BSD许可证的形式发布。尽管还是测试版,但是,Nginx 已经因为它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名了。


nginx下载地址: 下载nginx for Windows 版本

php下载地址: 下载php for Windiowns版本

第二,解压下载好的nginx压缩包(假如放到到了C:\WWW\SERVER\nginx-0.8.24),然后以Fastcgi 模式安装php C:\WWW\SERVER\php5,接下来就是nginx 配置啦,打开nginx-0.8.24下的conf文件下的nginx.conf

下面这写代码内容就是我的nginx 配置单:


[*]server {
[*]      listen       4000;                     //web端口号,我在本地测试用4000这个端口
[*]      server_name localhost;      #charset koi8-r;      #access_log logs/host.access.log main;      location / {
[*]            root   html;
[*]            index index.html index.htm index.php;
[*]      }      #error_page 404            /404.html;      # redirect server error pages to the static page /50x.html
[*]      #
[*]      error_page   500 502 503 504 /50x.html;
[*]      location = /50x.html {
[*]            root   html;
[*]      }      # proxy the PHP scripts to Apache listening on 127.0.0.1:80
[*]      #
[*]      #location ~ \.php$ {
[*]      #    proxy_pass   http://127.0.0.1;
[*]      #}       pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000       //开启这一段,因为nginx本身不支持php,需用用FastCGI模式支持php
[*]      
[*]      location ~ \.php$ {
[*]            root         html;
[*]            fastcgi_pass   127.0.0.1:9000;
[*]            fastcgi_index index.php;
[*]            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;      //修改web目录,默认为nginx下的html文件夹
[*]            include      fastcgi_params;
[*]      }      # deny access to .htaccess files, if Apache's document root
[*]      # concurs with nginx's one
[*]      #

心和尚 发表于 2011-10-10 23:47:13

顶.支持,路过!











static/image/common/sigline.gif
http://img165.poco.cn/mypoco/myphoto/20110919/10/6433722020110919102317027.jpg

遥望博岱 发表于 2011-10-14 11:28:01

真不错,赞一个,继续努力啊











static/image/common/sigline.gif

http://img2081.poco.cn/mypoco/myphoto/20110822/16/64165363201108221627279573116820626_005.jpg
页: [1]
查看完整版本: window下nginx+php配置安装篇