域名的8种状态

1、 ACTIVE:活动状态。由Registry设置;该域名可以由Registrar更改;可以续费;至少被指派一个DNS。

2、 REGISTRY-LOCK:注册局锁定。由注册局设置;该域名不可以由注册商更改、删除;必须由注册局解除此状态才可以由注册商更改域名信息;域名可以续费;如果域名被指派至少一个DNS则可以包含在(域名根服务器)的区域中(可以正常使用)。

3、 REGISTRY-HOLD:注册局保留。由注册局设置;该域名不可以由注册商更改、删除;必须由注册局解除此状态才可以由注册商更改域名信息;域名可以续费;该域名不包括在(域名根服务器)的区域中(不能正常使用)。

4、 REGISTRAR-LOCK:注册商锁定。由该域名的原始注册商设置;该域名不可以被更改或删除;必须由注册商解除此状态才可以更改域名信息;该域名可以续费。该域名包含在(域名根服务器)的区域中(可以正常使用)。

5、 REGISTRAR-HOLD:注册商保留。由该域名的原始注册商设置;该域名不可以被更改或删除;必须由注册商解除此状态才可以更改域名信息;该域名可以续费。该域名不包括在(域名根服务器)的区域中(不能正常使用)。

6、 REDEMPTIONPERIOD:宽限期。当注册商向注册局提出删除域名请求后,由注册局将域名设置称此状态,不过,条件是该域名已经注册了5天以上(如果该域名注册时间不足5天,则立即删除);该域名不包括在(域名根服务器)的区域中(不能正常使用);该域名不可以被更改或清除,只可以被恢复;任何其他注册商提出对此域名的更改或其他请求都将被拒绝;该状态最多保持30天。

7、 PENDINGRESTORE:恢复未决。当注册商提出将处于REDEMPTIONPERIOD的域名恢复请求后,由注册局设置;该域名包含在(域名根服务器)的区域中(可以正常使用);注册商提出的更改或任何其他请求都将被拒绝;在7天之内,有注册商向注册局提供必需的恢复文件,如果注册商在7天之内提供了这些文件,该域名将被置为ACTIVE状态,否则,该域名将重新返回到REDEMPTIONPERIOD状态。

8、 PENDINGDELETE:删除未决。如果一个域名在被设置成REDEMPTIONPERIOD状态期间内,注册商没有提出恢复请求,那么,域名将被置于PENDINGDELETE状态,注册商对此域名的任何请求都将被拒绝;5天之后清除。

Tags:

星期四, 25 3 月, 2010 Web 没有评论

Google.cn已经302去香港了

3月23日消息,据国外媒体报道,谷歌周一宣布,已正式关闭中国内地网站Google.cn,同时将用户重新定向到谷歌香港网站。

 北京时间3月23日凌晨3时零3分,谷歌公司高级副总裁、首席法律官大卫·德拉蒙德公开发表声明,再次借黑客攻击问题指责中国,宣布停止对谷歌中国搜索服务的“过滤审查”,并将搜索服务由中国内地转至香港。

谷歌称:“履行我们不再对Google.cn进行审查的承诺很难,我们希望全世界尽可能多的网民访问到我们的服务,其中包括中国内地用户。但是,在整个谈判过程中,中国政府的态度很明确,自我审查是一个不可商量的法律规定。”

谷歌表示:“我们相信,这种通过谷歌香港网站(Google.com.hk)提供未经审查的简体中文搜索服务的做法是可行的,而且完全合法,将在很大程度上提升中国网民所访问的信息量。”

谷歌还表示:“我们十分希望中国政府能够尊重我们的决定。”另外,关闭Google.cn网站后,谷歌在内地的研发和销售团队将予以保留。

受该决定影响,谷歌在内地的一部分员工可能将失业,但知情人士称,大部分员工仍将继续为香港网站Google.com.hk服务。

google跳转

bear@bear-laptop:~$ curl -I www.g.cn

HTTP/1.1 301 Moved Permanently

Location: http://www.google.cn/webhp?source=g_cn

Date: Tue, 23 Mar 2010 03:51:48 GMT

