if ( isset($_SERVER[‘PATH_INFO’]) )
$pathinfo = $_SERVER[‘PATH_INFO’];
$pathinfo = ”;
$pathinfo_array = explode(‘?’, $pathinfo);
$pathinfo = str_replace(“%”, “%25″, $pathinfo_array[0]);
$req_uri = $_SERVER[‘REQUEST_URI’];修改为:

if ( isset($_SERVER[‘PATH_INFO’]) )
$pathinfo = iconv(‘GBK’, ‘UTF-8’, $_SERVER[‘PATH_INFO’]);
$pathinfo = ”;
$pathinfo_array = explode(‘?’, $pathinfo);
$pathinfo = str_replace(“%”, “%25”, $pathinfo_array[0]);
$req_uri = iconv(‘GBK’, ‘UTF-8’, $_SERVER[‘REQUEST_URI’]);这样通过伪静态软件就可以支持文章的URL链接为中文了。

Ubuntu 10.10 and Hyper-V R2

Ubuntu 10.10 was today 2010-10-10 released which is great new for us working with Hyper-V R2. We now have access to all the new drivers that Microsoft donates to the Linux community. The earlier drivers available in Ubuntu 10.04 LTS lacked features such as integrated shutdown, heartbeat detection, problematic host and guest synchronization and unstable network drivers (network traffic died unexpectedly). With Ubuntu 10.10 we now have the sames features as the Linux Integration Components 2.1 from Microsoft which only enables us to use Red Hat, Cent OS or SuSE Enterprise where Cent OS is unsupported from Microsoft.


Ubuntu is a strong Linux distribution in the community due to it’s huge repository which often is very up-to date with the newest versions of different applications and the package system apt is also very pleasant. I myself rather choose CentOS due to it’s mature and stable kernel but sometimes CentOS don’t offer up-dated repositories and you may have to wait until getting new features for the applications you are using. Of course you always have the option to compile the software your self. This is a short how-to how to active all the drivers and get Ubuntu 10.10 up and running in Hyper-V R2 in minutes.

Enabling and loading drivers

Make your installation of Ubuntu 10.10, in my case I used server amd64 (64-bit). In my case I compile the loading of the drivers in the ram drive (initramfs) so drivers get loaded early upon start up, similar to Hyper-V installation in CentOS but you can also load the drivers in the /etc/modules for late-stage loading. After finalizing your custom Ubuntu 10.10 installation simply do

01 [email protected]:~# nano /etc/initramfs-tools/modules


03 // Add


05 hv_vmbus

06 hv_storvsc

07 hv_blkvsc

08 hv_netvsc

09 hv_utils


11 [email protected]:~# update-initramfs -u

12 [email protected]:~# shutdown -r now


14 // After rebooting add the NIC, remember that nic names have changed back from sethX to ethX so


16 [email protected]:~# nano /etc/network/interfaces


18 // Add, in case of dhcp

19 auto eth0

20 iface eth0 inet dhcp


22 [email protected]:~# /etc/init.d/networking restart
Ubuntu 10.10 running under Hyper-V R2 with drivers

Secure clock skew

To secure the clock even better I suggest installing the adjtimex package which Microsoft recommends in their Linux Integration Components. And it’s available in Ubuntu repositories, so to install simply:

1 [email protected]:~# apt-get install adjtimex


3 // Wait until completed, takes around 70 seconds while comparing clocks