Linode VPS with Nginx的进一步优化
星期三, 12月 2nd, 2009
-
清理系统服务
可以关闭不必要的系统服务,linux下常用chkconfig,在ubuntu系统上最常用sysv-rc-conf,界面更友好使用更方便,直接通过源安装即可运行。
sudo apt-get install sysv-rc-conf sudo sysv-rc-conf
通过软件可以发现,Linode提供的系统已经关闭了很多不必要的服务,但是系统自带了apache,直接取消选择关闭即可。
SyntaxHighlighter
星期二, 12月 1st, 2009
作为程序员,blog难免要贴不少代码,简单的pre标记显得比较平板,不象ide里面的代码排版颜色那么漂亮。
在网上搜了一把,SyntaxHighlighter应该是目前最美观最全面的代码着色器了,唯一的缺点就是需要引入的文件太多……不过要做到这么全的代码类型覆盖,这也是不可避免的。
Setup on Linode.com with ubuntu+nginx+php+fastcgi+mysql 续
星期日, 11月 29th, 2009
嗯嗯,继续。
-
nginx和fastcgi启动配置
2个配置文件,放于/etc/init.d下面。
cd /etc/init.d touch fast-cgi touch nginx sudo chmod +x /etc/init.d/nginx /etc/init.d/fast-cgi
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/nginx/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/local/nginx/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 test_nginx_config() { if nginx -t then return 0 else return $? fi } case "$1" in start) echo -n "Starting $DESC: " test_nginx_config 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 test_nginx_config start-stop-daemon --start --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS || true echo "$NAME." ;; reload) echo -n "Reloading $DESC configuration: " test_nginx_config start-stop-daemon --stop --signal HUP --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON || true echo "$NAME." ;; configtest) echo -n "Testing $DESC configuration: " if test_nginx_config then echo "$NAME." else exit $? fi ;; status) status_of_proc -p /var/run/$NAME.pid "$DAEMON" nginx && exit 0 || exit $? ;; *) echo "Usage: $NAME {start|stop|restart|reload|force-reload|status|configtest}" >&2 exit 1 ;; esac exit 0
Blog施工继续
星期六, 01月 31st, 2009
花了4个小时左右,做了以下工作。
- 上传使用了illacrimo-plus主题;
- 调整所有post的分类和标签——纯体力活;
- 添加修改Post部分内容(列表、引用)的自定义样式;
- 微调部分主题代码,去掉很多花花哨哨的东东;
- 修改了一个头像——看上去挺失败……