Expires: Tue, 23 Mar 2010 03:51:48 GMT

Cache-Control: private, max-age=2592000

Content-Type: text/html; charset=UTF-8

Server: gws

Content-Length: 235

X-XSS-Protection: 0

google302去香港了,不是301,哈哈

bear@bear-laptop:~$ curl -I www.google.cn

HTTP/1.1 302 Found

Location: http://www.google.com.hk/url?sa=p&cki=PREF%3DID%3Dd83b4d507eefd755:FF%3D2:LD%3Dzh-CN:NW%3D1:TM%3D1269316321:LM%3D1269316321:S%3DGFQBLG4qIPsWAO51&q=http://www.google.com.hk/&ust=1269316351043237&usg=AFQjCNERVTkZUumndQ1a34tTuFj4UFHGcw

Cache-Control: private

Content-Type: text/html; charset=UTF-8

Set-Cookie: PREF=ID=d83b4d507eefd755:NW=1:TM=1269316321:LM=1269316321:S=rcWSYLH01KNeQF_W; expires=Thu, 22-Mar-2012 03:52:01 GMT; path=/; domain=.google.cn

Set-Cookie: NID=33=h6A0wWWNC8Lv83l8JJzytNn7No3_LZ_vsJvYRPdOW6Hxvye_kwKOS3XRm5jPFvgACIiQ7lLsA_-9QjFbQo2OEqyiUzM7GtqkwMB8BUh6WS6WIFkSoggDjgUKulmrp1EW; expires=Wed, 22-Sep-2010 03:52:01 GMT; path=/; domain=.google.cn; HttpOnly

Date: Tue, 23 Mar 2010 03:52:01 GMT

Server: gws

Content-Length: 445

X-XSS-Protection: 0


bear@bear-laptop:~$ date
2010年 03月 23日 星期二 11:52:39 CST

Tags: ,

星期二, 23 3 月, 2010 Web 没有评论

给ubuntu9.10下的nginx安装nagios监控

1 开权限

root@njava:~# sudo -s
root@njava:~# useradd -m -s /bin/bash nagios
root@njava:~# passwd nagios
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
root@njava:~# groupadd nagios
groupadd: group 'nagios' already exists
root@njava:~# usermod -G nagios nagios
root@njava:~# groupadd nagcmd
root@njava:~# usermod -a -G nagcmd nagios
root@njava:~# usermod -a -G nagcmd www-data
root@njava:~# 

2 下软件

root@njava:~# axel http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.1.tar.gz
root@njava:~# axel http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.14.tar.gz
root@njava:~# tar -xzvf nagios-3.2.1.tar.gz 

3 编译设置

root@njava:~# cd nagios-3.2.1
root@njava:~/nagios-3.2.1# ./configure --with-command-group=nagcmd
root@njava:~/nagios-3.2.1# make all
root@njava:~/nagios-3.2.1# make install
root@njava:~/nagios-3.2.1# make install-init
root@njava:~/nagios-3.2.1# make install-config
root@njava:~/nagios-3.2.1# make install-commandmode

4 安装apache配置,对nagios无用

root@njava:~/nagios-3.2.1# make install-webconf

5 配置nginx

root@njava:~/nagios-plugins-1.4.14# cat /etc/nginx/sites-available/nagios 
server {
	listen   80;
	server_name nagios.njava.com;
        
	access_log  /var/log/nginx/nagios.access.log;

	location / {
		root   /usr/local/nagios/share;
		index  index.php;
        }

        location ~ \.php$ {
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                set $path_info "/";
                set $real_script_name $fastcgi_script_name;
                if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
                    set $real_script_name $1;
                    set $path_info $2;
                }
               fastcgi_param SCRIPT_FILENAME /usr/local/nagios/share/$real_script_name;
               fastcgi_param script_name $real_script_name;
               fastcgi_param path_info $path_info;
               include /etc/nginx/fastcgi_params;
        }
       location /nagios/images {
                alias /usr/local/nagios/share/images;
        }
                   
        location /nagios/stylesheets {
                alias /usr/local/nagios/share/stylesheets;
          }


         location /cgi-bin {
                 alias /usr/local/nagios/sbin;

    }

    location ~ \.cgi$ {

        root           /usr/local/nagios/sbin;

        rewrite ^/cgi-bin/(.*)\.cgi /$1.cgi break;

        fastcgi_index  index.cgi;

        fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;

        include        nginx_fcgi_params;

        fastcgi_read_timeout    5m;

        fastcgi_pass   unix:/var/run/nginx-fcgi.sock;

    }

