前一段时间笔记本升级到Ubuntu 9.10后遇到了系统服务没有启动的问题,后来得知是upstart的一个bug。具体情况看看我在ServerFault回答的同样问题吧。
How to install Nginx from source with ‘Debian’ layout
1. 创建相关目录
$ sudo mkdir /etc/nginx
$ sudo mkdir /etc/nginx/conf.d
$ sudo mkdir /etc/nginx/sites-available
$ sudo mkdir /etc/nginx/sites-enabled
$ sudo mkdir /var/log/nginx
$ sudo mkdir -p /var/lib/nginx/body
$ sudo mkdir /var/lib/nginx/proxy
$ sudo mkdir /var/lib/nginx/fastcgi
2. 编译安装
$ ./configure --prefix=/usr \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--user=www-data \
--group=www-data \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--with-md5=/usr/lib \
--with-sha1=/usr/lib \
--with-http_ssl_module \
--with-http_gzip_static_module \
--with-pcre \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
--with-http_stub_status_module
$ make
$ sudo make install
$ sudo mv /usr/html /var/www/nginx-default
3. 修改配置文件
/etc/nginx/nginx.conf
user www-data;
worker_processes 5;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
server_tokens off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
/etc/nginx/sites-available/default
server {
listen 80;
server_name localhost;
location / {
root /var/www/nginx-default;
index index.html index.htm;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
}
启用default vhost
sudo ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
4. 创建init脚本
$ sudo vi /etc/init.d/nginx
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/nginx
NAME=nginx
DESC=nginx
test -x $DAEMON || exit 0
# Include nginx defaults if available
if [ -f /etc/default/nginx ] ; then
. /etc/default/nginx
fi
set -e
. /lib/lsb/init-functions
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON -- $DAEMON_OPTS || true
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON || true
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON || true
sleep 1
start-stop-daemon --start --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS || true
echo "$NAME."
;;
reload)
echo -n "Reloading $DESC configuration: "
start-stop-daemon --stop --signal HUP --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON || true
echo "$NAME."
;;
status)
status_of_proc -p /var/run/$NAME.pid "$DAEMON" nginx && exit 0 || exit $?
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|reload|force-reload|status}" >&2
exit 1
;;
esac
exit 0
$ sudo chmod +x /etc/init.d/nginx
$ sudo /usr/sbin/update-rc.d -f nginx defaults
5. 启动、停止、重启nginx服务
sudo /etc/init.d/nginx start
sudo /etc/init.d/nginx stop
sudo /etc/init.d/nginx restart
升级到Ubuntu 8.10
花了一天多的时间将笔记本(IBM Thinkpad T43)升级到了Ubuntu新发布的8.10版本。
升级过程很顺利(就是时间比较长),其间遇到了Network Manager小程序不停地弹出消息对话框,说“找不到所需的资源,无法继续”,但不影响升级包的安装。
重启系统后,Network Manager小程序居然不能加载了,在launchpad里搜索到解决办法是只在/etc/network/interfaces文件里保留下面这两行。
auto lo
iface lo inet loopback
第二个问题是,升级后无线网卡不工作了,用dmesg | grep ipw2200查看,有如下类似的信息:
ipw2200-bss.fw request_firmware failed: Reason -2
ipw2200: Unable to load firmware: -2
ipw2200: failed to register network
google后知道是firmware加载的问题,检查/lib/firmware目录,没在当前使用中的内核目录(/lib/firmware/2.6.27-7-generic/)里找到这些firmware文件。从ipw2200的网站上下载后解压到这个目录后重启就解决了。(补充:使用原来的2.6.24内核启动系统无线网卡是正常的)
Xfce 字体问题
昨天为了使用笔记本(T43, ATI Mobility Radeon X300显卡)的VGA OUT功能,改用了ATI的驱动(xorg-driver-fglrx),字体变小了,虽然在User Interface和Window Manager里设置了字体,但有些地方的字体还是很小,尤其是ThunderBird的邮件正文,中文字都要缩成一团了。
Google到了一个方法,就是修改~/.config/xfce4/Xft.xrdb这个文件,在里面加上这句
Xft.dpi: 96
再看User Interface的Font设置,发现里面也有DPI的设置,呵呵。