分享网易源 for ubuntu 10.10 

deb http://mirrors.163.com/ubuntu/ maverick main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ maverick-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ maverick-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ maverick-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ maverick-backports main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ maverick main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ maverick-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ maverick-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ maverick-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ maverick-backports main restricted universe multiverse

注:前一段时间安装ubuntu 10.10 时候发现网易源关闭掉了,吓了一跳。现在已经恢复。
[ ] ( 1750 次浏览 ) 永久链接 ( 3 / 2160 )
网站恢复访问,且域名/服务器更换 

经过了将近大半个月的暂停,本站目前开始接受访问.

由于工信部的河蟹行为,以前的xiazhengxin.org.cn 域名被暂停解析。故而现在域名更换成了
linux.xiazhengxin.name <--- linux.xiazhengxin.org.cn.

再者,以前所用的freehostia的免费空间由于可用IP均被河蟹,故而不得不放弃.
现在已转至我自己的VPS上。

继续更新.
[ ] ( 1506 次浏览 ) 永久链接 ( 2.9 / 2295 )
编译安装 Hiawatha v7.3 通过 

很早就听说了hiawatha,就是一直没有时间去尝试.最近我的vps内存是越来越吃紧,于是更换掉之前的巨无霸软件就成了当务之急,从而去追求一些轻量级的serverd.

我用varnish 替换了 squid,待会还要用vsftpd 替换 proftpd.

最近越来越不能忍受cherokee的巨大,tar 包居然达到了 6M之多.cherokee 固然是好东西,但是内存状况不允许我这样做.故而相中了号称轻量至极的hiawatha web server.源码包才100多Kb……

下载最新版本7.3的源码包,解压,进入目录
我的configure:
[root@PowerPC hiawatha-7.3]# ./configure \
> --prefix=/usr/local/hiawatha \
> --exec-prefix=/usr/local \
> --sysconfdir=/etc/sysconfig/hiawatha \
> --localstatedir=/var \
> --disable-largefile \
> --disable-ipv6 \
> --disable-ssl \
> --disable-xslt

检查依赖,没有问题.紧接着 make && make install 编译和安装.hiawatha 果然够轻量级,几乎不到十秒就完成了.棒阿

进入配置文件目录 /etc/sysconfig/hiawatha/下,编辑 hiawatha.conf.
可以说hiawatha的配置格式非常简单,而且还有其中例子可以参考.

我的部分配置:

ServerId = http

Binding {
Port = 81
}

FastCGIserver {
FastCGIid = PHP5
ConnectTo = 127.0.0.1:9000
Extension = php, php5
SessionTimeout = 30
}

#适用于wordpress的地址重写
UrlToolkit {
ToolkitID = wp
Match ^/index\.php/.*$ Rewrite /index.php?$1
}

VirtualHost {
Hostname = xiazhengxin.cn
WebsiteRoot = /home/http/xiazhengxin_cn
StartFile = index.php
# ExecuteCGI = yes
UseFastCGI = PHP5
UseToolkit = wp
}


主文件配置完成后,如果用到了fastcgi的话,还要编辑下同目录下php-fcgi.conf 文件.

Server = <php-cgi executable>;<binding>;<UID>[:<GIDs>][;<PHP configuration file>]
这样的格式定义好fastcgi 位置.

如我的:
Server = /usr/local/sbin/php-fpm ; 127.0.0.1:9000 ; http:web


更多配置参见:http://www.hiawatha-webserver.org/howto/cgi_and_fastcgi

一切完成后,hiawatha -k 测试配置文件.
没有问题后,hiawatha 启动服务器.
[ ] ( 1771 次浏览 ) 永久链接 ( 3 / 2715 )
编译安装 nginx/0.8.50 与 lighttpd/1.4.28 通过 

做好了varnish cache 缓存服务器,现在搞定几个后置服务器.
cherokee 还是我的主服务器,跑 php-cgi 程序,我打算用nginx 作为静态资源服务器,而lighttpd 则分流一部分的php-cgi程序.至于tomcat 则是跑 java 程序。

