升级安装 varnish 3.0.3 RC1 和 lighttpd 1.4.31 以及 nginx 1.3.1 

最近我所用到的很多软件都更新了,Varnish Cache 几天前发布了其3.0.3的RC测试版,我有理由试用和反馈。

Lighttpd 也在上周发布了今年的第一个新版本,修复几个严重问题。

nginx 呢,也在昨天,发布了其1.3.x 分支的第二个测试版,修复了一个Windows 下的CVE.这在nginx 官网的安全通告页可以看到:
http://nginx.org/en/security_advisories.html

GNU/Linux 不受影响,不过还是有一些bugfix.具体见更新列表:
http://nginx.org/en/CHANGES

基于此,我决定挨个跟进。

下载源码:
7 wget http://repo.varnish-cache.org/test/varn ... rc1.tar.gz
8 wget http://download.lighttpd.net/lighttpd/r ... 31.tar.bz2
9 wget http://nginx.org/download/nginx-1.3.1.tar.gz

移除旧版本:
[root@PowerPC pub]# rm varnish*
rm: remove regular file `varnish-3.0.2.tar.gz'? y
rm: remove regular file `varnish-3.0.3-rc1.tar.gz'? n
[root@PowerPC pub]# rm lighttpd*
rm: remove regular file `lighttpd-1.4.30.tar.bz2'? y
rm: remove regular file `lighttpd-1.4.31.tar.bz2'? n
[root@PowerPC pub]# rm nginx*
rm: remove regular file `nginx-1.3.0.tar.gz'? y
rm: remove regular file `nginx-1.3.1.tar.gz'? n

挨个解压,列表如下:
[root@PowerPC ~]# ls -lh
total 12K
drwxr-sr-x 6 1000 1000 4.0K Jun 6 16:54 lighttpd-1.4.31
drwxr-xr-x 9 1001 1001 4.0K Jun 6 17:06 nginx-1.3.1
drwxr-xr-x 10 1000 1000 4.0K Jun 6 16:44 varnish-3.0.3-rc1

先从Varnish Cache开始,进入目录:
我的configure:
[root@PowerPC varnish-3.0.3-rc1]# ./configure \
> --prefix=/usr/local/varnish \
> --exec-prefix=/usr/local \
> --sysconfdir=/etc/sysconfig \
> --localstatedir=/var \
> --disable-largefile \
> --enable-kqueue \
> --enable-epoll \
> --enable-ports \
> --with-jemalloc

检查依赖,没有问题。只有一个函数的警告。

configure: WARNING: won't look for sendfile() on i686-pc-linux-gnu


忽略即可。make && make install 编译安装。
恢复配置文件,覆盖自动生成的default.vcl .

接下来 lighttpd,进入目录:
我的configure:
[root@PowerPC lighttpd-1.4.31]# ./configure \
> --prefix=/usr/local/lighttpd \
> --exec-prefix=/usr/local \
> --sysconfdir=/etc/sysconfig/lighttpd \
> --localstatedir=/var \
> --disable-lfs \
> --disable-ipv6 \
> --with-mysql=`which mysql_config` \
> --with-ldap \
> --with-attr \
> --with-pcre \
> --with-zlib \
> --with-bzip2

检查依赖,系统给出编译概况:

Plugins:

enabled:
mod_access
mod_accesslog
mod_alias
mod_auth
mod_cgi
mod_compress
mod_dirlisting
mod_evhost
mod_expire
mod_extforward
mod_fastcgi
mod_flv_streaming
mod_indexfile
mod_mysql_vhost
mod_proxy
mod_redirect
mod_rewrite
mod_rrdtool
mod_scgi
mod_secdownload
mod_setenv
mod_simple_vhost
mod_ssi
mod_staticfile
mod_status
mod_trigger_b4_dl
mod_userdir
mod_usertrack
mod_webdav
disabled:
mod_cml
mod_magnet

Features:

enabled:
auth-crypt
auth-ldap
compress-bzip2
compress-deflate
compress-gzip
regex-conditionals
disabled:
large-files
network-ipv6
network-openssl
stat-cache-fam
storage-gdbm
storage-memcache
webdav-locks
webdav-properties


确认没有问题。make && make install 以继续。
编译安装完成后,恢复下配置文件目录。