6 安装Nagios Plugins

root@njava:~# tar -xzvf nagios-plugins-1.4.14.tar.gz
root@njava:~# cd nagios-plugins-1.4.14
root@njava:~/nagios-plugins-1.4.14# ./configure --with-nagios-user=nagios --with-nagios-group=nagios
...
...            --with-apt-get-command: /usr/bin/apt-get
              --with-ping6-command: /bin/ping6 -n -U -w %d -c %d %s
               --with-ping-command: /bin/ping -n -U -w %d -c %d %s
                       --with-ipv6: yes
                      --with-mysql: no
                    --with-openssl: yes
                     --with-gnutls: no
               --enable-extra-opts: no
                       --with-perl: /usr/bin/perl
             --enable-perl-modules: no
                     --with-cgiurl: /nagios/cgi-bin
               --with-trusted-path: /bin:/sbin:/usr/bin:/usr/sbin
                   --enable-libtap: no
root@njava:~/nagios-plugins-1.4.14# make && make install

7 启动nagios相关设置

root@njava:~/nagios-plugins-1.4.14# ln -s /etc/init.d/nagios /etc/rcS.d/
S99nagios

9 nagios设置
用户登录验证

root@njava:~/nagios-plugins-1.4.14#vi /usr/local/nagios/etc/cgi.cfg
    use_authentication=0

CGI工作目录

root@njava:~/nagios-plugins-1.4.14#vi /usr/local/nagios/share/config.inc.php
$cfg['cgi_base_url']='/cgi-bin';

8 效验nagios执行nagios

root@njava:~/nagios-plugins-1.4.14# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Things look okay - No serious problems were detected during the pre-flight check
root@njava:~/nagios-plugins-1.4.14# /etc/init.d/nagios start

参考:
1 http://nagios.sourceforge.net/docs/3_0/quickstart-ubuntu.html

Tags: , , ,

星期一, 22 3 月, 2010 服务器 没有评论

Nginx0.8.34 支持 CGI

1 安装FCGI

root@njava:~# wget http://www.cpan.org/modules/by-module/FCGI/FCGI-0.67.tar.gz
root@njava:~# tar -zxf FCGI-0.67.tar.gz
root@njava:~#cd FCGI-0.67
root@njava:~/FCGI-0.67#  perl Makefile.PL
root@njava:~/FCGI-0.67#  make && make install
root@njava:~/FCGI-0.67#  cd ..

2 安装FCGI-ProcManager

root@njava:~# wget http://search.cpan.org/CPAN/authors/id/G/GB/GBJK/FCGI-ProcManager-0.18.tar.gz
root@njava:~#tar -zxf FCGI-ProcManager-0.18.tar.gz
root@njava:~#cd FCGI-ProcManager-0.18
root@njava:~/FCGI-ProcManager-0.18#perl Makefile.PL
root@njava:~/FCGI-ProcManager-0.18#make && make install
root@njava:~/FCGI-ProcManager-0.18#cd ..

3 安装IO-ALL

root@njava:~#wget http://search.cpan.org/CPAN/authors/id/I/IN/INGY/IO-All-0.39.tar.gz
root@njava:~# tar zxf IO-All-0.39.tar.gz
root@njava:~#cd IO-All-0.39
root@njava:~/IO-All-0.39# perl Makefile.PL
root@njava:~/IO-All-0.39# make && make install

4 安装nginx-fcgi脚本

root@njava:~#wget http://www.nginx.eu/nginx-fcgi/nginx-fcgi.txt
root@njava:~#mv nginx-fcgi.txt /usr/sbin/nginx-fcgi
root@njava:~# chmod +x /usr/sbin/nginx-fcgi

