服务器升级 - MySQL 5.1.52 & hiawatha 7.4 & varnish 2.1.4 

话说服务器大半个月没碰了,很多东西有了新的版本。最近有了闲功夫便一一升级安装了。

首先是MySQL,本来我是要安装5.5.x 分支的 5.5.7 rc的,可是和之前的5.5.6 rc 一样,就是死活编译不通过。故而只好放弃了。开发版的东西果然够呛。

下载5.1.x GA 最新的5.1.52版本源码,解压,进入目录

我的configure:
[root@PowerPC mysql-5.1.52]# ./configure \
> --prefix=/usr/local/mysql \
> --exec-prefix=/usr/local \
> --sysconfdir=/etc/sysconfig/mysql \
> --localstatedir=/var/run \
> --enable-profiling \
> --disable-largefile \
> --with-charset=utf8 \
> --with-extra-charsets=all \
> --with-unix-socket-path=/tmp/mysql.sock \
> --with-mysqld-user=mysql \
> --with-zlib-dir=bundled \
> --with-low-memory \
> --with-embedded-server \
> --without-geometry \
> --with-embedded-privilege-control \
> --without-docs \
> --without-man

检查依赖没有任何问题,接下来make 编译.也很顺利.之后就是make install 安装到指定目录.

完了之后,把support-files 下的my-medium,cnf 复制到 /etc 下,重命名为my.cnf即可.

执行 mysql_init_db 初始化数据库,紧接着 运行 mysql_secure_installation,按照提示,设置root 密码,删除测试表等.

如果像我一样有之前用mysqldump 导出备份的,直接 mysql -u root -p < DBbak.sql 即可.

之后,进入 mysql, flush privileges; 刷新下权限表即可.

接下来是 hiawatha,下载最新的7.4版本,此版本只是修复了bug,没有任何新特征.
解压,进入目录

我的configure:
[root@PowerPC hiawatha-7.4]# ./configure \
> --prefix=/usr/local/hiawatha \
> --exec-prefix=/usr/local \
> --sysconfdir=/etc/sysconfig/hiawatha \
> --localstatedir=/var/run \
> --disable-largefile \
> --disable-ipv6 \
> --disable-ssl

检查依赖,OK,make && make install 即可。
然后就是把自动生成的配置文件删掉,替换之以之前备份的配置.
不出意外的话,应该就可以启动服务器了.


最后是 varnish cache 2.1.4,同样是下载源码包,解压,进入目录

我的configure:
[root@PowerPC varnish-2.1.4]# ./configure \
> --prefix=/usr/local/varnish \
> --exec-prefix=/usr/local \
> --sysconfdir=/etc/sysconfig/varnish \
> --localstatedir=/var/run \
> --disable-largefile

varnish 编译起来比其他几个都要简单,因为给的参数很少。
检查依赖通过,紧接着 make && make install.速度也很快.

和hiawatha 一样,用备份好的default.vcl 覆盖默认的配置文件,即可.

启动 varnish, varnishd -a :80 -f /path/to/default.vcl -u cache.
测试一下,一切OK。升级完成.
[ ] ( 2512 次浏览 ) 永久链接 ( 3 / 2351 )
分享网易源 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 / 2714 )
编译安装 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 / 2475 )

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