最近两天的统计数据

forum.ubuntu.org.cn:
Day Number of visits Pages Hits Bandwidth
29 Oct 2009 52709 742839 3029890 53.63 GB
30 Oct 2009 55307 829387 3176592 61.16 GB

www.ubuntu.org.cn
Day Number of visits Pages Hits Bandwidth
29 Oct 2009 31518 156948 2991583 10.59 GB
30 Oct 2009 24986 117320 2749394 12.13 GB

linux.ubuntu.org.cn
Day Number of visits Pages Hits Bandwidth
29 Oct 2009 2375 5427 39918 475.52 MB
30 Oct 2009 2134 4631 39601 405.56 MB

wiki.ubuntu.org.cn
Day Number of visits Pages Hits Bandwidth
29 Oct 2009 11297 95952 377625 2.78 GB
30 Oct 2009 14495 135039 521981 4.01 GB

第一次这么高

值得欣慰
ubuntu.org.cn - Site Info from Alexa_1256738451106

做了两项调整

1 论坛的关键词过滤使用囗代替
update phpbb_words set replacement=lpad(”,char_length(word),’囗’) ;

2 由于nginx经常出现500错误,做了轮询
$ cat conf.d/backend.conf
upstream backend {
ip_hash;
server 127.0.0.1:10080;
server 127.0.0.1:10081;
}

location ~ .*\.php?$ {
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_pass backend;
}

测试 raw 标签

需要先启用 Raw HTML capability 插件。

编辑效果:
编辑效果

实际显示效果:

短信标题: Re: blog没插入html代码的地方了?
发件人: eexpress

写了一个小脚本,专门删除垃圾blog的

  1. #!/usr/bin/python
  2. import MySQLdb
  3. db=MySQLdb.connect(host="localhost",user="root",pass="********",db="blog")
  4. c=db.cursor()
  5. c.execute("show tables;")
  6. rows=c.fetchall()
  7.  
  8. extblogs=[2821,2753,2746,2630,2619,2615,2601,2593,2373,2197,2172,2171,2101,2100,2099]
  9.  
  10. c.execute("select blog_id,domain from wp_blogs order by registered desc limit 1000;")
  11. blogrows=c.fetchall()
  12. for blogrow in blogrows:
  13.     blog=blogrow[0]
  14.     if blog in extblogs:
  15.        continue
  16.     ext='wp_'+str(blog)+'_'
  17.     for row in rows:
  18.         tablename= row[0]
  19.         if tablename.find(ext) != 0:
  20.              continue
  21.         sql= "drop table " + tablename+" ;"
  22.         print sql
  23.         c.execute(sql)
  24.     sql= "delete from wp_blogs where blog_id=" + str(blog) + " ;"
  25.     print sql
  26.     c.execute(sql)

并关闭了curl对blog的访问。

76.0.32.28 – - [19/Jul/2009:21:20:11 +0800] “POST /wp-signup.php HTTP/1.1″ 500 193 “-” “curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3″
76.0.32.28 – - [19/Jul/2009:21:20:24 +0800] “POST /wp-signup.php HTTP/1.1″ 500 193 “-” “curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3″
65.75.242.220 – - [19/Jul/2009:21:26:45 +0800] “GET /wp-activate.php?key=b592a7ba6f75e1f4 HTTP/1.1″ 500 193 “-” “curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3″
65.75.242.220 – - [19/Jul/2009:21:26:46 +0800] “GET /wp-activate.php?key=b592a7ba6f75e1f4 HTTP/1.1″ 500 193 “-” “curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3″
173.74.81.24 – - [19/Jul/2009:21:34:17 +0800] “POST /wp-signup.php HTTP/1.1″ 500 193 “-” “curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3″
173.74.81.24 – - [19/Jul/2009:21:34:21 +0800] “POST /wp-signup.php HTTP/1.1″ 500 193 “-” “curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3″
65.75.242.220 – - [19/Jul/2009:21:39:39 +0800] “POST /wp-signup.php HTTP/1.1″ 500 193 “-” “curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3″
65.75.242.220 – - [19/Jul/2009:21:39:42 +0800] “POST /wp-signup.php HTTP/1.1″ 500 193 “-” “curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3″
76.0.32.28 – - [19/Jul/2009:21:47:18 +0800] “POST /wp-signup.php HTTP/1.1″ 500 193 “-” “curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3″
76.0.32.28 – - [19/Jul/2009:21:47:25 +0800] “POST /wp-signup.php HTTP/1.1″ 500 193 “-” “curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3″
86.164.174.120 – - [19/Jul/2009:21:51:39 +0800] “POST /wp-signup.php HTTP/1.1″ 500 193 “-” “curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3″
86.164.174.120 – - [19/Jul/2009:21:51:41 +0800] “POST /wp-signup.php HTTP/1.1″ 500 193 “-” “curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3″