这样一来就很清楚了,于是今天便动手编译nginx 和 lighttpd.

下载各自的最新版本,解压,进入目录

先是nginx,最新的开发版 0.8.50

我的configure:
[root@PowerPC nginx-0.8.50]# ./configure \
> --prefix=/usr/local/nginx \
> --sbin-path=/usr/local/sbin/nginx \
> --conf-path=/etc/sysconfig/nginx/nginx.conf \
> --error-log-path=/var/log/nginx/error.log \
> --pid-path=/var/nginx.pid \
> --lock-path=/var/nginx.lock \
> --user=http \
> --group=web \
> --with-select_module \
> --with-poll_module \
> --with-file-aio \
> --with-http_flv_module \
> --with-http_gzip_static_module \
> --without-http_ssi_module \
> --without-http_auth_basic_module \
> --without-http_geo_module \
> --without-http_map_module \
> --without-http_referer_module \
> --without-http_rewrite_module \
> --without-http_proxy_module \
> --without-http_fastcgi_module \
> --without-http_uwsgi_module \
> --without-http_scgi_module \
> --without-http_upstream_ip_hash_module \
> --http-log-path=/var/log/nginx/access.log \
> --http-client-body-temp-path=/tmp/nginx/request.tmp \
> --without-mail_pop3_module \
> --without-mail_imap_module \
> --without-mail_smtp_module \
> --without-pcre

检查依赖,一切顺利.接下来make && make install.速度也很快。

很快安装好了.

编辑生成的 nginx.conf (位于/etc/sysconfig/nginx 下),因为我是用来做纯静态资源服务器的,所以删除了一切关于cgi/scgi/fcgi 之类的配置,只是做了几个virtualhost 而已.

server {
listen 83;
server_name xiazhengxin.tk;
charset utf-8;
root /home/http/xiazhengxin_tk/;
index index.html index.htm;

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 83;
server_name xiazhengxin.net.cn;
charset utf-8;
root /home/http/xiazhengxin_net_cn/;
index index.html index.htm;

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}


配置完成后,nginx -t 测试一下,ok.

运行nginx 启动服务器.

试图从浏览器访问,失败.

查看日志文件(/var/log/nginx/error.log),发现里面出现了

2010/09/12 13:09:09 [emerg] 28358#0: eventfd() failed (38: Function not implemented)
2010/09/12 13:09:09 [alert] 28357#0: worker process 28358 exited with fatal code 2 and can not be respawn


这样的字样,搜索了一下 eventfd() 函数,发现是File AIO在作怪.

而aio 只在高版本的linux kernel 上才支持.
Currently file AIO is supported on FreeBSD 4.3+ and Linux 2.6.22+ only

而我的centos 内核是:
Linux PowerPC 2.6.18-128.2.1.el5.028stab064.4 #1 SMP Mon Jul 27 12:45:01 MSD 2009 i686 i686 i386 GNU/Linux

好吧,我情绪稳定.

去掉 --with-file-aio 参数.重新编译安装nginx.
这次没问题了(同样的配置下).

接下是lighttpd,我的cofnigure:
[root@PowerPC lighttpd-1.4.28]# ./configure \
> --prefix=/usr/local/lighttpd \
> --exec-prefix=/usr/local \
> --sysconfdir=/etc/sysconfig/lighttpd \
> --localstatedir=/var \
> --enable-lfs=no \
> --disable-ipv6 \
> --without-mysql \
> --without-ldap \
> --with-attr \
> --without-openssl \
> --without-kerberos5 \
> --with-zlib \
> --with-bzip2 \
> --without-fam \
> --without-webdav-props \
> --without-webdav-locks \
> --without-gdbm \
> --with-memcache \
> --without-lua

依赖没有问题,然后 make && make install. 编译 安装至指定目录.
接下来复制源码包中doc文件夹下的config 里面的所有配置文件到/etc/sysconfig/lighttpd下.

