Welcome to Rolland Town which Record fire's life.
2009年04月18日代码生活

评论关闭

phatfusion.net_multibox

  multibox肯定是个好东西。但是如果使用时忽略如下第二行,页面就会报错。

HTML语言: multibox
1 <a id="mb8" class="mb" href="/video.flv" rel="type:flv,width:480,height:360">
2 <div class="multiBoxDesc mb8">my description</div>

  这个错误不影响浏览,在FireFox中从错误控制台可以看到错误-this.contentToLoad.desc.injectInside is not a function,IE则双击状态栏后看到“对象不支持此属性或方法”。仔细查看了multibox.js文件,发现作者在code时就要求每个展示对象都需要一个描述。如果没有这个描述就会这样。尝试更改整个代码结构,无功而返。给作者写了封mail,希望下个版本修正吧。其实也不算多大的错误。整个中文站点信息中都没有搜索到类似的问题信息,遂记录下来备查。

  另外http://www.open-open.com/也是个很好的资源站,推荐一下。

高校web应用系统架构(一)——浅议Sqiud等存在的可能

  先说说高校内web应用的现状。

  首先,学校官方主页肯定是由类似网管中心等部门制作,校内其他部门负责内容的更新。从技术层面来说这应该是学校技术力量的最强面,因此不管从应用的设计和编码,可能都高于其他校内二级部门网站。而校内其他二级部门网站往往都是各部门自己制作,可能会有熟悉的老师来设计。也许多数都是找勤工助学的学生制作占多数。当然上面所说到的只是一个基本情况,也有例外(不过已经是过去时了)。

  那么用Sqiud这样的软件建一个cache-pool显得没有必要。因为可能只有学校的主页才生成了静态页面,而其他二级部门网站可能都是动态的脚本。cache-pool也就仅仅只能缓存css、图片和js了。再加上访问量也不大,兴许就一个普通的PC就能支持。退一步来讲,就算整个学校统一规划,将学校的所有部门网站全盘考虑,制作成一个大型的管理平台,各个部门各有特色的页面,那就很有可能都会生成静态的页面。但是对于各部门来讲也许不满意,因为需求不停的有变化,或者说审美有变化,那么维护和制作这样一个平台的部门就有的忙了。就算这样实现之后,建立cache-pool?还是显得没有必要。毕竟对于高校的站点,对内对外来说一天都不可能超过500w的ipview(这个不好估计,随便写了一个)。记得2002年那会儿,电子科技大学好像就做了一个这样的平台,但是各部门都是统一的样式,只是配色不同。刚才翻看了一下,已经不存在了,又是各个部门百花齐放的状态。

  上面仅仅说到了高校对外的应用。那么对内的应用呢?比如OA、教务系统、财务系统、人事系统呢?更没必要。这些往往都是需要先登录方能使用。对于这样的应用cache-pool更是无用无之地。但是随着数字化校园的推动。各式各样的系统都会在统一的数据中心上做一个数据抽取。也就是说数据中心将各个系统可以公开查询的数据抽取出来,生成相应的页面,供校内师生员工查看。倘若这样的页面是静态的,倘若对于这样的数据展示页面有很大的访问量,那么cache-pool就有存在的理由了。如果学校对硬件投入不是很大,那么用一台普通的pcserver架一个cache-pool,如果按照Squid所说每G磁盘空间需要32M内存来算,16G的内存将会缓存512G的数据。足够满足校内大数据量访问的要求。关键是需要通过实际的测试来证明是否需要这样的cache-pool。

  写了这么多,感觉都是废话,不过既然写了,就算整理自己的思路吧。

2009年04月8日代码生活

评论关闭