最后是 nginx,进入目录:
我的configure:
[root@PowerPC nginx-1.3.1]# ./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/run/nginx.pid \
> --lock-path=/var/lock/nginx.lock \
> --user=web \
> --group=http \
> --with-rtsig_module \
> --with-select_module \
> --with-poll_module \
> --with-file-aio \
> --with-http_realip_module \
> --with-http_addition_module \
> --with-http_xslt_module \
> --with-http_image_filter_module \
> --with-http_flv_module \
> --with-http_mp4_module \
> --with-http_gzip_static_module \
> --without-http_ssi_module \
> --without-http_geo_module \
> --without-http_map_module \
> --without-http_rewrite_module \
> --without-http_proxy_module \
> --without-http_fastcgi_module \
> --without-http_uwsgi_module \
> --without-http_scgi_module \
> --without-http_limit_conn_module \
> --without-http_limit_req_module \
> --http-log-path=/var/log/nginx/access.log \
> --http-client-body-temp-path=/tmp/nginx/request \
> --without-mail_pop3_module \
> --without-mail_imap_module \
> --without-mail_smtp_module \
> --with-pcre

同样,检查依赖时系统会给出编译概况:

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

nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/sbin/nginx"
nginx configuration prefix: "/etc/sysconfig/nginx"
nginx configuration file: "/etc/sysconfig/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: "/tmp/nginx/request"


同样,在确认无误后,开始 编译 和 安装。 make && make install.
之后,恢复配置文件,覆盖生成的 nginx.conf 文件。

注:这里有个小插曲,那就是我在编译nginx 时候,把user 和 group 参数写反了,以至于启动 nginx 后,提示“getpwnam() 和 getgrnam()” 错误。
我又难得再编译一遍,就用"user USER GROUP;"修饰符写死在配置文件里了。囧~

之后启动所有服务,一切正常。
升级结束。
[ ] ( 2116 次浏览 ) 永久链接 ( 2.9 / 2547 )
升级安装 Nginx 1.3.0 和 为PHP 安装启用 APC 模块 

昨天,nginx 发布了其最新开发分支1.3.x 的第一个版本 - 1.3.0。果断升级,并且按照它之前的路线图显示,1.3.x 分支很有可能要增加对 SPDY 的支持。

下载源码包:
36 wget http://nginx.org/download/nginx-1.3.0.tar.gz

移除旧版本:
[root@PowerPC pub]# rm nginx*
rm: remove regular file `nginx-1.2.0.tar.gz'? y
rm: remove regular file `nginx-1.3.0.tar.gz'? n

解压,进入目录:
我的configure :
[root@PowerPC nginx-1.3.0]# ./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/run/nginx.pid \
> --lock-path=/var/lock/nginx.lock \
> --user=http \
> --group=web \
> --with-rtsig_module \
> --with-select_module \
> --with-poll_module \
> --with-file-aio \
> --with-http_image_filter_module \
> --with-http_flv_module \
> --with-http_mp4_module \
> --with-http_gzip_static_module \
> --without-http_ssi_module \
> --without-http_geo_module \
> --without-http_map_module \
> --without-http_rewrite_module \
> --without-http_proxy_module \
> --without-http_fastcgi_module \
> --without-http_uwsgi_module \
> --without-http_scgi_module \
> --http-log-path=/var/log/nginx/access.log \
> --http-client-body-temp-path=/tmp/nginx/request \
> --without-mail_pop3_module \
> --without-mail_imap_module \
> --without-mail_smtp_module \
> --with-pcre

检查依赖,没有问题。之后系统给出编译概况,如下:

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

nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/sbin/nginx"
nginx configuration prefix: "/etc/sysconfig/nginx"
nginx configuration file: "/etc/sysconfig/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: "/tmp/nginx/request"


确认无误,make && make install.编译安装之。

之后,恢复配置文件即可.

nginx 升级完成。

接下来,考虑到我的PHP 5.4.0 一直都没有缓存模块,正好趁今天有时间一起搞定。

于是火速动手。

考虑到我以前一直用的eaccelerator,用的还蛮顺手的,故而还是用它。可是丫的已经很长时间没有更新了,SVN 的版本号永远的停留在了r427,最后更新2年前~

从SVN签出源码后,编译一下,居然报错。

奇怪,同样的版本,以前怎么没错?难道是不兼容PHP 5.4 + ?
果然,在它的sf.net 项目主页上,也看到了其他用户的反馈。
详见:http://sourceforge.net/projects/eaccelerator/reviews/

看来 eaccelerator 是指望不上了,好在还有 APC 和 Xcache 可选择。

最终还是选了APC (Alternative PHP Cache),毕竟是 PHP 团队自己在维护,信得过。

下载源码:
wget http://pecl.php.net/get/APC-3.1.10.tgz

解压,进入目录:
执行 phpize,生成 configure 等文件.

我的configure:
[root@PowerPC APC-3.1.10]# ./configure \
> --enable-apc \
> --enable-apc-memprotect \
> --with-php-config=/usr/local/bin/php-config

其实很简单,就是指明 php-config 的绝对路径即可。
之后,make 编译。