不以root权限执行脚本,注释nginx-fcgi

#if ( $> == "0" ) {
#        print "\n\tERROR\tRunning as a root!\n";
#        print "\tSuggested not to do so !!!\n\n";
#       exit 1;
#}

5启动nginx-fcgi

nginx-fcgi -l /var/log/nginx/nginx-fcgi.log -pid /var/run/nginx-fcgi.pid -S /var/run/nginx-fcgi.sock
chown www-data:www.data /var/run/nginx-fcgi.sock

注意nginx-fcgi.sock的权限让nginx的执行账户有权读写
6 复制fastcgi_params一份用来设置nginx_fcgi_params

root@njava:~#cp /etc/nginx/fastcgi_params /etc/nginx/nginx_fcgi_params
root@njava:~#vi /nginx/nginx_fcgi_params
#fastcgi_param  REDIRECT_STATUS    200;

7 代理cgi设置

    server {
        listen       80;
        server_name  njava.com;

        location ~ ^/cgi-bin/.*\.cgi$
        {
            root           /home/bear/njava/test;
            fastcgi_index  index.cgi;
            fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
            include        nginx_fcgi_params;
            fastcgi_read_timeout    5m;
            fastcgi_pass   unix:/var/run/nginx-fcgi.sock;
        }
    }

8 完工

Tags: ,

星期一, 22 3 月, 2010 服务器 没有评论

discuz在Nginx0.8.34下的伪静态规则

discuz论坛在Nginx下的rewrite规则,修改完后restart nginx

bear@bear-laptop:/etc/nginx/sites-available$ vi bbs.njava 
server {
        listen   80;
        server_name bbs.njava.com;

        access_log  /var/log/nginx/bbs.njava.access.log;

        location / {
            root /home/bear/Sites/bbs.njava;
            index index.html index.htm index.php;

            rewrite ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)$ $1/archiver/index.php?$2 last;
            rewrite ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay.php?fid=$2&page=$3 last;
            rewrite ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread.php?tid=$2&extra=page%3D$4&page=$3 last;
            rewrite ^(.*)/profile-(username|uid)-(.+)\.html$ $1/viewpro.php?$2=$3 last;
            rewrite ^(.*)/space-(username|uid)-(.+)\.html$ $1/space.php?$2=$3 last;
            rewrite ^(.*)/tag-(.+)\.html$ $1/tag.php?name=$2 last;    
          }

        location ~ \.php$ {
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                set $path_info "/";
                set $real_script_name $fastcgi_script_name;
                if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
                    set $real_script_name $1;
                    set $path_info $2;
                  }
               fastcgi_param SCRIPT_FILENAME /home/bear/Sites/bbs.njava/$real_script_name;
               fastcgi_param script_name $real_script_name;
               fastcgi_param path_info $path_info;
               include /etc/nginx/fastcgi_params;
         }
}

Tags: , ,

星期一, 22 3 月, 2010 服务器 没有评论

nginx 0.8.34以fastcgi方式运行php

1 安装spawn-fcgi

bear@bear-laptop:~$sudo apt-get install php5-cli php5-cgi php5-xcache build-essential
bear@bear-laptop:~$ sudo apt-get install  spawn-fcgi

很多地方都说要先安装lighttpd,不用这样,可以直接安装 spawn-fcgi
2 增加fastcgi控制脚本

bear@bear-laptop:/usr/bin$ sudo vi /etc/init.d/php-fastcgi
#!/bin/bash
SCRIPT=/usr/bin/spawn-fcgi
NAME=php-fastcgi
DESC=Spawn-fcgi

case "$1" in
    start)
	echo -n "Starting $DESC: " 
	$SCRIPT -a 127.0.0.1 -p 9000 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/$NAME.pid|| true
	echo "$NAME."
;;
    stop)
      echo -n "Stopping $DESC: "
      killall -9 php5-cgi
      echo "$NAME."
