日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

nginx在WIN下的配置和安裝 .

 唐僧0012 2012-09-14

1、首先到:http:///去下載最新的nginx/Windows,這里我用的版本是:nginx/Windows-0.8.9

 

2、下載下來(lái)后只需要解壓縮到任意地方即可;

 

3、然后配置好你的PHP;

 

配置PHP的時(shí)候需要注意一下幾個(gè)參數(shù)和APACHE的可能不太一樣:

cgi.force_redirect = 0

fastcgi.impersonate = 1

cgi.rfc2616_headers = 1

 

 

4、開(kāi)始配置/nginx/conf下的nginx.conf;

帖一下我的配置:


#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       88;
        #監(jiān)聽(tīng)88端口,可以隨意更改;
        server_name  localhost;

        charset utf-8;
        #設(shè)置服務(wù)器的字符集

        #access_log  logs/host.access.log  main;

        location / {
 #設(shè)置網(wǎng)站跟路徑;
 root   E:/root;
 #默認(rèn)網(wǎng)頁(yè)文件;
            index  index.html index.htm index.php;
 #如果沒(méi)有頁(yè)面的話,那么列出文件夾資源;
 autoindex on;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #設(shè)置錯(cuò)誤頁(yè)面;
        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
        #配置PHP最關(guān)鍵的地方:
        location ~ /.php$ {
            #root  E:/root;
 #配置監(jiān)聽(tīng)端口,需要和PHP-CGI的端口一樣;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
 #這個(gè)是設(shè)置路徑的,應(yīng)該和root一樣(我沒(méi)有試過(guò)不一樣什么效果);
            fastcgi_param  SCRIPT_FILENAME  E:/root$fastcgi_script_name;
 #fastcgi_param  SCRIPT_FILENAME  $fastcgi_script_name;
            include        fastcgi_params;
        }
    }


   }

5、設(shè)置完成以后在CMD中輸入:start nginx;

 

6、然后進(jìn)入PHP文件夾,輸入:php-cgi.exe -b 127.0.0.1:9000 ;

 

7、可以寫一下自己的重啟批處理命令:tskill nginx,start nginx;

 

OK,應(yīng)該就可以了。

分享到:

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多