编译完成后,其实我要得apc.so 链接库文件已经生成了。
[root@PowerPC APC-3.1.10]# find . -name "*.so"
./.libs/apc.so
./modules/apc.so

直接可以把apc.so 复制到 php 的扩展文件夹下。
或者
通过 make install 安装至其目录。如下:
[root@PowerPC APC-3.1.10]# make install
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20100525/
Installing header files: /usr/local/php/include/php/

最后,编辑 php.ini 配置文件。
加入类似以下的APC 配置项:
extension=apc.so
apc.enabled=1
apc.shm_size=50M
apc.ttl=7200
apc.user_ttl=7200
apc.enable_cli=0

更多参数选项可以参考源码包下INSTALL 文件。

接下来,只需要重启PHP-FPM,就可以载入APC了。

启动所有服务后,查看PHPINFO:
http://cgi.xiazhengxin.name/phpinfo.php

一切OK。
[ ] ( 2478 次浏览 ) 永久链接 ( 3 / 2605 )
在Ubuntu 12.04 上为Virtualbox 启用USB 设备支持 

虚拟机我一直在用,不是说离不开Windows,而是有些时候一些应用在Windows 下体验确实要好一点,比如 Tencent QQ.

最近我找到了我失踪久矣的10moons 左轮摄像头,那还是我在北京念书的时候,在中关村买的。当时花了我100块RMB。

找到后甚是感触,于是便打算给我的虚拟机里面的QQ用起来。

众所周知,VirtualBox 使用宿主机的USB设备需要安装扩展包。根据自己的vbox的版本,到vbox官网下载对应的扩展包。

比如我的vbox 是4.1.12的,对应扩展包地址是:
http://download.virtualbox.org/virtualb ... ox-extpack

下载完毕后,在“管理”菜单下的“全局设定”里的“扩展”标签下,加入、启用即可。

如图:


之后,打开虚拟系统设置,在“USB设备”标签下,勾选上"启用USB控制器"以及"2.0控制器"增加对USB2.0 的支持。

如图:


按说这个时候已经搞定了。可是在USB列表里面却没有任何USB设备。这是为什么呢?谷歌了一下,找到了一篇文章(具体地址已经无法回忆起来了,囧),解释了一下原因。

原来是vbox 所在的用户组比如要包括当前用户才行。

查看当前用户名:
sharl@sharl-laptop:~$ whoami
sharl

查看vbox 所在的组:
sharl@sharl-laptop:~$ cat /etc/group | grep vbox
vboxusers:x:125:sharl

将当前用户加入vbox组:
usermod -a -G vboxusers sharl

即可。

此时,重启系统。再次打开虚拟机,果然,USB设备都已经被识别、访问到了。
这些,在“设备”菜单下就可以看到。

如图:


添加后,虚拟机系统果然发现了新硬件,按照一般步骤,安装驱动即可正常使用。

安装后的10moons 摄像头,果然很给力。

如图:


完。

注:本文在撰写和实践时参考了国外某网站一篇文章,由于记录不善,地址目前不详。模糊记得当时使用了“Ubuntu Virtualbox add usb device” 等关键词。
[ ] ( 2315 次浏览 ) 永久链接 ( 3 / 2666 )
在CentOS 上利用预编译源安装 nginx 和 cherokee 

昨天偶尔从我的一个朋友那里得到了一个闲置的VPS,故而就想尝试一些小想法,一直没敢在自己的VPS上做的操作。

早就听说nginx 提供预编译版本,早就想试试了。还有 cherokee 也是。

不过和nginx 不同的是,cherokee 的预编译包是由EPEL维护和提供的。

果断下载其库的rpm 包,地址在它们的官网都可以找到。
3 wget http://mirrors.sohu.com/fedora-epel/6/i ... noarch.rpm
13 wget http://nginx.org/packages/centos/6/noar ... noarch.rpm

下载文件如下:
[root@ymzx ~]# ls -lh
总用量 24K
-rw-r--r-- 1 root root 14K 10月 14 2010 epel-release-6-5.noarch.rpm
-rw-r--r-- 1 root root 4.3K 10月 14 2011 nginx-release-centos-6-0.el6.ngx.noarch.rpm

依次安装。
[root@ymzx ~]# rpm -i --nosignature epel*
[root@ymzx ~]# rpm -i --nosignature nginx*

必须要加 --nosignature 参数,跳过签名检验,否则会报以下错:

warning: epel-release-6-5.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY


安装完成后,会发现yum 的库多了几个文件,
[root@ymzx ~]# ls -lh /etc/yum.repos.d
总用量 28K
-rw-r--r-- 1 root root 1.9K 7月 3 2011 CentOS-Base.repo
-rw-r--r-- 1 root root 637 7月 3 2011 CentOS-Debuginfo.repo
-rw-r--r-- 1 root root 626 7月 3 2011 CentOS-Media.repo
-rw-r--r-- 1 root root 957 10月 12 2010 epel.repo
-rw-r--r-- 1 root root 1.1K 10月 12 2010 epel-testing.repo
-rw-r--r-- 1 root root 113 10月 14 2011 nginx.repo
-rw-r--r-- 1 root root 219 7月 26 2011 vz.repo

就是 nginx 和 epel 的。

接下来,就可以在 yum 里面搜索到 nginx 和 cherokee 了。

[root@ymzx ~]# yum search nginx cherokee
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.san.fastserv.com
* epel: linux.mirrors.es.net
* extras: mirror.san.fastserv.com
* updates: mirrors.usc.edu
=============================================================== Matched: nginx ===============================================================
nginx-debug.x86_64 : debug version of nginx
nginx-release-centos.noarch : nginx repo configuration and pgp public keys
collectd-nginx.x86_64 : Nginx plugin for collectd
nginx.x86_64 : high performance web server

============================================================= Matched: cherokee ==============================================================
cherokee-devel.i686 : Development files of cherokee
cherokee-devel.x86_64 : Development files of cherokee
cherokee.i686 : Flexible and Fast Webserver
cherokee.x86_64 : Flexible and Fast Webserver

依次 yum install NAME 安装即可。

怎么样?是不是很简单,快捷?
[ ] ( 2275 次浏览 ) 永久链接 ( 3 / 2720 )
为Ubuntu 12.04 启用中科大的源 

昨天晚上,Canonical 发布了Ubuntu 的最新版本12.04.作为之前 beta 2 的使用者,我也在今早的第一时间下载了ISO,刻盘安装了。

安装完了后,因为这是一个LTS版本,所以我也打算长用一段时间。所以便开始了搭建我的惯用环境。

可是我发现中文版ubuntu 默认的cn.archive.ubuntu.com 源(也就是mirrors.sohu.com ) 很慢,基本只有3、40kb/s 的速度。

这尼玛坑爹啊~

果断换。网易的源历来不错~

可是丫的好像还没有更新~


收录架构
i386
amd64
source

收录版本
dapper(6.06)
hardy(8.04)
jaunty(9.04)
karmic(9.10)
lucid(10.04)
maverick(10.10)
natty(11.04)
oneiric(11.10)


无奈,去看看中科大。好像也没有更新嘛。


收录架构
ALL

收录版本
Hardy(8.04)
Intrepid(8.10)
Jaunty(9.04)
Karmic(9.10)
Lucid(10.04)
Maveric(10.10)
Natty(11.04)
Oneiric(11.10)


肿么搞得?正当郁闷的时候,看到中科大的镜像使用页面下方赫然写着:


使用说明

软件包管理中心(推荐)
在软件包管理中心“软件源”中选择“中国的服务器”下mirrors.ustc.edu.cn即可自动使用。

手动更改配置文件
以Natty(11.04)为例, 编辑/etc/apt/sources.list文件, 在文件最前面添加以下条目(操作前请做好相应备份)


这第一种办法不是很好嘛?果断试试。

打开ubuntu 软件中心,选择菜单,编辑:


在“下载自”下拉列表选择“其他站点”。



在弹出的列表的中国块下,找到"mirrors.ustc.edu.cn",确定即可。



至此,ubuntu 的软件源更换完成。apt-get update 一下,享受飞一般的速度吧~

最后附上启用了中科大源后的sources.list 内容:


sharl@sharl-laptop:~/桌面$ cat /etc/apt/sources.list | grep ustc
deb http://mirrors.ustc.edu.cn/ubuntu/ precise main restricted
deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise main restricted
deb http://mirrors.ustc.edu.cn/ubuntu/ precise-updates main restricted
deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-updates main restricted
deb http://mirrors.ustc.edu.cn/ubuntu/ precise universe
deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise universe
deb http://mirrors.ustc.edu.cn/ubuntu/ precise-updates universe
deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-updates universe
deb http://mirrors.ustc.edu.cn/ubuntu/ precise multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ precise-updates multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-updates multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ precise-security main restricted
deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-security main restricted
deb http://mirrors.ustc.edu.cn/ubuntu/ precise-security universe
deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-security universe
deb http://mirrors.ustc.edu.cn/ubuntu/ precise-security multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-security multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ precise-proposed restricted main multiverse universe

[ ] ( 4017 次浏览 ) 永久链接 ( 3 / 2573 )

<< <上一页 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 下一页> >>