;;
    restart)
       echo -n "Stopping $DESC: "
	killall -9 php5-cgi
	sleep 1
       echo  "Starting $DESC: " 
     	$SCRIPT -a 127.0.0.1 -p 9000 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/$NAME.pid|| true
	echo  "$DESC."
;;
*)
      echo "Usage: $NAME {start|stop|restart}"
      exit 1
;;
esac
exit 0

3 开机启动

bear@bear-laptop:/usr/bin$ sudo gedit /etc/rc.local
/etc/init.d/php-fastcgi start

Tags: , , ,

星期一, 22 3 月, 2010 服务器 没有评论

ubuntu9.10安装nginx0.8.34

源里的是nginx0.7.62,决定把他升级到nginx0.8.34

1 卸载nginx0.7.62

bear@bear-laptop:~/$ sudo apt-get remove nginx

2 安装编译环境

bear@bear-laptop:~/soft/nginx-0.8.34$ sudo sudo apt-get install build-essential libpcre3-dev libssl-dev libxslt-dev libgd2-xpm-dev libgeoip-dev

4 下载nginx0.8.34

bear@bear-laptop:~/soft$ axel http://nginx.org/download/nginx-0.8.34.tar.gz
bear@bear-laptop:~/soft$ tar -xzvf nginx-0.8.34.tar.gz

5 下载upstream fair 模块

bear@bear-laptop:~/soft$ wget http://github.com/gnosek/nginx-upstream-fair/tarball/master
bear@bear-laptop:~/soft$ tar -xzvf gnosek-nginx-upstream-fair-2131c73.tar.gz

6 编译

bear@bear-laptop:~/soft$ cd nginx-0.8.34/
bear@bear-laptop:~/soft/nginx-0.8.34$ ./configure --conf-path=/etc/nginx/nginx.conf \--error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug --with-http_stub_status_module --with-http_flv_module --with-http_ssl_module --with-http_dav_module --with-http_gzip_static_module --with-mail --with-mail_ssl_module --with-ipv6 --with-http_realip_module --with-http_geoip_module --with-http_xslt_module --with-http_image_filter_module --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --add-module=../gnosek-nginx-upstream-fair-2131c73

....

...

Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ using sha1 library: /usr/include/openssl
+ using system zlib library

nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx configuration prefix: "/etc/nginx"
nginx configuration file: "/etc/nginx/nginx.conf"
nginx pid file: "/var/run/nginx.pid"
nginx error log file: "/var/log/nginx/error.log"
nginx http access log file: "/var/log/nginx/access.log"
nginx http client request body temporary files: "/var/lib/nginx/body"
nginx http proxy temporary files: "/var/lib/nginx/proxy"
nginx http fastcgi temporary files: "/var/lib/nginx/fastcgi"

bear@bear-laptop:~/soft/nginx-0.8.34$ make

bear@bear-laptop:~/soft/nginx-0.8.34$ sudo make install
make -f objs/Makefile install
make[1]: 正在进入目录 `/home/bear/soft/nginx-0.8.34'
test -d '/usr/local/nginx' || mkdir -p '/usr/local/nginx'
test -d '/usr/local/nginx/sbin'         || mkdir -p '/usr/local/nginx/sbin'
test ! -f '/usr/local/nginx/sbin/nginx'         || mv '/usr/local/nginx/sbin/nginx'             '/usr/local/nginx/sbin/nginx.old'
cp objs/nginx '/usr/local/nginx/sbin/nginx'
test -d '/etc/nginx'         || mkdir -p '/etc/nginx'
cp conf/koi-win '/etc/nginx'
cp conf/koi-utf '/etc/nginx'
cp conf/win-utf '/etc/nginx'
test -f '/etc/nginx/mime.types'         || cp conf/mime.types '/etc/nginx'
cp conf/mime.types '/etc/nginx/mime.types.default'
test -f '/etc/nginx/fastcgi_params'         || cp conf/fastcgi_params '/etc/nginx'
cp conf/fastcgi_params         '/etc/nginx/fastcgi_params.default'
test -f '/etc/nginx/fastcgi.conf'         || cp conf/fastcgi.conf '/etc/nginx'
cp conf/fastcgi.conf '/etc/nginx/fastcgi.conf.default'
test -f '/etc/nginx/nginx.conf'         || cp conf/nginx.conf '/etc/nginx/nginx.conf'
cp conf/nginx.conf '/etc/nginx/nginx.conf.default'
test -d '/var/run'         || mkdir -p '/var/run'
test -d '/var/log/nginx' ||         mkdir -p '/var/log/nginx'
test -d '/usr/local/nginx/html'         || cp -r html '/usr/local/nginx'
test -d '/var/log/nginx' ||         mkdir -p '/var/log/nginx'
make[1]:正在离开目录 `/home/bear/soft/nginx-0.8.34'
bear@bear-laptop:~/soft/nginx-0.8.34$