稍加编辑即可.我主要是启用了mod_simple_vhost、mod_fastcgi、mod_compress 几个模块.
接着编辑conf.d目录下的对应文件即可.

配置完成后,测试一下
lighttpd -f lighttpd.conf -t 测试通过.
即可启动服务器.
lighttpd -f lighttpd.conf 启动.
[ ] ( 2247 次浏览 ) 永久链接 ( 3.1 / 2476 )
编译安装 Varnish Cache 2.1.3 通过 

前端时间,squid 爆了漏洞,心里感觉还是不能情绪稳定.最近又看到了varnish 这款http 缓存服务器的崛起,觉得很是棒.

再者说,squid 本不是专业反向代理服务器(服务端缓存),而是正向代理服务器(客户端缓存).而varnish cache 则是专业做反向代理的。这是其一.

再者,squid 的体积越来越大,这是我不敢想的。源码压缩包 3M多,解压后竟达10多M...

再看varnish 则小巧了许多.不要1M.解压后才3M多.而且在内存占用方面,varnish 更是让我这台512M 的vps 轻松的多。

最后一点,varnish 的效率据说高于squid.有这么多的理由,我便干掉了squid,投奔varnish了.

下载最新版本 2.1.3 的源码包,解压,进入目录
我的configure:
[root@PowerPC varnish-2.1.3]# ./configure \
> --prefix=/usr/local/varnish \
> --exec-prefix=/usr/local \
> --sysconfdir=/etc/sysconfig/varnish \
> --localstatedir=/var \
> --enable-shared=yes \
> --enable-static=no \
> --disable-largefile

检查依赖,一切OK.接下来 make && make install.
编译时间很快,比起squid 真是快了几倍。呵呵

编辑自动生成的default.vcl 配置文件,这里要说一下,不同于一下配置文件的格式,varnish 使用的是一个叫VCL (Varnish Confingure Language)的语言作为配置文件。囧rz 其实就是一些很简单的条件判断语句什么 if else 之类的.
更不会有switch 之类的,只要你写过一点程序,这些都不是难题.

为了让用户更好的编辑VCL文件,varnish 还提供了用于VIM 的语法高亮文件.
地址:http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/~checkout~/packages/vim-syntax-vcl/vcl.vim

下载放到指定目录即可.

接下开始编辑配置文件,按照官方的wiki提示,
新建几台后置服务器,分别运行于不同端口.

比如我的vps 有cherokee、nginx、lighttpd、tomcat 等.

backend to_cherokee {
.host = "127.0.0.1";
.port = "81";
}

backend to_lighttpd {
.host = "127.0.0.1";
.port = "82";
}

backend to_nginx {
.host = "127.0.0.1";
.port = "83";
}

backend to_tomcat {
.host = "127.0.0.1";
.port = "84";
}


再根据不同的域名转发到对应的后置服务器,

if (req.http.host ~ "^(\w*.)?xiazhengxin.cn$") {
set req.backend = to_cherokee;
}

if (req.http.host ~ "^(\w*.)?xiazhengxin.tk$") {
set req.backend = to_nginx;
}

if (req.http.host ~ "^(\w*.)?xiazhengxin.org.cn$") {
set req.backend = to_lighttpd;
}

if (req.http.host ~ "^(\w*.)?xxx.xxx$") {
set req.backend = to_tomcat;
}


上段代码须放入sub vcl_recv {} 块中.

当然还可以自定义错误.编辑 sub vcl_error {} 块即可.

更多配置详见:http://www.varnish-cache.org/trac/wiki/VCL

这里还有一些例子可供参考:
http://www.varnish-cache.org/trac/wiki/VCLExamples

一切配置完成后,运行 varnishd 启动服务器.
报错:
varnishstat: error while loading shared libraries: libvarnish.so.1: cannot open shared object file: No such file or directory


运行ldconfig 即可.

再次运行
[root@PowerPC varnish]# varnishd -a :80 -f default.vcl -u http
启动成功.
[ ] ( 2680 次浏览 ) 永久链接 ( 3 / 2577 )

<< <上一页 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 下一页> >>