Saturday, January 26, 2013

Debian 6.0.6 with Hyper-V networking support



What I did:
Install clean debian (with a legacy network adapter attached, using a fixed mac address)

Prepare build environment
apt-get update
apt-get install build-essential libncurses5-dev bzip2 linux-source-2.6.32
Unpack linux sources
cd /usr/src
tar -jxvf linux-source-2.6.32.tar.bz2
ln -s linux-source-2.6.32 linux
cd linux
Cleanup (not really needed because we just unpacked it all)
make clean
make mrproper
Configure kernel
cp /boot/config-2.6.32-5-amd64 ./.config
make menuconfig

 - Load an Alternative Configuration File
  - .config [OK]
 - General setup --->
  - Local version - append to kernel release
   - -hyperv (mind the hyphen in front of it)
 - Device Drivers --->
  - Staging drivers --->
   < >  VIA Technologies VT6656 support   (BUGFIX http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=568454) 
     Microsoft Hyper-V client drivers
 - Kernel hacking --->
  [ ] Compile the kernel with debug info
 Exit and save!
Build kernel
make
make modules_install
make install
depmod 2.6.32-hyperv
Create initramfs
mkinitramfs -o /boot/initrd.img-2.6.32-hyperv 2.6.32-hyperv
Update grub
nano /etc/default/grub
 Default=2 (To make the 3rd menu option selected)
update-grub
Add Hyper-V modules
nano /etc/initramfs-tools/modules
  hv_vmbus
  hv_storvsc
  #hv_blkvsc (THIS IS STILL BUGGY, SO WE DISABLE THIS FOR NOW)
  hv_netvsc
Some bugfixing...
nano /etc/modprobe.d/blacklist.conf
 #fix: Driver 'pcspkr' is already registered, aborting...
 blacklist snd-pcsp
 #fix: SMBus base address uninitialized - upgrade bios or use force_addr=0xaddr
 blacklist i2c_piix4
update-initramfs -u -k 2.6.32-hyperv
Fix networking
nano /etc/network/interfaces
  edit eth0 to seth0
poweroff
In Hyper-V settings remove legacy network adapter and add normal one
Start up, you will get an message saying: Fixing recursive fault but reboot is needed!
Just poweroff and power on again
You're done!

Known issues:
 - Mouse still isn't working
 - hv_blkvsc isn't working
 - When using more then 4 GB of memory you get SRAT: Hotplug area too small

Sunday, January 20, 2013

Reverse proxy on openSUSE

My previous article was about creating a reverse proxy on Debian.
Due to incompatibilities between Debian and Hyper-V I had to recreate the setup in an openSUSE environment.

How I did it:
1. Install openSUSE 12.2 as clean as possible.
2. Fix a error that causes yast to f#ckup the lines in the menus (disable all graphicall boot stuff in grub)
3. Fix a error "piix4_smbus", edit /etc/modprobe.d/blacklist.conf -> blacklist i2c_piix4
4. start yast2
    - Add "apache" + "yast2-httpserver"
5. Configure http-server from yast
    - Enable http
    - Open firewall port
    - Start apache on boot
    - Add modules (proxy, proxy-http, headers, rewrite)
    - Add vhost
6. Edit /etc/apache/vhost.d/IIS01.wouterspaans.nl.config
7. Reboot

Thursday, January 17, 2013

Reverse proxy on Debian

Solution: Reverse proxy.

What I did:

1. Download Debian 6.0.6 (64bit)
2. Install smallest possible version
3. apt-get install apache2
4. a2enmod proxy_http
5. a2enmod headers
6. a2enmod rewrite
7. nano /etc/apache2/sites-available/default

 ServerName server1.wouterspaans.nl
 ProxyPass / http://IIS01.wouterspaans.local/
 ProxyPassReverse / http://IIS01.wouterspaans.local/



 ServerName server2.wouterspaans.nl
 ProxyPass / http://IIS02.wouterspaans.local/
 ProxyPassReverse / http://IIS02.wouterspaans.local/

8. /etc/init.d/apache restart

Done!

Debugging when something goes wroong can be done looking at the logs...
tail -f /var/log/apache2/error.log