Xupeng's blog

Apr 1, 2009 - 1 minute read - Comments

Virtualbox stop working after upgrading kernel to 2.6.29

I am using Virtualbox 2.2.0 beta, it worked well before I upgrade my kernel from 2.6.26 to 2.6.29, but it refused to start my vm just after the kernel upgrade: virtualbox-error It said "VMMR0.r0 is importing g_SUPGlobalInfoPage which we couldn't find" in its log file, fortunate enough, I got to this page after I searched the web with this error message, there are already many people who met this problem with kernel 2.6.29, the solution is very simple: just uncomment "VBOX_USE_INSERT_PAGE = 1" in vboxdrv's Makefile, and compile the kernel module for virtualbox again, it should work. For my Debian unstable, the target Makefile sits under /usr/share/virtualbox/src/vboxdrv, so I just uncomment that line, and run "/etc/init.d/vboxdrv setup" to re-compile the kernel module, then everything goes well, I can happlily virtualize my boxes again ;)

Mar 29, 2009 - 1 minute read - Comments

Build deb packcage for nginx with wsgi support under debian lenny(5.0)

I am not familiar with debian's deb package build system, so I go through the process of building deb package from source at first.

  1. Install packages needed for building nginx
    sudo apt-get build-dep nginx
    sudo apt-get install fakeroot
  2. Get source code package:
    mkdir $HOME/build/nginx -p
    cd $HOME/build/nginx
    apt-get source nginx
  3. Build it to generate deb package
    cd nginx-0.6.32
    dpkg-buildpackage -rfakeroot
    Everything goes well, a deb package is generated under $HOME/build/nginx.
Then I continue to build nginx with wsgi support
  1. Checkout latest code of ( mod_wsgi for nginx)
    cd $HOME/build/nginx
    hg clone http://hg.mperillo.ath.cx/nginx/mod_wsgi/
  2. Edit $HOME/build/nginx/nginx-0.6.32/debian/rules, add additional options to the configure clause:
    --add-module=${HOME}/build/nginx/mod_wsgi --with-debug
  3. Edit $HOME/build/nginx/nginx-0.6.32/debian/conf/nginx.conf, add these two lines to "http" section:
    include             /etc/nginx/wsgi_vars;
    wsgi_temp_path      /var/tmp/nginx_wsgi_temp;
  4. Copy file wsgi_vars from wsgi's conf directory to nginx's
    cp $HOME/build/nginx/mod_wsgi/conf/wsgi_vars \
       $HOME/build/nginx/nginx-0.6.32/debian/conf/
  5. Edit $HOME/build/nginx/nginx-0.6.32/auto/install, and thses lines to it
    test -f '\$(DESTDIR)$NGX_CONF_PATH' \
            || cp conf/wsgi_vars '\$(DESTDIR)$NGX_CONF_PREFIX'
    cp conf/wsgi_vars '\$(DESTDIR)$NGX_CONF_PREFIX/wsgi_vars.default'
  6. Everything is ready now, compile nginx and generate deb package as before
    cd nginx-0.6.32
    dpkg-buildpackage -rfakeroot
    Install the generated deb package with dpkg, it works.
The deb package I built can be downloaded from here.

Mar 29, 2009 - 1 minute read - Comments

PTY allocation request failed on channel 0

After I reboot my xen-powered [Linux VPS](http://www.linode.com/?r=cd5198f9daf6a668424aea5534f74baf343f4759), I can't ssh into it any more, it keeps saying:

PTY allocation request failed on channel 0

This problem can be fixed by adding one line to /etc/fstab:

none /dev/pts devpts defaults 0 0

and run "mount -a" after it is added.

What confuses me is why it breaks just after I reboot it, but it works fine before, actually I didn't change anything since last time I rebooted it, maybe it's [Linode](http://www.linode.com/?r=cd5198f9daf6a668424aea5534f74baf343f4759) who changed some settings?

Jan 3, 2009 - 2 minute read - Comments

使用 VPS 和 Gentoo 打造安全高效的个人网络基地 – 开篇

是的,我承认我有点偏执有点疯狂,有点完美主义,我要使用 VPS+Gentoo 打造我的个人网络基地,所涉及到的软件和系统会有 Gentoo, Apache, Nginx, tinyproxy, daemontool, Blog, Trac 等等以及以后可能会使用的一些系统,还会涉及到 Linux 的安全配置和优化,借此记录一下完整的构建过程,留作日后参考。