存档

‘linux’ 分类的存档

nginx 的配置

2008年11月22日

加入了php的支持,nginx使用的是fastcgi。

我使用的是centos5.2系统,其中已经通过yum安装了php,因为不想再自己重新编译了就采用spawn-fcgi的方式来做fastcgi,spawn-fcgi包含在lighttpd,

wget lighttpd

./configure;

make;

cp src/spawn-fcgi /usr/bin/spawn-fcgi

spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 -u nobody -g nobody -f /usr/bin/php-cgi

加入开机启动

nginx 配置

加入了rewrite来做永久链接

server {
listen 222.132.76.204:80;
server_name www.wangjian.info;
access_log  /export/hd1/weblog/gpsview.access.log  main;

location / {
root /export/hd1/web/blog/;
index index.php;

if (-f $request_filename/index.html){
   rewrite (.*) $1/index.html break;

if (-f $request_filename/index.php){
   rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
   rewrite (.*) /index.php;
}
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /export/hd1/web/blog$fastcgi_script_name;
include fastcgi_params;
}
}
}

OK了,经过感觉,速度好像是快了点。继续测试中。

linux, 我的网站 , , ,

Vmare ESX 下centos的安装

2008年11月21日

在虚拟机安装了centos,由于他虚拟的Inter e1000的网卡不支持centos(虽然支持red hat e5),只能用较低级的100M网卡了。

配置mysql和apache,原来很简单的事情,重装了N遍配置了半天都有问题,权限的问题,最后找到了原来是SElinux 的问题,关闭后完全没问题。这和vista的UCA一样自己找自己的麻烦,虽然有时候也挺有用的。

nginx,原来在SUN服务器上装了nginx,为了验证esx虚拟机的稳定、强壮决定把nginx装到linux里,测试一下虚拟机在大访问量下的性能。

centos自带的pcre版本比较低,自己装一个吧

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.8.tar.gz

编译参数:

./configure –with-poll_module –with-http_ssl_module –with-http_realip_module –with-http_flv_module –with-http_stub_status_module

linux, 我的网站 , ,