7 修改 /etc/init.d/nginx 脚本

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/nginx/sbin/nginx
NAME=nginx
DESC=nginx

test -x $DAEMON || exit 0

# Include nginx defaults if available
if [ -f /etc/default/nginx ] ; then
. /etc/default/nginx
fi

set -e

. /lib/lsb/init-functions

test_nginx_config() {
if /usr/local/nginx/sbin/nginx -t
then
return 0
else
return $?
fi
}

8 update-rc脚本

sudo update-rc.d -f nginx defaults

9 over

Tags: ,

星期一, 22 3 月, 2010 服务器 没有评论

给ubuntu9.10的fastcgi方式的php增加eaccelerator0.9.6加速

1 安装编译环境

root@njava:~# sudo apt-get install build-essential php5-dev

2 安装eaccelerator

root@njava:~# axel http://bart.eaccelerator.net/source/0.9.6/eaccelerator-0.9.6.tar.bz2
root@njava:~# tar -xjvf eaccelerator-0.9.6.tar.bz2
root@njava:~#cd eaccelerator-0.9.6.tar.bz2
root@njava:~#sudo /usr/bin/phpize
root@njava:~/eaccelerator-0.9.6# ./configure -enable-eaccelerator=shared -with-php-config=/usr/bin/php-config
root@njava:~/eaccelerator-0.9.6# make
root@njava:~/eaccelerator-0.9.6# make install
Installing shared extensions:     /usr/lib/php5/20060613+lfs/
root@njava:~/eaccelerator-0.9.6# mkdir /tmp/eaccelerator
root@njava:~/eaccelerator-0.9.6# chmod 777 /tmp/eaccelerator/
root@njava:~/eaccelerator-0.9.6# vi /etc/php5/conf.d/eaccelerator
[eaccelerator]
zend_extension="/usr/lib/php5/20060613+lfs/eaccelerator.so"
#extension="eaccelerator.so"
eaccelerator.shm_size="128"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="300"
eaccelerator.shm_prune_period="120"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

Tags: , ,

星期日, 21 3 月, 2010 Web 没有评论

nginx-0.8.34配置ZendOptimizer-3.3.9

ubuntu9.10下把apache2干掉了,代码编译安装0.8.34,php以fastcgi方式运行,配置ZendOptimizer的方法

root@njava:~# axel http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
root@njava:~# cp ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp/ZendOptimizer.so  /usr/lib/php5/20060613+lfs/
root@njava:~# vi /etc/php5/cgi/conf.d/zendoptimizer.ini
extension=ZendOptimizer.so
:wq

root@njava:~# /etc/init.d/nginx restart

64位的地址

root@njava:~# axel http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz

Tags: ,

星期日, 21 3 月, 2010 服务器 没有评论

nginx的301跳转

今天把vps上的apache换成了nginx,需要对wordpress进行了301重定向,把www.njava.com和njava.com进行合并,通过判断nginx核心变量host来实现:

server {
server_name www.njava.com njava.com ;
if ($host != 'www.njava.com' ) {
rewrite ^/(.*)$ http://www.njava.com/$1 permanent;
}

Tags: ,

星期六, 20 3 月, 2010 服务器 没有评论
1LMooBmUE153Wnd3zDryWvDyXxQudbFxDr