sun4v下安装Nginx

  清明期间看到大鱼儿写的Nginx并发逼近1万大关,想想学校的教务系统的web端,应该也可以用到Nginx。因为之前用Apache加载resin来做的负载均衡,但是偶尔会出现登录后500的错误,百思不得其解,但是只要刷新一下就好了。所以后来放弃了用Apache加载resin做负载均衡。所以看了大鱼儿的blog就跃跃欲试。

  1、服务器是sun4v系列的,查看了官方的说明可以支持,直接下载了稳定版。

  2、由于自己只是做一个负载均衡,不需要其他一些模块,所以连PCRE我也放弃了。

  3、需要gcc或者其他来编译,操作系统没装,我就去down了个gcc回来。

  准备工作就绪,把包传到服务器上去。开工。

# gunzip gcc-3.4.6-sol10-sparc-local.gz
# pkgadd -d ./gcc-3.4.6-sol10-sparc-local
# gunzip libiconv-1.11-sol10-sparc-local.gz
# pkgadd -d ./libiconv-1.11-sol10-sparc-local
# PATH=$PATH:/opt/gnome/bin:/usr/local/bin:/opt/netscape:/usr/ccs/bin
# exprot PATH
# gzip -d nginx-0.6.36.tar.gz
# tar xvf nginx-0.6.36.tar
# ./configure –without-http_rewrite_module –user=webadmin –group=webadmin –with-http_stub_status_module
checking for OS
 + SunOS 5.10 sun4v
checking for C compiler … found
 + using GNU C compiler
 + gcc version: 3.4.6
checking for gcc -pipe switch … found
checking for gcc variadic macros … found
checking for C99 variadic macros … found
checking for unistd.h … found
checking for inttypes.h … found
checking for limits.h … found
checking for sys/filio.h … found
checking for crypt.h … found
checking for SunOS specific features
checking for sendfilev() … found
checking for event ports … found
checking for poll() … found
checking for /dev/poll … found
checking for kqueue … not found
checking for crypt() … found
checking for zlib library … found
checking for int size … 4 bytes
checking for long size … 4 bytes
checking for long long size … 8 bytes
checking for void * size … 4 bytes
checking for uint64_t … found
checking for sig_atomic_t … found
checking for sig_atomic_t size … 4 bytes
checking for socklen_t … found
checking for in_addr_t … found
checking for in_port_t … found
checking for rlim_t … found
checking for uintptr_t … uintptr_t found
checking for system endianess … big endianess
checking for size_t size … 4 bytes
checking for off_t size … 8 bytes
checking for time_t size … 4 bytes
checking for setproctitle() … not found
checking for pread() … found
checking for pwrite() … found
checking for strerror_r() … found
checking for gnu style strerror_r() … found but is not working
checking for localtime_r() … found
checking for posix_memalign() … not found
checking for memalign() … found
checking for sched_yield() … found
checking for mmap(MAP_ANON|MAP_SHARED) … found
checking for mmap("/dev/zero", MAP_SHARED) … found
checking for System V shared memory … found
checking for struct msghdr.msg_control … not found
checking for ioctl(FIONBIO) … found
checking for struct tm.tm_gmtoff … not found

Configuration summary
  + PCRE library is not used
  + OpenSSL library is not used
  + md5 library is not used
  + sha1 library is not used
  + using system zlib library

  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"
  nginx configuration prefix: "/usr/local/nginx/conf"
  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx/logs/error.log"
  nginx http access log file: "/usr/local/nginx/logs/access.log"
  nginx http client request body temporary files: "/usr/local/nginx/client_body_temp"
  nginx http proxy temporary files: "/usr/local/nginx/proxy_temp"
  nginx http fastcgi temporary files: "/usr/local/nginx/fastcgi_temp"
# make
make -f objs/Makefile
gcc -c -mcpu=v9 -O -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wno-unused-function -Wunused-variable -Wunused-value -Werror -g -I src/core  -I src/event  -I src/event/modules  -I src/os/unix  -I objs \
………省略……….
# makeinstall

  要让人笑掉大牙的地方就在make那里,我几乎耗费了整整一天的时间来找原因。我make的时候看到有error字样就以为是错误,屏幕显示问题成了-W在上一行的最后部分,error在第二行开头。我就以为是错误,然后到邮件列表啊什么的里面去海找。

返回顶部