Friday, November 6, 2009

Script to Fix Realtek R8168 LAN Chip Problem in Debian

The new Realtek r8168/r8111 network cards do not work out of the box in recent distributions of GNU/Linux. The "modprobe" loads the r8169 module, which has not yet been updated to work with these cards. A work around is to use the r8168 driver provided by Realtek.

Jameson Williams provides a shell script to automate the module switching:
http://www.jamesonwilliams.com/hardy-r8168


Wednesday, September 9, 2009

Install SSL Support in Apache2

Install Apache2 and PHP5:
Following the following post on installing Apache2 and PHP5:
http://handsonasterisk.blogspot.com/2009/07/install-apache2-and-php5-in-debian-etch.html

Install OpenSSL:
# apt-get install openssl ssl-cert

Generate a certificate:
#openssl req $@ -new -x509 -days 365 -nodes -out /etc/apache2/apache.pem -keyout /etc/apache2/apache.pem

Only need to enter the Common Name, enter '.' for all other fields.

Set Apache2 to listen on 443:
Enter the following entry to the file /etc/apache2/ports.conf
Listen 443

Enable SSL support in Apache2:
# a2enmod ssl
# /etc/init.d/apache2 force-reload

Configure SSL certificate to virtual hosts in Apache2:
You need to edit /etc/apache2/sites-available/default file:

From:
NameVirtualHost *
<virtualhost>
.
.
</virtualhost>

To:
NameVirtualHost *:80
<virtualhost *:80>
.
.
</virtualhost>

NameVirtualHost *:443
<virtualhost *:443>
ServerAdmin webmaster@localhost
SSLEngine on
SSLCertificateFile /etc/apache2/apache.pem
.
.
</virtualhost>

Restart Apache2:
# /etc/init.d/apache2 restart

References:
Install and Configure Apache2 with PHP5 and SSL Support in Debian Etch
http://www.debianadmin.com/install-and-configure-apache2-with-php5-and-ssl-support-in-debian-etch.html

Thursday, July 23, 2009

Install Apache2 and PHP5 in Debian Etch

Install Apache2:
# apt-get install apache2

Install PHP5 support for Apache2:
# apt-get install libapache2-mod-php5 php5-cli php5-common php5-cgi


References:
Install and Configure Apache2 with PHP5 and SSL Support in Debian Etch
http://www.debianadmin.com/install-and-configure-apache2-with-php5-and-ssl-support-in-debian-etch.html

Configuring Apache 2 on Debian, Ubuntu
http://www.control-escape.com/web/configuring-apache2-debian.html

Saturday, May 30, 2009

Installing Debian "etch-and-a-half" in Windows XP

In order to install Debian"etch-and-a-half" in Windows XP, we need the following tools:

  1. WMware Player - free tool to run virtual machines on Linux or Windows PCs
    http://www.vmware.com/products/player/

  2. EasyVMX - the free web tool to create virtual machines for VMware Player
    http://www.easyvmx.com/

  3. The Debian "etch-and-a-half" netinst CD image (amd64)
    http://www.debian.org/releases/etch/debian-installer/etchnhalf
Steps:
  1. Install VMware Player in Windows XP.
  2. Create an empty virtual machine:
    - Using EasyVMX, http://www.easyvmx.com/easyvmx.shtml
    - Virtual Machine Name: Debian
    - Select Guest OS: Generic Linux 2.6.x 64-bit
    - Memory Size: 320 MB
    - Ehternet0: Bridged
    - Enable CDROM #2: disk.iso
    - Disk #1: Disk Size 2GB
    - Create and download the virtual machine Debian.zip
  3. Extract the Debian.zip
  4. Download the Debian CD and rename the file to disk.iso
  5. Place the disk.iso into the same directory of the extracted Debian.zip
  6. Play the extracted virtual machine using VMware Player.
  7. You may need to associate the CD to the disk.iso in VMware Player:
    Devices => CD/DVD(IDE) => Connect to Disk Image File (iso)...
  8. Press Ctrl+Alt+Delete to reboot the virtual machine to start Debian installation.

References:
  1. 用vmware player, easyvmx 去安裝ubuntu
    http://teristam.mysinablog.com/index.php?op=ViewArticle&articleId=191647

  2. www.easyvmx.com 玩VMWARE不用Station版喔!
    http://blog.roodo.com/kazamasogetsu/archives/3270827.html

Tuesday, May 26, 2009

Reset Debian Root Password

Boot to bash prompt as root:

  1. Reboot system
  2. Highlight "single-user mode" in GRUB menu and press "e" to edit
  3. Highlight "kernel /boot/vmlinuz-2.6...." and press "e" to edit
  4. Add "init=/bin/bash" and press
  5. Press "b" to reboot
In bash prompt and mount file system as read/write:
  1. mount -o remount,rw /
In bash prompt and change root password:
  1. passwd

Monday, January 19, 2009

Replacement of Faulty RAID Drive

For consistency, always move the good drive to to the primary position and place the new replacement drive in the secondary. Reboots the system and read the RAID status by:

# cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sda2[0] sdb2[1]
3943872 blocks [2/2] [U_]

md0 : active raid1 sda1[0] sdb1[1]
152344256 blocks [2/2] [U_]

unused devices:


As you can see, sdb1 and sdb2 are missing.

Start by copying the partition structure from /dev/sda to /dev/sdb:
# sfdisk -d /dev/sda | sfdisk /dev/sdb

Now add the two sdb partitions to the corresponding md's:
# mdadm --add /dev/md0 /dev/sdb1
# mdadm --add /dev/md1 /dev/sdb2


The two drvies should start to synchronize. To watch them sync:
#watch -n 1 cat /proc/mdstat

At last, create a new boot record on the secondary drive:
Start the grub command shell:
# grub

At the 'grub>" shell prompt create new boot record for the second drive:
grub> root (hd1,0)
grub> setup (hd1)
grub> quit