写了一个小Python程序,专门删除垃圾留言的

  1. #!/usr/bin/python
  2. import MySQLdb
  3. db=MySQLdb.connect(host="localhost",user="root",pass="********";db="blog")
  4. c=db.cursor()
  5. c.execute("show tables;")
  6. rows=c.fetchall()
  7. keys=['bracketball','.xbox360','showuser','member.php','Cialis','spreadfirefox','bloggersunite','members','orthodontics','freehostia','k2free','aokhost','hostrator','007webs','ucsusa.org','idaho.gov','club.com','kenru.net','boston','macworld','gamespot','release.com','squidoo','free-press','time.com','times.com','agu.org','encora.eu','colomar.com','journals','western','kaboodle','alternet.org','breiling.org','insidecancer','newstribune','packers','kjzz','magazine','lcace','troctr','trocc','relallet','dronp','web.com','geoexpro','trdrond','plastver','paserla','world66','.ac.at','.ac.nz','osputos','tramadol','omegaseye','t35.com','freewebhostx','viagra','xanax','online.com','action.org','host.com','425mb.com','narod.ru','phentermine','investordom.com','msstete.edu','.int','fandm.edu','harvard.edu','nature.com','csa.com','nas.edu','advisor.com','board.com','linkedin.com','livelylatin','propecia','photo.com','typepad.com','optus.nu','dyndns.dk','h1x.com','fuel.tv','yogamates','ironruby','.es/','.mil/','>Buy','Nice site','Great site','Perfect work']
  8. for row in rows:
  9.     tablename= row[0]
  10.     if tablename[-8:]=='comments':
  11.         for key in keys:
  12.             sql= "delete from " + tablename + " where comment_content like '%" +key+"%' "
  13.             print sql
  14.             c.execute(sql)

测试了一下性能,采用nginx了,代替以前的lighttpd

折腾了一个晚上基本上完成由lighttpd向nginx的迁移,lighttpd的负载太让人失望了。

为论坛phpbb3开启了apc缓存

从这里下载 http://code.phpbb.com/repositories/entry/phpbb/trunk/phpBB/includes/acm/acm_apc.php acm_apc.php 放到 includes/acm 目录下。

然后编辑根目录下的config.php修改为:$acm_type = ‘apc’;

这里有个问题,acm_apc.php 使用了phpbb::$db ,这个会出现 Fatal error: Class ‘phpbb’ not found 的异常,
将函数
function sql_save($query, &$query_result, $ttl)
的第一行,增加:
global $db;

并找到两处的phpbb::$db修改为$db。

大功告成。

将php加速器由xcache更换到apc

  1. $ cat /etc/php5/conf.d/apc.ini
  2. extension=apc.so
  3.  
  4. apc.enabled=1
  5. apc.shm_segments=1
  6. apc.shm_size=128
  7. apc.ttl=7200
  8. apc.user_ttl=7200
  9. apc.num_files_hint=1024
  10. apc.mmap_file_mask=/tmp/apc.XXXXXX
  11. apc.enable_cli=1

希望速度快一点。

Blog升级到了2.8.1,同时修正了500的错误

错误的原因是php本身的bug:

https://bugs.launchpad.net/ubuntu/+source/php5/+bug/294179

这个错误,ubuntu由于为了保证php版本不升级,所以该错误一直存在得不到修复。
我这边手工升级php5 从 5.2.4 到了 5.2.6。问题不再出现:

PHP 5.2.6-3ubuntu4.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 23 2009 14:37:14)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with XCache v1.2.2, Copyright (c) 2005-2007, by mOo

当然这个也和wpmu的复杂架构有关。

中文语言包来源: http://www.wpcng.com/

下一页 »