升级ubuntu server

Posted on 四月 30th, 2009 in Linux | No Comments »

ubuntu jaunty已经发布了,服务器现在的版本还是hardy,正好遇到了奇怪的问题,所以就想升级了。

sudo aptitude install update-manager-core

然后修改/etc/update-manager/release-upgrades文件内容,把

Prompt=lts

修改为:

Prompt=normal

然后开始升级:

sudo do-release-upgrade

注意:
1 在升级过程中有个提示,是否要继续操作,其中提示为[yN],但在中文locale下需要输入"是“,估计这是个翻译的BUG?
2 apache在升级后会产生问题,导致所有的网站都定向到默认网站了,需要修改/etc/apache2/ports.conf文件,把

NameVirtualHost *:80

给注释掉,然后在修改默认网站/etc/apache2/sites-enable/000-default,在第一行添加:

NameVirtualHost *

ubuntu hardy下使用zend framework

Posted on 七月 22nd, 2008 in Linux | No Comments »

安装:

sudo aptitude install zend-framework

补充操作:
1 添加Zend符号连接
sudo ln -s /usr/share/php/libzend-framework-php/Zend /usr/share/php/Zend
2 修补中文EMAIL的subject乱码
参考http://framework.zend.com/issues/browse/ZF-2532

使用z-star摄像头

Posted on 七月 14th, 2008 in Linux | 2 Comments »

在笔记本上使用一直没有问题,现在转移到台式机上用,摄像头出问题了,在虚拟机里可以使用,在本机上反而无法使用,搜索了一下,发现可以通过重新禁止zc0301模块而使用gspca来解决此问题。
参考:
http://blog.myfenris.net/?p=377
注意其中的comment:

$ sudo gedit /etc/modprobe.d/blacklist

Add these lines at the bottom:

# Use gspca for Z-Star webcam
blacklist zc0301

Pull out your webcam, plug it back in, and start camorama. If your colours are fucked up you can try adding a “color correction” filter in Camorama (Skype does this automatically). If that doesn’t help, try adding “options gspca force_rgb=1″ to /etc/modprobe.d/options.

Cheers,

最初,我是打算按照readme.Debian的说明来进行安装的:

sudo aptitude install gspca-source
sudo m-a prepare
sudo m-a a-i gspca

但是,因为现在这里有个BUG,导致编译会失败,所以我也从源码开始安装的(是否可以省略这一步?不太确认)。
编译安装完成后的操作:

sudo nano /etc/modprobe.d/blacklist

添加一行:

blacklist zc0301

然后:

sudo modprobe -r zc0301
sudo modprobe gspca

然后把摄像头重新插一下,若是要使用camorama:

sudo chmod 777 /dev/video0

现在就应该可以使用camorama或skype来测试摄像头了。
仍然存在问题:
camorama里没有问题,但是skype自动使用了彩色纠正,导致颜色出现了偏差。

ubuntu hardy下简易的proftpd+mysql配置

Posted on 七月 9th, 2008 in Linux | No Comments »

1. 安装

sudo aptitude install proftpd proftpd-mysql

2. 配置
/etc/proftpd/proftpd.conf

Include /etc/proftpd/sql.conf

前面的注释去掉
然后修改/etc/proftpd/sql.conf,我的相关配置如下:

SQLBackend mysql
SQLEngine on
SQLAuthenticate on
SQLAuthTypes Plaintext Crypt
SQLConnectInfo ftp@localhost proftp abcde
SQLUserInfo ftpuser userid passwd uid gid homedir shell
SQLGroupInfo ftpgroup groupname gid members

3. 创建mysql库
此处请参照Virtual Hosting With Proftpd And MySQL (Incl. Quota) On Ubuntu 8.04 LTS

4. restart proftpd

sudo /etc/init.d/proftpd restart

ubuntu hardy下的smtp服务

Posted on 五月 27th, 2008 in Linux | 3 Comments »

前面介绍了应如何打造安全的SMTP服务,我们的服务器升级到ubuntu hardy后发现邮件服务急剧上升,最终检查发现smtp服务不安全了:全面开放了,这可是一个大问题。

经过一系列测试发现,修改了/etc/postfix/master.cf,去掉了这两个的注释:

smtp inet n - - - - smtpd
#submission inet n - - - - smtpd
# -o smtpd_etrn_restrictions=reject
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
#smtps inet n - - - - smtpd
# -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
#submission inet n - - - - smtpd
-o smtpd_etrn_restrictions=reject
-o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes

这样就要求客户端必须使用TLS来连接,并必须通过验证。
暂时还不清楚是否对本机上的其他Web邮件服务是否有影响。

make skype work with pulseaudio in ubuntu hardy

Posted on 三月 31st, 2008 in Linux | No Comments »

Install pulseaudio first, just follow the instructions in ubuntu wiki:

sudo apt-get install libasound2-plugins "pulseaudio-*" paman padevchooser paprefs pavucontrol pavumeter

then create /etc/asound.conf that contains:

pcm.pulse {
type pulse
}
ctl.pulse {
type pulse
}
pcm.!default {
type pulse
}
ctl.!default {
type pulse
}

then make your user have the rights to access pulse groups:

pulse
pulse-access
pulse-rt

If you have got skype's audio problem, follow instructions in ubuntuforums,
edit /etc/pulse/default.pa, comment out "load-module module-hal-detect". Then, uncomment the following:

load-module load-module module-alsa-sink ....
load-module module-alsa-source ...

and change it's content to:

load-module module-alsa-sink device=dmix sink_name=output
load-module module-alsa-source device=dsnoop

and append the follow content in /etc/asound.conf:

pcm.skypeout
{
type plug
slave.pcm "dmix"
}
ctl.skypeout
{
type hw
card 0
}
pcm.skypein
{
type plug
slave.pcm "dsnoop"
}
ctl.skypein
{
type hw
card 0
}

restart pulseaudio:

killall pulseaudio
pulseaudio &

Then, start Skype, and go to the Sound Devices section in the Options. Select for Sound Out and Ringing, the device called "skypeout". Select for Sound In, the device called "skypein"

Reference
1 https://wiki.ubuntu.com/PulseAudio
2 http://ubuntuforums.org/showthread.php?t=686911