国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > 建站經驗 > 正文

win2003下nginx 0.8.38 安裝配置備忘

2019-11-02 16:16:57
字體:
來源:轉載
供稿:網友
據說 nginx 是這幾年來 Web 服務器的后起之秀,是“Apache殺手”,由俄羅斯程序員編寫。是一個輕量級的 Web 服務器,也是據說,占用資源少,高并發,在某些情況下,效率是 Apache 的 10 倍。國內外很多大型門戶站都在用。

經不住蠱惑,決定在 Windows Server 2003 下安裝試用一下,并與 PHP 進行集成。

截至 2010 年 5 月底,nginx 的最新版本是 0.8.38,可以到 http://www.nginx.org/ 下載。

解壓 PHP 到 C:/php-5.3.2-Win32-VC6-x86/,正確配置 php.ini 文件。

直接解壓下載的 nginx-0.8.38.zip 文件到 C:/nginx-0.8.38/,文件夾結構:

conf/

contrib/

docs/

html/

logs/

temp/

nginx.exe

雙擊運行nginx.exe文件,nginx 就開始提供服務。

html/ 文件夾為網站默認根目錄。

conf/ 放置 nginx 配置有關的文件。配置文件 nginx.conf 內容如下(#號打頭的語句被注釋掉了,可以參考):

server {……} 部分配制了 nginx 的 http 服務的端口(默認為80)、域名、字符集、根文件夾、首頁文件等內容。

其中以下部分配置 nginx 與 PHP 以 fastcgi 方式進行集成,“C:/nginx-0.8.38/html”表示網站的根文件夾:

復制代碼 代碼如下:

location ~ /.php$ {

# root html;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME C:/nginx-0.8.38/html$fastcgi_script_name;

include fastcgi_params;

}

#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 80;

server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;

location / {

root html;

index index.html index.htm;

autoindex on;

}

#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

#

location ~ /.php$ {

# root html;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME C:/nginx-0.8.38/html$fastcgi_script_name;

include fastcgi_params;
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 金坛市| 安远县| 马边| 张家口市| 景宁| 贡山| 镇安县| 弥渡县| 西畴县| 绥中县| 重庆市| 穆棱市| 巫溪县| 资中县| 江津市| 枞阳县| 象山县| 乌拉特后旗| 壶关县| 麻阳| 东阿县| 南郑县| 山东省| 黔江区| 左贡县| 怀柔区| 磐安县| 日照市| 南皮县| 葫芦岛市| 鄂尔多斯市| 新龙县| 房产| 临沧市| 东城区| 噶尔县| 江永县| 岳普湖县| 攀枝花市| 绍兴县| 汾西县|