Archive for April, 2009

SMB Linux Servers from Lenovo

Posted in Linux, Product Review by admin on April 27th, 2009

PC and Laptop manufacturer Lenovo have entered the Server market with the focus being on SMB rather than the higher end enterprise products which their competitors focus on. The Servers come as either Tower or Rack Mounted and have both single and dual processor options making them a good fit for almost any size of SMB.

The new range of servers from Lenovo are named “ThinkServer” and comprise of the following model ranges:-

TS100 – Tower, Single Processor server
TD100(x) – Tower, Dual processor capable server
RS110 – Rack Mounted, Single Processor Server
RD120 – Rack Mounted Dual processor capable server

As you might expect there are many options available within the ranges including varying levels of RAID etc…

As the new Lenovo Servers are aimed at the SMB market Lenovo have made sure that they are certified to run both Novell SUSE Server 10 & Red Hat v5.x. It is good to see that Lenovo have had the foresight to include these certifications for their new range of ThinkServers. Although we haven’t tested them yet we believe that the servers will operate with other versions of Linux aswell (e.g. ubuntu etc..) which will open up the market even further.

If you are planning on adding a new one or two processor Linux Server into your network the Lenovo Range is really worth a look as they are well engineered, have a great range and are available at a cost effective price.

For more information on Lenovo Servers contact www.lenovo-laptops.co.uk by calling 0845 094 8895, they will be able to help you with information on the models available, special offers, pricing and installation services.

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

How to install Linux on the Sony VAIO Z505HE/HS/JE/JS

Posted in How To's by Shafkat Shahzad, M.Sc on April 23rd, 2009

The tutorial will provide you with guidance on how to install Red Hat Linux on the Sony Z505H/J is fairly easy. You have a choice of two methods: Network install from another machine, or if you have the Sony CD-ROM (or DVD) drive, installation directly off of a Red Hat CD-ROM.
Before You Install
Before you install, you should turn the “Plug & Play O/S” feature off in the BIOS. Failing to do this may cause the machine to lock up when trying to configure the ethernet device during installation. To do this, perform the following steps:
1. Turn on the machine.
2. During boot, once the “SONY” logo is displayed, press F2 to enter the PhoenixBIOS Setup Utility.
3. Once in the setup utility, press the right arrow key to move to the “Advanced” screen.
4. Press the down arrow key until “Plug & Play O/S” is selected.
5. If “Plug & Play O/S” is listed as “[Yes]”, press the space bar to change it to “[No]”.
6. Press the right arrow key until you reach the “Exit” screen.
7. Press enter to select the “Exit (Save Changes)” option. The system will reboot.
You can then proceed with the rest of the installation as detailed below.

CD-ROM Install
If you have the Sony PC-Card CD-ROM drive (sold separately) and a copy of Red Hat Linux on CD-ROM, you can install Linux directly off the CD-ROM. Note that there is direct BIOS support for the Sony CD-ROM drive which allows this. Other PC-Card CD-ROM drives may not work, or may require other procedures to work, as they have not been tested. Note: If you are using Sony’s PCG-DVD51 DVD-ROM drive, this procedure will also work, but you must make sure its external power supply is not connected (BIOS support for the DVD-ROM drive does not work if its external power is plugged in). I know it sounds strange. It is.
To install off of CD-ROM:
1. Connect the drive and place the CD-ROM in the drive before turning on the Z505. When the machine is turned on (assuming the BIOS is configured to boot from the CD-ROM, which is the default), it will boot off of the CD-ROM and present you with an initial text screen.
2. Contrary to the instructions, do not simply hit enter at the initial screen. Instead, type the following:
linux ide2=0×180,0×386
3. Proceed with the installation as described below.

Network Install
If you have another machine which can serve as a NFS, HTTP, or FTP server, and a network, you can perform a network install using the built-in ethernet adapter:
1. Insert the CD-ROM in the server machine (or otherwise make the files on the CD-ROM available to that machine)
2. Configure your NFS services, HTTP server, or FTP server as necessary to make the files accessible via NFS, HTTP, or Anonymous FTP.
3. Using the server machine or another machine, use dd (under linux/unix/etc) or the provided DOS utility to copy the network boot disk image (images/bootnet.img) to a floppy
4. Plug the Sony Z505 into the network
5. Plug the USB floppy drive into the Sony Z505HE/HS
6. Boot the Sony Z505 using the network boot disk and follow the prompts
More information on this installation method can be found in the Official Red Hat Reference Guide and various online documents.

Important Considerations
There is one thing you may want to consider while installing linux on the Z505. In order to use the (very handy) “Suspend to disk” function of the Phoenix NoteBIOS (Fn-F12 on the Z505), the BIOS must be able to locate a special save-to-disk area on the hard drive. This area is typically located in a file stored on a FAT-formatted partition of the hard drive, and since linux doesn’t use FAT-formatted partitions for its normal operations, if you want to use this feature, you will need to set aside a small bit of the disk for this purpose.
There are several very important requirements for this suspend-to-disk partition:
• It must (obviously) be large enough to hold all of the contents of the system’s RAM, as well as some additional configuration information.
• It must be on the first hard disk (/dev/hda). This isn’t really much of an issue, as the Z505 laptops typically only have one hard disk.
• It must be on a primary partition of the hard disk (hda1, hda2, hda3, or hda4).
In addition, there are several requirements introduced by the techniques described in this document for setting up the partition, and the techniques used by the fixup kit:
• It must be a FAT16-formatted partition.
• It must also have space for a minimal DOS system and the PHDISK.EXE utility.
• It must be located within the first 1024 cylinders of the disk (so it can be booted). This is not an issue for those with smaller (8GB) disks, as they do not have more than 1024 cylinders, but those with larger ones (9GB/12GB) will need to be careful of this.
While it is sufficient to have a partition large enough for just your current needs, it is reccomended that one be created which is large enough for the largest possible amount of RAM (192MB on the HE/JE, 256MB on the HS/JS), as the additional space spent will only be a small portion of the total size of the disk, and will allow you to add RAM later without needing to repartition the hard disk. For this reason, a total partition size of around 200MB or 264MB is reccomended, depending on what model you’re using.
Unfortunately, due to the above constraints, and the fact that the Red Hat installer’s disk partitioning tool (Disk Druid) is extremely poorly designed, paritioning the hard drive properly to support suspend-to-disk on the Z505 requires the use of the (harder to use) fdisk utility for part of the install. To do this, perform the following steps:
If you are using the text-mode installer (Z505JS users)
1. Perform a normal installation until you come to the screen asking for “Installation Type”
2. Choose “Install Custom System”
3. When prompted to use Disk Druid or fdisk, choose “fdisk”
4. Choose “edit”. This will run the fdisk program.
5. At the fdisk prompt, type “p” and press enter. This will list the current partitions on the disk.
6. For each partition listed, type “d”, press enter, and enter the number of the partition to delete it (you actually only need to delete partitions numbered 1-4).
7. Add a new partition by entering “n”.
a. Enter “p” for a primary partition.
b. Enter “1″, to add partition 1.
c. Enter “1″ to start on cylinder 1.
d. Enter “+264M” to make the partition 264MB in size (or “+200M” for the HE/JE).
8. Set the type of the newly created partition by entering “t”
a. Enter “6″ for the partition type.
9. Enter “p” to view the current partition table. You should see a single partition listed:
10. Device Boot Start End Blocks Id System
11. /dev/hda1 1 34 273073+ 6 FAT16
12. Enter “w” to write your changes and exit the fdisk program.
13. When you return to the “Disk Setup” screen, press Ctrl-Alt-Del to reboot the machine.
14. Re-run the installer, and choose your desired installation type (GNOME/KDE/Server/Custom) as normal.
15. When you are asked whether to Continue (automatically partition) or Manually Partition, you can safely choose either option.
If you are using the graphical installer:
1. Perform a normal installation until you come to the screen asking for “Install Type”
2. At the “Install Type” screen, make sure the “Use fdisk” checkbox (in the upper-right corner) is checked before pressing the Next button.
3. When asked to “select drive to run fdisk on”, press the “hda” button. This will run the fdisk program.
4. At the fdisk prompt, type “p” and press enter. This will list the current partitions on the disk.
5. For each partition listed, type “d”, press enter, and enter the number of the partition to delete it (you actually only need to delete partitions numbered 1-4).
6. Add a new partition by entering “n”.
a. Enter “p” for a primary partition.
b. Enter “1″, to add partition 1.
c. Enter “1″ to start on cylinder 1.
d. Enter “+264M” to make the partition 264MB in size (or “+200M” for the HE/JE).
7. Set the type of the newly created partition by entering “t”
a. Enter “6″ for the partition type.
8. Enter “p” to view the current partition table. You should see a single partition listed:
9. Device Boot Start End Blocks Id System
10. /dev/hda1 1 34 273073+ 6 FAT16
11. Enter “w” to write your changes and exit the fdisk program.
12. When you return to the screen asking to “select drive to run fdsik on”, press the Back button.
13. On the “Install Type” screen, uncheck the “Use fdisk” box, select the type of install desired, and press the Next button.
14. When you are asked whether to Remove Data or Manually Partition, you can safely choose either option.

Notes for Z505HE/HS/JE Users
There’s really only one other issue which one needs to look out for during the actual installation of Red Hat Linux 6.2 on the Sony Z505HE/HS/JE. When you come to the portion of the configuration for monitor and display type, choose “LCD 1024×768″ (ok, that wasn’t that surprising). On the next screen, if you attempt to test the configuration using the “Test” button, it will not work, but don’t get discouraged. Check the checkbox for “Customize Configuration” and press “Next”. On the next screen you will be asked for display resolution. Select “1024×768, 32bpp”. If you test this configuration it should work, and you can continue on as normal.
(The issue here, for those who are interested, is that the frequency specifications for the LCD 1024×768 entry are such that, were it a CRT monitor, XFree86 would be able to do higher resolutions. Since the installer doesn’t know that there are other physical constraints limiting it to 1024×768, it defaults to using a higher resolution, which the LCD actually can’t display. You must manually tell it to only use the 1024×768 video mode before it will be able to display anything using the LCD screen. This is actually true for most laptops with this size of display.)
Notes for Z505JS Users
Because the Z505JS uses a newer video chipset which is not autodetected by the installer, you will only be able to use the text-mode installer. You will also not be able to properly configure the screen for X-windows in the installer. Instead, when prompted, choose a Neomagic video card, choose whatever you want for the other options. When given the opportunity to Skip configuration, choose that option. After you install a text-mode linux system, you will need to login and apply the configuration fixes below, and will then be able to configure your graphics display properly.
Upgrading the Kernel
What is the Kernel?
The kernel is the core of the linux operating system. It contains the code which allows linux programs to execute and communicate with the hardware to do what they need to do. This includes all of the hardware device drivers, routines for accessing files on disk, memory management, network handling, etc.
Why Would I Want to Upgrade my Kernel?
As of this writing, Red Hat Linux 6.2 comes with a fairly recent “stable” (version 2.2) version of the linux kernel, so it might appear that there’s no real reason to install something else. There are, however, quite a few advancements in the linux kernel which can be found in the newer “development” (version 2.3) kernels, several of which are useful on the Z505:
• USB support. If you want to use USB peripherals with linux, you will need to either upgrade your kernel to version 2.3/2.4, or apply some USB modifications designed for 2.2 kernels which are available. Upgrading to a 2.4 kernel is probably easier, and gains other benefits in the process, and is thus the technique used by this document.
• Fixed problems with suspend/resume. Under 2.2 kernels, problems have been experienced upon resuming after a suspend such that the hard disk does not get properly re-initialized, and fails to work after a resume. Some of these problems appear to be fixed in newer kernels. You may or may not experience these problems, if you do, upgrading your kernel is probably a good idea.
• ACPI support and other advanced features. The newer kernels support several new features such as ACPI which could be useful with the Z505. If you don’t know what these are, you probably don’t need to worry about this. If, on the other hand, this is something you would like to try, you will need the newer kernel.
In general, the biggest reason to upgrade the kernel is USB support, which allows you to use the USB floppy drive which comes with the Z505. For most people, this alone is enough reason to perform the upgrade.
Why Would I Not Want to Upgrade my Kernel?
The 2.3 kernels are “development” kernels. This means that they’re works-in-progress, and may contain some bugs, glitches, or horrible system-crashing flaws. Now, that may sound pretty bad, but in reality, the 2.3 line is currently in its “pre-release” phase, which means new developments have actually finished and it’s undergoing final finish-ups and testing before becoming the next “stable” kernel release (version 2.4). The astute may notice at this point that this document actually describes upgrading to a kernel with a version number of 2.4.0, which sounds like a stable kernel, but it’s important to note here that this is still a “test” kernel (2.4.0-test5), which is still roughly akin to “beta” software in most other software-development worlds. Does it have bugs? Maybe a few, and you might just run into a new one nobody knows about, but they’re being cleaned up fast, and for the most part it runs pretty well, and you may well never notice you’re using a “development” or “test” kernel.
Upgrading to a development kernel is a calculated risk, and one only you, the end user, are qualified to decide. You may want to keep the 2.2 kernel that comes with Red Hat Linux, you may want to wait around for a month or two until the “stable” 2.4 kernel becomes available and use it instead, or you may want to go ahead with the “test” kernel.
How do I Upgrade my Kernel?
If you want to compile your own kernel, you will need to make sure you install the C development and kernel development packages when installing Red Hat Linux. You will then need to download the kernel source (from kernel.org or somewhere similar), unpack it, configure it, compile it, and then install it, as described in the Kernel HOWTO. If you are experienced at linux and/or developing software, this may well be the best approach to take, as it allows to much more sophisticated customization of the result.
If, however, you are of a less technical nature, this may seem a particularly daunting task. If this is the case, you are in luck. I have created an RPM package of the 2.4.0-test5 release of the kernel, compiled with appropriate configuration for the Z505 laptop running Red Hat Linux 6.2. This can be found in the Software section at the end of this document.
Upgrading PCMCIA
In order to properly use PCMCIA devices (such as the Sony CDROM) with the new kernel, it is also necessary to upgrade the pcmcia-cs package. This can be obtained from pcmcia-cs.sourceforge.net. In addition, in order to compile the pcmcia-cs package for the new 2.4 kernel, a small patch is required, which can be downloaded from the Software section at the end of this document.
Once the patch is applied, building this package is fairly straightforward. make config will prompt for necessary information, and then make install will compile and install all necessary files. Once again, if you do not want to go through all of this effort, a precompiled RPM is available in the Software section at the end of this document.
Related Upgrades
It is reccomended that some other components of the system be upgraded to versions designed for the newer kernel. Luckily, most of the packages in Red Hat Linux 6.2 are new enough that they don’t need much upgrading, but a few packages do:
• modutils should be version 2.3.10 or greater.
• util-linux should be version 2.10g or greater.
• PPP should be version 2.4.0b1 or greater.
You can download and compile these packages for yourself, or install updated RPMs. Unfortunately, as of this writing, finding new enough RPMs can be a bit of a chore. Fortunately, however, you can find all of the above packages in the Software section at the end of this document.
Obtaining and Installing Sound Drivers
The earlier Z505 models contained a NeoMagic sound chipset which was actually fairly well supported by linux. However, with the advent of the H-series, Sony decided to include a higher-end chipset from Yamaha, the YMF-744. This would ordinarily be a good thing, except that Yamaha has until recently been extremely stubborn about not releasing specifications for this family of chipsets, leaving open-source developers out in the cold.
Compiling the ALSA Drivers
In order to use sound on the Z505H/J, you will need to download a reasonably recent version of the ALSA driver package from www.alsa-project.org (version >= 0.5.9 is reccomended as of this writing). If you are only planning on using the ALSA drivers this as a replacement for the standard linux (OSS) sound system, you do not need to download the ALSA library or utils packages. These extra packages contain libraries and utilities for use with software designed specifically for the new ALSA system, which most linux software isn’t.
Version 0.5.9 and up compile without incident with the 2.4.0-test5 kernel, simply follow the instructions in the INSTALL file to compile the ALSA drivers.
Installing the ALSA Drivers
The ALSA modules which need to be loaded to support full access to the YMF-744 chipset on the Z505H/J are snd-card-ymfpci, snd-pcm-oss, and snd-seq-oss. The INSTALL file suggests adding a great deal of additional text to the modules.conf/conf.modules file to achieve this, however in practice a much simpler setup also results in better coordination with the Red Hat initialization scripts, and avoids problems with intermittently losing mixer settings due to auto-unloading of the sound modules.
It is therefore suggested that one not follow the instructions in the INSTALL file when it comes to installing the drivers, but instead the following lines be added to /etc/conf.modules (or /etc/modules.conf, depending on what name yours goes by):
alias sound snd-pcm-oss
alias midi snd-seq-oss
alias sound-slot-0 snd-card-ymfpci
Note: In order to be able to play sounds properly using the YMFPCI drivers, you will need to disable the “Plug & Play O/S” setting in the BIOS configuration. If this isn’t done, sounds will play strangely.
There is also a bit of a problem with the ALSA YMFPCI drivers and/or hardware and suspending. After a suspend/resume has occurred, the drivers must be unloaded and reloaded before the sound card will actually work again. Luckily, the Red Hat APM scripts already have support for this sort of workaround for sound cards, and this can be fixed (mostly) by editing /etc/sysconfig/apmd and changing the following settings:
RESTORESOUND=”yes”
RESTORESOUNDPROGS=”yes”
SOUNDMODULES=”snd-card-ymfpci”
Again, if all of the above is more than you want to take on, the binary RPMs contained in the Software section at the end of this document also have all necessary ALSA drivers.
Setting up Suspend-to-disk
In order to use the “suspend to disk” function of the Z05HE/HS, some preparation is required. First of all, please note the requirements when installing Red Hat Linux on the machine above.
Assuming you have set aside the necessary DOS partition on your hard drive, there are then a couple of ways to go about configuring the partition properly:
Method 1: Using DOSEMU
This method can be used to create a bootable DOS partition using linux and set up a suspend-to-disk area on it, but does require a bit of work. It goes as follows:
Obtain the PHDISK.EXE program
PHDISK.EXE is the utility which creates the necessary save area on the disk for the BIOS to use when suspending to disk. This utility is actually provided on the System Recovery CDs provided with the Z505H/J, but finding it is a little tricky, as Sony has seen fit to stick it inside a floppy-disk image file in a hidden portion of the CD.
To obtain this very useful utility, one must do the following:
1. Insert the CDROM PCMCIA card into the laptop, and place the disk labelled “SONY System Recovery CD” (disc #1) in the drive.
2. Mount the CDROM. As mentioned, the bit we’re looking for is hidden by default, so one must mount it with the “nohide” option:
mount -t iso9660 -o nohide /dev/hde /mnt/cdrom
3. Now mount the bootimg.bin floppy disk image contained on the CD:
mount -t vfat -o loop /mnt/cdrom/bootimg.bin /mnt/floppy
4. The PHDISK utility can now be found in /mnt/floppy/spt/phdisk.exe. Copy it to a safe place.
5. Unmount everything we mounted:
umount /mnt/floppy
umount /mnt/cdrom
And there you have it. Of course, you could simply download PHDISK.EXE from the Software section at the end of this document.
Obtain a copy of DOS
Most people have a copy of MS-DOS sitting around somewhere, but if, as in my case, you would very much like to avoid touching Microsoft software ever again (even the relatively benign MS-DOS), there is an alternative.
FreeDOS is an open-source DOS implementation which can run standalone or under the DOSEMU package within linux. Both FreeDOS and DOSEMU were bundled on the installation CD for older versions of Red Hat Linux, but unfortunately due to space considerations they are no longer present on the install CD for Red Hat Linux 6.2. They can, however, be downloaded from redhat.com’s download section (dosemu-0.99.13-6.i386.html and dosemu-freedos-0.99.13-6.i386.html). The following steps assume you have downloaded and installed these packages.
After installing the DOSEMU and FreeDOS packages, you will need to edit the /etc/dosemu.conf file slightly. Locate the line which says:
$_hdimage = “hdimage.first”
Change this line to read:
$_hdimage = “hdimage.freedos /dev/hda1″
Note: This assumes the DOS partition you created for this purpose is /dev/hda1. If it isn’t, replace /dev/hda1 above with the correct partition.
Put PHDISK.EXE on your DOS disk
For FreeDOS, this is accomplished as follows:
1. Mount the FreeDOS disk image using the following commands:
mkdir /mnt/freedos
mount -t vfat -o loop /var/lib/dosemu/hdimage.freedos /mnt/freedos
2. Copy the file:
cp phdisk.exe /mnt/freedos
3. Unmount the FreeDOS image:
umount /mnt/freedos
Prepare the DOS partition
1. Start up FreeDOS with the following command:
dos
2. You should find yourself at a C:> prompt. Do the following:
format d:
sys d:
copy phdisk.exe d:
3. Type ‘exitemu’ to exit DOSEMU.
4. Make sure the DOS partition is marked bootable:
fdisk /dev/hda
Type ‘p’ to print the current partition table. The DOS partition should be listed with an asterisk next to it, like so:
Device Boot Start End Blocks Id System
/dev/hda1 * 1 27 216841+ 6 FAT16

If it does not have that asterisk, you can add it using the ‘a’ command. Then type ‘q’ to exit fdisk.
Reboot into DOS and run the PHDISK utility
This last bit cannot be done while running linux, because the PHDISK program needs more access to the system than linux affords. You must instead:
1. Make sure lilo is configured to be able to boot to DOS. Check the /etc/lilo.conf file and make sure the following lines are in it:
2. other=/dev/hda1
3. label=dos

If they aren’t, add them to the file (note that the “label=dos” line is indented) and then type ‘/sbin/lilo’ to make the changes take effect.
4. Shutdown and reboot the machine. At the LILO boot: prompt, type ‘dos’ and press enter. The machine should boot into FreeDOS.
5. Type the following:
phdisk /create /file
This should create the SAVE2DSK.BIN file required by the BIOS.
6. Press ctrl-alt-del to reboot back into linux
You should now be able to use Fn-F12 to suspend the system to disk.
Method 2: The Easy Way
If all of this is more effort than you want to go through, do the following:
1. Download the PHDISK installation package from the Software section at the end of this document.
2. Untar the package and cd into the created directory:
tar xzf z505h-phdinst.tar.gz
cd z505h-phdinst
3. (as root) type ./z505h-phdinst. This will install the required files and finish by giving you instructions on how to reboot into DOS to complete the process.
4. As instructed, reboot into DOS and type the following:
phdisk /create /file
You should now be able to use Fn-F12 to suspend the system to disk.
Important NOTES:
• You must set the DOS partition bootable even if you never intend to boot off of it. This is how the BIOS decides what partition to look for its suspend-to-disk file on. If the partition is not marked bootable, suspend-to-disk will not work.
Tuning and Fixups
Configuring X-windows on the Z505JS
As mentioned in the installation section, the Z505JS laptop uses a Neomagic 256XL+ video chipset which isn’t automatically supported by the Red Hat Linux 6.1 installation. The problem here is more one of autodetection, actually, as the software can use the chipset perfectly well, but doesn’t recognize its device ID automatically, so it needs some help in knowing how to talk to it.
In order to use XFree86 with the NM256XL, it is necessary to configure it as for any other Neomagic chipset (this can be done using Xconfigurator), then edit the /etc/X11/XF86Config file, find the line which says:
# Chipset “NM2160″
Remove the # character at the beginning of the line, and change the “NM2160″ to “NM2200″, to read:
Chipset “NM2200″
Alternately, you can apply the changes in the kudzu patch in the Software section which will update the information used by the Red Hat hardware configuration utility (kudzu) so that it can automatically configure your display. After applying this patch, you can simply type
kudzu
and the system should automatically detect your video chipset and allow you to configure X for your display.
Disabling “Plug & Play O/S” in the BIOS
Due to limitations in the current YMFPCI sound drivers, sounds will play strangely (slowly, repeating chunks) unless the “Plug & Play O/S” setting is turned off in the BIOS configuration. To do this, perform the following steps:
1. Reboot the machine.
2. During boot, once the “SONY” logo is displayed, press F2 to enter the PhoenixBIOS Setup Utility.
3. Once in the setup utility, press the right arrow key to move to the “Advanced” screen.
4. Press the down arrow key until “Plug & Play O/S” is selected.
5. If “Plug & Play O/S” is listed as “[Yes]”, press the space bar to change it to “[No]”.
6. Press the right arrow key until you reach the “Exit” screen.
7. Press enter to select the “Exit (Save Changes)” option. The system will reboot.
Please note that in a dual-boot system, Windows may not like having this setting turned off, and may refuse to boot. If you are running a dual-boot system you may need to leave the “Plug & Play O/S” setting turned on.
Fixing Hang on Boot when Floppy Connected
Because of a bug in the way the BIOS configures devices on boot, if the USB floppy drive is connected when the machine reboots, the BIOS will configure it in such a way that other devices (such as sound and ethernet) do not work properly. This can cause the system to lock up during boot when linux attempts to initialize the other devices. In order to fix this problem, it is necessary to ensure that the USB drivers get loaded (at least briefly) before other components such as sound are initialized. To do this, edit /etc/rc.d/rc.sysinit, and find the line which says:
# Load sound modules
Before this line, add the following line:
modprobe usb-uhci && modprobe -r usb-uhci
This will avoid these lockup issues even when the USB floppy is connected during boot.
Using the floppy drive and other USB devices
In order to use the USB floppy drive, or any other USB device, the drivers must be loaded. Assuming you have a kernel with the appropriate USB drivers available (such as the 2.4.0-test5 kernel mentioned above), this is relatively easy. To load the USB drivers automatically on boot, simply place the following lines in your /etc/rc.d/rc.local file:
modprobe usb-uhci
modprobe usb-storage
Alternately, as a more technically clean solution, you can download the usb init script from the Software section, place it in /etc/rc.d/init.d directory, and type:
chkconfig –add usb
If you have other USB devices besides the floppy drive which you wish to use, you will also need to edit /etc/rc.d/rc.local (or /etc/rc.d/init.d/usb) and add modprobe lines for the other appropriate drivers as well.
Once you have the usb-uhci and usb-storage drivers loaded, when you plug your floppy drive into the USB port it should be automatically recognized by the system. Please note, however, that the USB floppy drive will not show up as a traditional floppy drive (/dev/fd0) in the system, because it’s not actually attached to the system’s floppy controller. Instead, it appears as a removable SCSI drive, /dev/sda. You will need to edit /etc/fstab and change the reference to /dev/fd0 to be /dev/sda instead, and some other utilities may need to have their configurations changed. You can create a symbolic link from /dev/fd0 to /dev/sda, but this is not necessarily reccomended as it can confuse some software.
By default, Red Hat Linux is also designed to automatically change certain devices (including floppy drives) to be owned by whoever is currently logged-in to the console (text or X-windows), thus allowing the person physically seated at the computer to use software which accesses its floppy disk drive as well. In order to enable this behavior for the USB floppy, it is also necessary to edit /etc/security/console.perms file. Find the line which says:
=/dev/fd[0-1]*
..and tack /dev/sda on to the end of it, like so:
=/dev/fd[0-1]* /dev/sda
Please note also that, because the USB floppy shows up as a SCSI device, which are usually hard disks, a few utilities (such as mkdosfs) will complain about accessing the raw device (/dev/sda) without additional flags (in the case of mkdosfs, the -I flag), as normally writing to a hard disk device (instead of a partition on the disk) is not the correct thing to do, and some software isn’t bright enough to realize it’s not a hard disk.
Using a USB Keyboard
In order to make use of a USB mouse, you will need to load the usb-uhci driver, as detailed in the previous section, as well as the hid and keybdev modules.
Once these modules are loaded, you should simply be able to plug in a USB keyboard and start typing away.
Using a USB Mouse
As above, in order to make use of a USB mouse, you will need to load the usb-uhci and hid drivers, as well as loading the mousedev module. You will also need to create a new device file in the /dev directory for reading USB mouse events. To do this, type the following:
mknod /dev/usbmouse c 13 63
This is all the configuration required to allow software to access a USB mouse device. Now all that’s required is to configure the X window system to look for input from the USB mouse in addition to the PS/2 touchpad. This is done by modifying the /etc/X11/XF86Config file and adding the following lines to it:
Section “XInput”
Subsection “Mouse”
Protocol “IMPS/2″
Device “/dev/usbmouse”
ZAxisMapping 4 5
AlwaysCore
EndSubsection
EndSection
With these changes, you should be able to use any standard USB mouse automatically (including plugging and unplugging at any point as needed) with your Z505 system; or, as with everything else, you can simply download the fixup kit from the Software section.
Important Note
It is also possible to use only the USB mouse in X windows, ignoring the touchpad. However, if you choose to do this, be aware that there may be problems with the keyboard becoming unresponsive after suspending and resuming (this appears to be a bug with the BIOS not resetting the hardware properly after a resume). If you encounter this problem, you may need to edit /etc/rc.d/init.d/gpm and add the -R switch to the invokation of the gpm program, which should fix this issue. Do not add the -R option to gpm if you wish to use the touchpad under X windows, as the two will conflict with one another.
Ethernet lock-up workaround
Unfortunately, even with the newest 2.4 kernel, there is still a slight problem with the driver for Intel EtherExpress Pro 100 cards, which can manifest itself under some conditions on the Z505HE/HS. The problem goes something like this:
If:
• You have the eepro100 driver module loaded
• And you have the sound or USB driver modules loaded
• And you suspend the laptop
Then:
• When the laptop resumes, it will immediately stop responding and can only be woken up by a cold reboot.
There is, however, a workaround for this problem. The APM suspend/resume scripts must be modified to ensure that the eepro100 module is not loaded when the laptop is suspended. This is done by removing the module before the suspend actually takes place (it will be automatically loaded again when the eth0 device is used next). To do this, create an /etc/sysconfig/apm-scripts/apmcontinue file, with the following contents:
case “$1″ in
suspend)
/sbin/ifdown eth0
if lsmod | grep -q eepro100; then
rmmod eepro100 || exit 1
fi
esac

(If you already have an /etc/sysconfig/apm-scripts/apmcontinue file, simply add the above lines to the end of it) A more sophisticated version of this script is also available in the Software section which you may wish to use instead.
Configuring the CD-ROM drive
If you installed from the CD-ROM, then the CD-ROM will already have been detected and configured automatically by the installation program, and nothing more should be necessary. If, however, you chose the “Network Install” method, then the installer will not have done this for you, and you will need to configure the system properly for the CD-ROM device.
Under Red Hat Linux 6.2 this is quite easy. All that is required is to ensure that the CD-ROM’s PCMCIA card is inserted when the system boots up. The Red Hat “kudzu” hardware detection system will detect the presence of the CD-ROM drive and ask if you want to configure it. Alternately, you can run kudzu from the command line while the CD-ROM is connected to do the same thing.
If you want to perform this configuration manually, you will need to create a symbolic link from /dev/cdrom to /dev/hde, and add an appropriate entry to /etc/fstab
Screen Shifting on Resume
Under some conditions, after resuming from a suspend while viewing a graphical (X) console, the screen can end up shifted to the left. This is due to an apparent bug somewhere in resuming which allows text to be written to the screen while it’s in graphical mode, which wouldn’t normally be allowed. The process of writing this text results in the screen parameters being modified incorrectly for graphical mode, and the screen ends up shifted. Ironically enough, the reason text gets printed to the screen in the first place is partially the APM system’s fault. The stock configuration for Red Hat linux sets apmd so that it will write event notifications to all logged in users (the -W option). This is normally useful, or at least not harmful, however when APM writes its “successful resume” notification to all users, it also writes it to the console, screwing up any graphical display which may be there in the process.
This problem can be fixed by editing /etc/sysconfig/apmd, locating the line which reads:
ADDPARAMS=”-W”
and placing a # character in front of it, like so:
#ADDPARAMS=”-W”
You will then need to restart the apmd program with the new settings by running:
/etc/rc.d/init.d/apmd restart
Lockd Errors
After upgrading to the 2.4 kernel, depending on the system’s configuration, one may notice an error message from lockd on boot which reads:
Starting NFS lockd: lockdsvc: Invalid argument
This is due to a change in the handling of the NFS lockd system with the newer kernel. Under 2.4 kernels, it is no longer necessary to run the rpc.lockd program to enable NFS file locking. The Red Hat startup scripts, however, are continuing to run this program even though it is no longer needed, and it produces a (benign) error message. In response to this, one has two options:
• Ignore the message, which is perfectly safe to do, or
• Edit the system startup scripts to stop them from trying to run rpc.lockd
To do the latter of these options, edit /etc/rc.d/init.d/nfslock, and comment out the following lines by placing # characters in front of them:
(under the “start” section)
echo -n “Starting NFS lockd: “
daemon rpc.lockd
echo
(under the “stop” section)
echo -n “Shutting down NFS lockd: “
killproc lockd
echo
(and under the “restart” section)
echo -n “rpc.lockd “
killproc lockd
daemon rpc.lockd
Alternately, one can download an updated copy of the nfslock script from the Software section at the end of this document.
Tuning the Hard Disk
The default IDE configuration used by linux is a conservative one, designed to work properly across the widest range of hardware configurations. The IDE interface in the Z505, however, can operate substantially more efficiently if some non-default configuration parameters are used. These parameters can be adjusted using the hdparm command, like so:
/sbin/hdparm -c3 -m16 -d1 -k1 /dev/hda
To apply these configuration changes automatically whenever the system starts up, simply place the above line at the end of the /etc/rc.d/rc.local file.
Configuring IRDA
I have not personally attempted this (yet), but it has reportedly been done by others. According to Peter Whiting, the following entries are required in /etc/modules.conf in order to use IRDA successfully on the Z505:
alias tty-ldisc-11 irtty
alias char-major-161 ircomm_tty
alias irda0 nsc-ircc
options nsc-ircc dongle_id=0×09
In order to prevent the kernel’s default serial drivers from mistaking the IR port for a standard serial port and preventing the IRDA drivers from being able to use it, you must also add the following line to /etc/modules.conf:
pre-install nsc-ircc setserial /dev/ttyS2 port 0 irq 0
PPP With the 2.4 Kernel
The 2.4 kernel requires a newer version of the PPP utilities (2.4.0b1 or better) in order to have PPP function properly. In addition to the updated programs, however, there are also a couple of system changes which must be made to accomodate the newer kernel and utilities:
• The following lines must be added to /etc/modules.conf:
• alias char-major-108 ppp_generic
• alias tty-ldisc-14 ppp_synctty
• A /dev/ppp device must be created:
• mknod /dev/ppp c 108 0
(Note that since the built-in winmodem is not usable with linux, you will still need some additional (USB/PCMCIA/etc) modem device to do dial-up PPP connections with the Z505)

Using the Sony DVD Drive
The PCG-DVD51 DVD drive sold by Sony for use with the Z505 line will work with linux, under certain conditions. Unlike the CD-ROM drive, which uses a 16-bit PC-Card adapter, the Sony DVD drive uses a Cardbus (32-bit) PC-card which doesn’t quite work (yet) with linux. Luckily, the DVD drive’s card can also function as a 16-bit PC-card, which will work fine (if a little slower) with linux. The trick to doing this, interestingly enough, depends on the external power supply of the DVD drive.
When the DVD drive’s external power supply is plugged in, the card behaves as a Cardbus card. When it is not, it behaves as a 16-bit card. The trick, therefore, to using the DVD drive with linux, is fairly simple: Don’t plug it in. As long as you do not plug in the external power supply, the DVD drive should work fine.

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

Choosing a hardware platform for Linux

Posted in How To's by Shafkat Shahzad, M.Sc on April 23rd, 2009

This article will inform the user about the basics of choosing a hardware platform for Linux. The article will also provide guidance on how to make the right choices and hopefully keep you away from costly mistakes. Although Linux software is virtually free, the required hardware isn’t. This makes some people hesitate to jump into the Linux movement. But it doesn’t need to be complicated, scary or expensive. Linux runs on most common hardware.. If you currently have a system that adequately runs MS-Windows, you probably have all you need for a decent Linux system. Although Linux is more sophisticated than MS-Windows, it doesn’t require more hardware. In fact, because Linux is a pre-emptive multi-tasking system (this means that programs can be interrupted to service other requests), you can get a lot more useful work from the same computer.

CPU and RAM
To run Linux you need a 386 or higher processor. For text-based applications even a slow 386SX system will perform very well. Although the Linux kernel is capable of emulating floating point arithmetic functions, it is significantly slower than a math co-processor; either in the form of a separate chip or a 486DX or better that has a built-in co-processor. The server system at the Linux Journal advertising/editorial offices is a 386DX40. It has proved to be a great performer with three high-speed modem lines connected to it, a local user and 2 or more active telnet sessions. It has 8MB of RAM but an upgrade to 16MB is planned. The system we use for running X-windows is a 486DX33 with 16MB of RAM. The built-in co-processor and additional RAM make this an excellent workstation for compute-intensive work. Linux needs a system that is based on the ISA (AT) or EISA bus. Linux does not support MicroChannel Architecture (MCA) machines such as the IBM PS/2. It does, however, support local bus systems such as VESA and PCI. What you need will depend on what you intend to do with the system. The minimum RAM is 4MB. If you currently have a 386SX with 4MB of RAM, give it a try. It may do all that you want with no investment. If, however, you need to purchase hardware to run Linux, look at higher performance systems such as something based on a 486DX chip and at least 8MB of RAM. The additional cost is not very great for a large performance increase.

Disks
There are two considerations: type and size. Linux supports MFM, RLL, ESDI and IDE disks with virtually any controller board. It also supports a fairly wide assortment of SCSI controllers. If you already have a system, you can probably stick with what you have. But, if you are purchasing new hardware, SCSI disks are well worth considering. Here’s why: Many of the supported SCSI disk controllers use direct memory access (DMA) to transfer information. Under MS-DOS this has little advantage because MS-DOS (and MS-Windows) waits for input/output operations. On Linux, however, processing is overlapped with I/O. This means that a DMA controller can be transferring data while the CPU is processing other tasks. One of the most popular controllers supported by Linux is the Adaptec AH-1542C. It is relatively inexpensive, uses DMA and has reasonable performance. For EISA bus systems, the AH-1742 may be used. If your system has a VESA local bus, the Buslogic 445S controller seems to offer the best performance at a reasonable cost. Other supported SCSI controllers include the Adaptec 152x series, Allways IN2000, Adaptec 1542 clones (including Buslogic 445S and 447S and DTC 3290 and 3292), Seagate ST01 and ST02, Western Digital 7000, Trantor T128 and T130B, Ultrastor 14F and 24F. The SCSI HOWTO has many details that will help you weigh the costs and performance of the various SCSI controllers. Another consideration when choosing between IDE and SCSI disks is that you can have two disks with IDE controllers and with SCSI you can have up to seven. Selecting the disk size requires some forethought about what applications you’ll be running. The price of disk storage is dropping, and you can add one or more disks later on (depending upon your disk type). Linux can run on as small a partition as 20MB, but 200MB is a common size. Some applications may require disk sizes of 1GB or more.

CD-ROM
If you have a SCSI disk controller, a SCSI-based CD-ROM drive makes the most sense. It plugs into the same controller and works fine. With the advent of double and triple-speed CD-ROM drives, prices have dropped significantly on the single-speed drives which are adequate if all you intend to do is load files from a distribution CD-ROM. If you are not using SCSI disks, using a non-SCSI CD-ROM is more cost-effective. Although others are supported, drives made by Mitsumi (and marketed under many names including BSR and Tandy) work well. They include their own controller card and can usually be found in a good price range.

Printers
There is nothing special about Linux and printers. Standard parallel port connections are supported as well as serial port connections for printers. If you have a PostScript laser printer there are programs included with most Linux distributions that support these devices directly. If you don’t have a PostScript printer, ghostscript, a program that comes with most Linux distributions, will translate PostScript into the necessary control codes for most printers. If you choose this options, be aware that ghostscript’s default fonts are not as pretty as the fonts that come with a PostScript printer.

Serial Communications
Serial devices which include mice, modems and terminals can be connected to the system. Because Linux is multi-user as well as multi-tasking, multiple people can be using the computer system at one time. Most MS-DOS systems come with two serial ports. Linux can use these ports but you may want additional ports to support multiple devices. Serial communications boards come in various flavors. The standard 2-port board that comes in most systems uses 16450 UARTs (Universal Asynchronous Receiver Transmitters). This UART has no buffering which means the CPU must stop what it is doing and grab each input character. For one line running at 38,400 bits per second, this means that the processor could have to get a character about every .00025 seconds. With multiple ports this could consume most of the CPU time and result in dropped characters. The 16550A UART is very similar to the 16450 except it has a built-in 16 character buffer. This means that the processor could fetch characters 1/16th as often and still get all the input data. The difference in price is not that big between boards based on the 16450 and 16550A so it is well worth considering. Also, it is possible to replace the 16450s with 16550As in boards where the UARTS are in sockets. If you are considering adding ports, there are various 4, 8 and 16-port boards that use 16550As and support interrupt sharing. This means that up to 16 ports could be configured all on one board using one interrupt line on the bus. There are other serial communications boards that Linux supports or will soon support. Intelligent serial boards are boards that contain an on-board CPU. This CPU handles specifics of the serial transfer, freeing up more of the main CPU. They vary from boards with “intelligent UARTS” to those that include a general- purpose CPU and DMA I/O. Many manufacturers including Spectrix, Stallion, Computone, Arnet and DigiBoard make these boards. They require special drivers and, at this time, the only one supported is the Cyclades 8Y, which uses Cirrus Logic RISC chips. Performance-wise, these boards should offer better performance than the 16550A-based boards. An alternative to serial communications boards is a terminal server. This is a device that connects to the host system via Ethernet and handles serial communications itself. Any terminal server that supports the TCP/IP protocol should work with a Linux system.

Networking
Linux has built-in support for networking including TCP/IP and NFS. If you already have a network that supports TCP/IP protocol (used by Unix and other systems) you should be able to add your Linux box to the network. The one piece of hardware you will need is an Ethernet adapter. Ethernet comes in three flavors: thick-net, thin-net and UTP. Thick-net is thick coaxial cable where you connect to it via a tap and a transceiver with an AUI interface. Thick-net was the original but is no longer very popular. Most common today is thin-net, with UTP running second. Thin-net consists of machines connected on a single line of RG-58 coaxial cable. Each machine is connected using a BNC T-connector. Each end of the line is terminated with a 50-ohm terminator. Adding a new computer means either adding to the end of the line and moving the terminator along or splitting an existing cable and adding a new T. UTP (unshielded twisted pair) uses a different configuration. You have a hub and then the systems fan out from the hub. They are also called 10baseT where the T stands for twisted pair. Generally, thin-net is the least expensive, most practical approach. There are a large number of Ethernet boards out there. If you are looking for the quick answer; reasonable cost, reliability and reasonable performance, the WD8013 or SMC8013 card is a good choice. Other cards that generally work are NE2000 clones and the 3Com 3c503.

Video
Character-based Linux applications will work with any video board available for the PC. If, however, you want to run X-windows, you will need to select a supported video board. Although there is nothing difficult about supporting any boards, some manufacturers have refused to make the specifications available; therefore, Linux drivers could not be written for their hardware. One major vendor who has not released specifications (and is therefore not supported) is Diamond. The most cost-effective accelerated video boards supported by Linux are the low-end S3 boards. STB and Orchid are two vendors who have cards available that will be adequate for almost all Linux users. High-end S3 and ATI boards which are supported are available and will increase your video performance. You will want to check the XFree86-HOWTO for more current details when you are making your decision.

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

Manage Linux Hardware with udev

Posted in How To's by Shafkat Shahzad, M.Sc on April 23rd, 2009

udev handles the task of detecting hardware and creating nodes for it in /dev, and also managing device permissions. It works in concert with the Linux Hardware Abstraction Layer (HAL) and the hotplug subsystem. In effect, all devices, even internal drives and expansion cards, are treated as removable hotplug devices.
For udev lets you create fixed device names so you can make static entries in /etc/fstab, and don’t have to play hunt-the-widget every time you reboot. In fact your Linux distribution probably comes with a nice pre-fab configuration that assigns static names to certain devices, like hard drives and PCI network cards.
It’s a nice flexible, highly adaptable system, and when it’s configured correctly by your distribution maintainer your computing life is easy and fun.
It is important to note that there is a downside to udev. The downside is that it is still just a youth, so when you need to make some manual tweaks you have to figure out weirdo command syntax and how to uncover the device information you need. It’s simple when you know how. Well, maybe not even then.
udev’s rules are stored in configuration files in /etc/udev. Different distributions mangle this in different ways. Fedora and Ubuntu are sensible. There is /etc/udev/udev.conf, which contains program options, then all rules files are kept in /etc/udev/rules.d/ like they’re supposed to. Debian Etch, for gosh-knows-why, puts all the rules files in the top-level directory, and then has to symlink them all to /etc/udev/rules.d. udev rules must go in /etc/udev/rules.d.
The /sys directory is a cousin to /proc, only it’s well-organized rather than a chaotic mess. It exports kernel information into a human-browseable and program-parseable structure. Just like /proc uses the /proc filesystem, the /sys directory uses sysfs. You can see this with the mount command:
# mount proc on /proc type proc (rw) /sys on /sys type
sysfs (rw) udev on /dev type tmpfs (rw)
Notice how /dev uses tmpfs, which means wipeout on reboot.
/sys is chock full o symlinks, as you can see with the find /sys -type l command. You can browse /sys just like any other directory. Whether you’ll understand the contents is another question, but it doesn’t hurt to get familiar with its structure.
Because sysfs is a virtual filesystem like /proc, it doesn’t occupy any physical disk space. The Konqueror file browser on my system says it occupies 129.4 megabytes, but du tells a different story:
$ du -sh /sys 0 /sys
Writing udev Rules
Current releases of udev come with bales of man pages, and several different useful commands. On Debian systems, find them all with dpkg:
$ dpkg -L udev
On Fedora, use the rpm command:
$ rpm -ql udev
You’ll see there are different command sets for each distribution, and a pox on both of them for sowing useless confusion, so we’ll look at the important commands they have in common.
The first step for writing or modifying udev rules is to make sure that your kernel sees the device you want to make the rule for. (If the kernel doesn’t see it, you need to find out if your device is supported in Linux at all, then how to enable that support.) First try running the udevinfo command. This example dumps all devices in the udev database:
$ udevinfo -e
You may query individual devices, if you know the device path, as this example for an SATA partition shows:
$ udevinfo -a -p /block/sda/sda1
How do you know the device path? From udevinfo. You already know the node name for some of your devices, and can query it this way:
$ udevinfo -q all -n sda
Both of these commands spit out a lot of information. Just for fun, you can run lspci and match up the disk/by-path/pci values from udevinfo:
0000:00:0f.0 RAID bus controller: VIA Technologies, Inc. VIA
VT6420 SATA RAID Controller (rev 80)S: disk/by-path/pci-0000:00:0f.0-scsi-0:0:0:0-part1

The output of udevinfo is pretty cryptic, so this is one way to match it up to devices with names you recognize. For USB devices compare with the output of lsusb. SCSI devices compare to lsscsi.

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

Puppy Linux on USB flash Pen drive

Posted in How To's by Shafkat Shahzad, M.Sc on April 19th, 2009

In this simple USB Puppy Linux tutorial we illustrate how to easily install Puppy linux on a USB flash pen drive using the Universal installer included on the Puppy Linux CD. Puppy is a unique Linux compilation that is super small, yet contains many useful tools and utilities. Most versions of Puppy Linux will fit on even a 128MB USB stick. Making it great to install to those older tiny thumb drives you might have sitting around.
What you need to create a Portable Puppy Flash Drive
It is important to know that you need in order to create a portable puppy flash drive. These are provided below
• 128MB or larger USB Stick
• PC with a CD reader/burner
USB Puppy Flash Drive Installation process
Puppy Linux contains it’s own Universal Installer. The installation process is easy and straightforward. Following steps are required for the installation process.
1. Download Puppy linux ISO and burn the ISO to CD.
2. Start your computer via the Puppy CD.
3. Once Puppy has loaded, from the Taskbar, Click: Start > Setup > Puppy universal installer
4. Follow the onscreen instructions which will walk you through the Puppy USB installation process
5. When finished with the Puppy USB install, reboot your PC and go into system BIOS to change your boot order to boot from the USB device
6. Save your settings and reboot your PC to enjoy running Puppy Linux from USB
After going through the steps as mentioned, the Puppy linux will be installed on a USB flash pen drive

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

Linux Internet Web Server and Domain Configuration Tutorial

Posted in How To's by Shafkat Shahzad, M.Sc on April 18th, 2009

The tutorial will cover the Linux server configuration necessary to create a web site. The Apache web server, FTP server and DNS configuration are covered. The Apache web server is required to serve the web pages, the FTP server is required for users to upload content and the DNS server is required to resolve the domain names so that a URL entered into a web browser will point to your web server and properly serve the correct pages. The configurations presented will include virtual hosting which will allow a single Linux server to support multiple web site domains.

Prerequisites:
It is important to note the Prerequisites. This tutorial also assumes that a computer has Linux installed and running. A connection to the internet is also assumed. A connection of 128 Mbits/sec or greater will yield the best results. ISDN, DSL, cable modem or better are all suitable. A 56k modem will work but the results will be mediocre at best. The tasks must also be performed with the root user login and password.

Software Prerequisites:
The Apache web server (httpd), FTP (requires xinetd or inetd) and Bind (named) software packages with their dependencies are all required. One can use the rpm command to verify installation:
• Fedora Core 1+, Red Hat Enterprise 4, CentOS 4:
rpm -q httpd bind bind-chroot bind-utils system-config-bind xinetd vsftpd
RPMs added FC2+: system-config-httpd
RPMs added FC3+: httpd-suexec
• Red Hat 9.0
rpm -q httpd bind xinetd vsftpd
A Red Hat 8.0 wu-ftpd RPM may be installed (Newer version 2.6.2 or later with security fix wu-ftpd-2.6.2-11+) or install from source.
• Red Hat 8.0
rpm -q httpd bind xinetd wu-ftpd
• Red Hat 7.x:
rpm -q apache bind inetd wu-ftpd
Use wu-ftpd version 2.6.2 or later to avoid security problems.
• SuSE 9.3:
rpm -ivh apache2 apache2-prefork bind bind-chrootenv bind-utils vsftpd
Note: The apache2-MPM is a generic term for Apache installation options for “Multi-Processing Modules (MPM)s “prefork” or “worker”. If you try and only install apache2 you will get the following error:
apache2-MPM is needed by apache2-2.0.53-9
Also see Apache.org: MPMs
• Ubuntu (dapper 6.06/hardy 8.04) / Debian:
apt-get install apache2
apt-get install apache2-common
apt-get install apache2-mpm-prefork
apt-get install apache2-utils
apt-get install bind9
apt-get install vsftpd
One should also have a working knowledge of the Linux init process so that these services are initiated upon system boot. See the YoLinux init process tutorial for more info.

Apache HTTP Web server configuration:
This tutorial is for the Apache HTTP web server (Version 1.3 and 2.0). See the YoLinux list of Linux HTTP servers for a list of other web servers for the Hyper Text Transport Protocol.
The Apache configuration file is: /etc/httpd/conf/httpd.conf
Web pages are served from the directory as configured by the DocumentRoot directive. The default directory location is:
• Red Hat 7.x-9, Fedora Core, Red Hat Enterprise 4, CentOS 4: /var/www/html/
• Red Hat 6.x and older: /home/httpd/html/
• Suse 9.x: /srv/www/htdocs/
• Ubuntu (dapper 6.06/hardy 8.04) / Debian: /var/www/html
The default home page for the default configuration is index.html. Note the pages should not be owned by user apache as this is the process owner of the httpd web server daemon. If the web server process is comprimised, it should not be allowed to alter the files. The files should of course be readable by user apache.
Apache may be configured to run as a host for one web site in this fashion or it may be configured to serve for multiple domains. Serving for multiple domains may be achieved in two ways:
• Virtual hosts: One IP address but multiple domains - “Name based” virtual hosting.
• Multiple IP based virtual hosts: One IP address for each domain - “IP based” virtual hosting.
The default configuration will allow one to have multiple user accounts under one domain by using a reference to the user account: http://www.domain.com/~user1/. If no domain is registered or configured, the IP address may also be used: http://XXX.XXX.XXX.XXX/~user1/.
[Potential Pitfall] The default umask for directory creation is correct by default but if not use: chmod 755 /home/user1/public_html
[Potential Pitfall] When creating new “Directory” configuration directives, I found that placing them by the existing “Directory” directives to be a bad idea. It would not use the .htaccess file. This was because the statement defining the use of the .htaccess file was after the “Directory” statement. Previously in RH 6.x the files were separated and the order was defined a little different. I now place new “Directory” statements near the end of the file just before the “VirtualHost” statements.
For users of Red Hat 7.1, the GUI configuration tool apacheconf was introduced for the crowd who like to use pretty point and click tools.
Files used by Apache:
• Start/stop/restart script:
o Red Hat/Fedora/CentOS: /etc/rc.d/init.d/httpd
o SuSE 9.3: /etc/init.d/apache2
o Ubuntu (dapper 6.06/hardy 8.04) / Debian: /etc/init.d/apache2
• Apache main configuration file:
o Red Hat/Fedora/CentOS: /etc/httpd/conf/httpd.conf
o SuSE: /etc/apache2/httpd.conf
(Need to add directive: ServerName host-name)
o Ubuntu (dapper 6.06/hardy 8.04) / Debian: /etc/apache2/apache2.conf
• Apache suplementary configuration files:
o Red Hat/Fedora/CentOS: /etc/httpd/conf.d/component.conf
o SuSE: /etc/apache2/conf.d/component.conf
o Ubuntu (dapper 6.06/hardy 8.04) / Debian:
 Virtual domains: /etc/apache2/sites-enabled/domain
(Create soft link from /etc/apache2/sites-enabled/domain to /etc/apache2/sites-available/domain to turn on)
 Additional configuration directives: /etc/apache2/conf.d/
 Modules to load: /etc/apache2/mods-available/
(Soft link to /etc/apache2/mods-enabled/ to turn on)
 Ports to listen to: /etc/apache2/ports.conf
• /var/log/httpd/access_log and error_log - Red Hat/Fedora Core Apache log files
(Suse: /var/log/apache2/)
Start/Stop/Restart scripts: The script is to be run with the qualifiers start, stop, restart or status.
i.e. /etc/rc.d/init.d/httpd restart. A restart allows the web server to start again and read the configuration files to pick up any changes. To have this script invoked upon system boot issue the command chkconfig –add httpd. See Linux Init Process Tutorial for a more complete discussion.
Also Apache control tool: /usr/sbin/apachectl start
Apache Control Command: apachectl:
Red Hat / Fedora Core / CentOS: apachectl directive
Ubuntu dapper 6.06 / hardy 8.04 / Debian: apache2ctl directive

Directive description.
It is a good idea to know the description of the directive.

start
Start the Apache httpd daemon. Gives an error if it is already running.
stop
Stops the Apache httpd daemon.
graceful
Gracefully restarts the Apache httpd daemon. If the daemon is not running, it is started. This differs from a normal restart in that currently open connections are not aborted.
restart
Restarts the Apache httpd daemon. If the daemon is not running, it is started. This command automatically checks the configuration files as in configtest before initiating the restart to make sure the daemon doesn’t die.
status
Displays a brief status report.
fullstatus
Displays a full status report from mod_status. Requires mod_status enabled on your server and a text-based browser such as lynx available on your system. The URL used to access the status report can be set by editing the STATUSURL variable in the script.
Configtest-t
Run a configuration file syntax test.

Apache Configuration Files:
• /etc/httpd/conf/httpd.conf: is used to configure Apache. In the past it was broken down into three files. These may now be all concatenated into one file. See Apache online documentation for the full manual.
• /etc/httpd/conf.d/application.conf: All configuration files in this directory are included during Apache start-up. Used to store application specific configurations.
• /etc/sysconfig/httpd: Holds environment variables used when starting Apache.
Basic settings: Change the default value for ServerName www.
Giving Apache access to the file system: It is prudent to limit Apache’s view of the file system to only those directories necessary. This is done with the directory statement. Start by denying access to everything, then grant access to the necessary directories.
Deny access completely to file system root (”/”) as the default:

Options None
AllowOverride None

Grant access to a user’s directory:

AllowOverride None
order allow,deny
allow from all
Options Indexes Includes FollowSymLinks

OR
use the statement UserDir public_html which does this by default for every user account at $HOME/public_html. Change to a comment (add “#” at beginning of line) from Fedora Core default UserDir disable.
Also use SELinux command: setsebool httpd_enable_homedirs true
File permissions: The Apache web server daemon must be able to read your web pages in order to feed thier contents to the network. Use an appropriate umask and file protection. This works: chmod ugo+r -R public_html
One may also use groups to control permisions. See the YoLinux tutorial on managing groups.
[Potential Pitfall]: If the Apache web server can not access the file you will get the error “403 Forbidden” “You don’t have permission to access file-name on this server.” Note the default permissions on a user directory when first created with “useradd” are:
drwx—— 3 userx userx
You must allow the web server running as user “apache” to access the directory if it is to display pages held there.
Fix with command: chmod ugo+rx /home/userx
drwxr-xr-x 3 userx userx
SELinux security contexts:
Fedora Core 3 and Red Hat Enterprise Linux 4 introduced SELinux (Security Enhanced Linux) security policies and context labels.
To view the security context labels applied to your web page files use the command: ls -Z
The system enables/disables SELinux policies in the file /etc/selinux/config
SELinux can be turned off by setting the directive SELINUX. (Then reboot the system):
SELINUX=disabled

or using the command setenforce 0 to temporarily disable SELinux until the next reboot.
When using SELinux security features, the security context labels must be added so that Apache can read your files. The default security context label used is inherited from the directory for newly created files. Thus a copy (cp) must be used and not a move (mv) when placing files in the content directory. Move does not create a new file and thus the file does not recieve the directory security context label. The context labels used for the default Apache directories can be viewed with the command: ls -Z /var/www
The web directories of users (i.e. public_html) should be set with the appropriate context label (httpd_sys_content_t).
Assign a security context for web pages: chcon -R -h -t httpd_sys_content_t /home/user1/public_html
Options:
• -R: Recursive. Files and directories in current directory and all subdirectories.
• -h: Affect symbolic links.
• -t: Specify type of security context.
Use the following security contexts:
Context type descrioton
httpd_sys_content_t
Used for static web content. i.e. HTML web pages.
httpd_sys_script_exec_t
Use for executable CGI scripts or binary executables.
httpd_sys_script_rw_t
CGI is allowed to alter/delete files of this context.
httpd_sys_script_ra_t
CGI is allowed to read or append files of this context.
httpd_sys_script_ro_t
CGI is allowed to read files and directories of this context
Set the following options: setsebool httpd-option true
(or set to false)
Policy Description
httpd_enable_cgi
Allow httpd cgi support.
httpd_enable_homedirs
Allow httpd to read home directories.
httpd_ssi_exec
Allow httpd to run SSI executables in the same domain as system CGI scripts.
Then restart Apache:
• Red Hat/Fedora/Suse and all System V init script based Linux systems: /etc/init.d/httpd restart
• Red Hat/Fedora: service httpd restart
The default SE boolean values are specified in the file: /etc/selinux/targeted/booleans
Virtual Hosts:
The Apache web server allows one to configure a single computer to represent multiple websites as if they were on separate hosts. There are two methods available and we describe the configuration of each. Choose one method for your domain:
• Name based virtual host: (most common) A single computer with a single IP adress supporting multiple web domains. The web browser using the http protocol, identifies the domain being addressed.
• IP based virtual host: The virtual hosts can be configured as a single multi-homed computer with multiple IP addresses on a single network card, with each IP address representing a different web domain. This has the appearance of a web domain supported by a dedicated computer because it has a dedicated IP address.
Configuring a “name based” virtual host:
A virtual host configuration allows one to host multiple web site domains on one server. (This is not required for a dedicated linux server which hosts a single web site.)

NameVirtualHost XXX.XXX.XXX.XXX

ServerName www.your-domain.com - CNAME (bind DNS alias www) specified in Bind configuration file (/var/named/…)
ServerAlias your-domain.com - Allows requests by domain name without the “www” prefix.
ServerAdmin user1@your-domain.com
DocumentRoot /home/user1/public_html
ErrorLog logs/your-domain.com-error_log
TransferLog logs/your-domain.com-access_log

Important note
It is important to note following
• You can specify more than one IP address. i.e. if web server is also being used as a firewall/gateway and you have an external internet IP address as well as a local network IP address.
NameVirtualHost XXX.XXX.XXX.XXX
NameVirtualHost 192.168.XXX.XXX


..
• Use your IP address for XXX.XXX.XXX.XXX, actual domain name and e-mail address.
One can use DNS views to provide different local network DNS results.
• http://www.domain-name.com and http://domain-name.com.
• Once virtual hosts are configured, your default system domain (/var/www/html) will stop working. Your default domain now must be configured as a virtual domain.

… This part remains the same
..

# Add a VirtualHost definition for what was once the default.

ServerName www.your-domain.com
ServerAlias your-domain.com
ServerAdmin user1@your-domain.com
DocumentRoot /var/www/html
ErrorLog logs/error_log
TransferLog logs/access_log


..
• Forwarding to a primary URL. It is best to avoid the appearance of duplicated web content from two URLs such as http://www.your-domain.com and http://your-domain.com. Supply a forwarding Apache “Redirect”.
# Add a VirtualHost definition to forward to your primary URL

ServerName your-domain.com
ServerAlias other-domain.com
ServerAlias www.other-domain.com
Redirect permanent / http://www.your-domain.com.com/


..
• When specifying more domains, they may all use the same IP address or some/all may use their own unique IP address. Specify a “NameVirtualHost” for each IP address.
After the Apache configuration files have been edited, restart the httpd daemon: /etc/rc.d/init.d/httpd restart (Red Hat) or /etc/init.d/apache2 restart (Ubuntu / Debian)
Apache virtual domain configuration with Ubuntu Dapper/Hardy:
Ububntu separates out each virtual domain into a separate configuration file held in the directory /etc/apache2/sites-available/. When the site domain is to become active, a soft link is created to the directory /etc/apache2/sites-enabled/.
Example: /etc/apache2/sites-available/supercorp

ServerName supercorp.com
ServerAlias www.supercorp.com
ServerAdmin webmaster@localhost

DocumentRoot /home/supercorp/public_html/home

Options FollowSymLinks
AllowOverride None

Options Indexes FollowSymLinks MultiViews
IndexOptions SuppressLastModified SuppressDescription
AllowOverride All
Order allow,deny
allow from all

ScriptAlias /cgi-bin/ /home/supercorp/cgi-bin/

AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all

ErrorLog /var/log/apache2/supercorp.com-error.log

# Possible values include: debug, info, notice, warn, error,
# crit, alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/supercorp.com-access.log combined
ServerSignature On

Enable domain:
• Create soft link:
o Manually: ln -s /etc/apache2/sites-available/supercorp /etc/apache2/sites-enabled/supercorp
o Use Ubuntu scripts a2ensite/a2dissite. Type command and it will prompt you as to which site you would like to enable or disable.
• Restart Apache:
o apache2ctl graceful
or
o /etc/init.d/apache2 restart
or
o /etc/init.d/apache2 reload
Also note that Apache modules can also be enabled/disabled with scripts a2enmod/a2dismod.
Configuring an “IP based” virtual host:
One may assign multiple IP addresse to a single network interface. See the YoLinux networking tutorial: Network Aliasing. Each IP address may then be it’s own virtual server and individual domain. The downside of the “IP based” virtual host method is that you have to possess multiple/extra IP addresses. This usually costs more. The standard name based virtual hosting method above is more popular for this reason.

NameVirtualHost * - Indicates all IP addresses

ServerAdmin user0@default-domain.com
DocumentRoot /home/user0/public_html

ServerAdmin user1@domain-1.com
DocumentRoot /home/user1/public_html

ServerAdmin user1@domain-2.com
DocumentRoot /home/user2/public_html

The default block will be used as the default for all IP addresses not specified explicitly. This default IP (*) may not work for https URL’s.
CGI: (Common Gateway Interface)
CGI is a program executable which dynamically generates a web page by writing to stdout. CGI is permitted by either of two configuration file directives:
• ScriptAlias:
o Red Hat 7.x-9, Fedora core: ScriptAlias /cgi-bin/ “/var/www/cgi-bin/”
o Red Hat 6.x and older: ScriptAlias /cgi-bin/ “/home/httpd/cgi-bin/”
o Suse 9.x: ScriptAlias /cgi-bin/ “/srv/www/cgi-bin/”
o Ubuntu (dapper/hardy) / Debian: ScriptAlias /cgi-bin/ “/usr/lib/cgi-bin/”
or
• Options +ExecCGI:

Options +ExecCGI

The executable program files must have execute privileges, executable by the process owner (Red Hat 7+/Fedora Core: apache. Older use nobody) under which the httpd daemon is being run.
Configuring CGI To Run With User Privileges:
The suEXEC feature provides Apache users the ability to run CGI and SSI programs under user IDs different from the user ID of the calling web-server. Normally, when a CGI or SSI program executes, it runs as the same user who is running the web server.

NameVirtualHost XXX.XXX.XXX.XXX

ServerName node1.your-domain.com - Allows requests by domain name without the “www” prefix.
ServerAlias your-domain.com www.your-domain.com - CNAME (alias www) specified in Bind configuration file (/var/named/…)
ServerAdmin user1@your-domain.com
DocumentRoot /home/user1/public_html/your-domain.com
ErrorLog logs/your-domain.com-error_log
TransferLog logs/your-domain.com-access_log

SuexecUserGroup user1 user1

Options +ExecCGI +Indexes
AddHandler cgi-script .cgi

ERROR Pages:
You can specify your own web pages instead of the default Apache error pages:
ErrorDocument 404 /Error404-missing.html
Create the file Error404-missing.html in your “DocumentRoot” directory.
PHP:
If the appropriate php, perl and httpd RPM’s are installed, the default Red Hat Apache configuration and modules will support PHP content. RPM Packages (RHEL4):
• php: HTML-embedded scripting language
• php-pear: PEAR is a framework and distribution system for reusable PHP components.
• php-mysql: MySQL database support.
• php-ldap: Lightweight Directory Access Protocol (LDAP) support
Apache configuration:
Add php default page index.php to apache config file: /etc/httpd/conf/httpd.conf

DirectoryIndex index.html index.htm index.php

PHP Configuration File:
• RHEL4 - PHP 4.3: /etc/php.ini
• Ubuntu Daper 6.06/6.11: /etc/php5/apache2/php.ini
[PHP]
engine = On


display_errors = Off
include_path = “.:/php/includes”


memory_limit = 32M ; Default is typically 8MB which is too low.

[MySQL]


mysql.default_host = superserver ; Hostname of the computer
mysql.default_user = dbuser

Note that changes will not take effect until the apache web server daemon is restarted.
Test you PHP capabilities with this test file: /home/user1/public_html/test.php

OR (older format)

Test: http://localhost/~user1/test.php

Running Multiple instances of httpd:
The Apache web server daemon (httpd) can be started with the command line option “-f” to specify a unique configuration file for each instance. Configure a unique IP address for each instance of Apache. See the YoLinux Networking Tutorial to specify multiple IP addresses for one NIC (Network Interface Card). Use the Apache configuration file directive Listen XXX.XXX.XXX.XXX, where the IP address is unique for each instance of Apache.

Apache Man Pages:
• httpd - Apache Hypertext Transfer Protocol Server
• apachectl - Apache HTTP Server Control Interface
• ab - Apache HTTP server benchmarking tool
• htdigest - manage user files for digest authentication
• htpasswd - Manage user files for basic authentication
• logresolve - Resolve IP-addresses to hostnames in Apache log files
• rotatelogs - Piped logging program to rotate Apache logs
Apache Red Hat / Fedora Core GUI configuration:
GUI configuration tool:
• Fedora Core 2/3/4: /usr/bin/system-config-httpd
• Red Hat 8/9, Fedora Core 1: /usr/bin/redhat-config-httpd
Adding web site login and password protection: See the YoLinux tutorial on web site password protection.
Log file analysis:
Scanning the Apache web log files will not provide meaningfull statistics unless they are graphed or presented in an easy to read fashion. The following packages to a good job of presenting site statistics.
• Analog - Also see Report Magic for Analog
• Webalizer
• AWStats - (requires PERL)
Web site statistic services:
• eXTReMe Tracking
Load testing your server:
• PureLoad - JAVA load testing and reporting tool.
• WebPerformance Trainer - Load Testing Tools.
Apache Links:
• CgiWrap - setuid wrapper that allows users to install and execute their own cgi scripts that get executed as their own userid
• Thumbprint - CGI for viewing a directory of images as thumbnails
• WWWThreads.org - Commercial product - Advanced Web Conferencing Software
• Configuring https (mod_ssl):
o Mod_SSL.org: Home Page
o Mod_SSL.org: Mod_SSL HowTo
o Mod_SSL.org: Steps to create SSL server certificate
o https configuration

Log file analysis using Analog:
Installation:
• Red Hat / Fedora: yum install analog
• Ubuntu / Debian: apt-get install analog
Configuration file: /etc/analog.cfg

LOGFILE /var/log/httpd/yourdomain.com-access_log* http://www.yourdomain.com
UNCOMPRESS *.gz,*.Z “gzip -cd”
SUBTYPE *.gz,*.Z
#
OUTFILE /home/user1/public_html/analog/Report.html
#
HOSTNAME “YourDomain.com”
HOSTURL http://www.yourdomain.com

….

..

REQINCLUDE pages # Request page stats only
ALL ON
LANGUAGE US-ENGLISH

One can view the settings which be used with your configuration file (also good for debugging): analog -settings
Make Analog images available to the users report: ln -s /usr/share/analog/images/* /home/user1/public_html/analog
Log file location:
• Red Hat / Fedora: /var/log/httpd/
• Ubuntu / Debian: /var/log/apache2/
The Directive ALL ON turns on all of the following:

Analog Directive Description
MONTHLY ON
one line for each month
WEEKLY ON
one line for each week
DAILYREP ON
one line for each day
DAILYSUM ON
one line for each day of the week
HOURLYREP ON
one line for each hour of the day
GENERAL ON
the General Summary at the top
REQUEST ON
which files were requested
FAILURE ON
which files were not found
DIRECTORY ON
Directory Report
HOST ON
which computers requested files
ORGANISATION ON
which organisations they were from
DOMAIN ON
which countries they were in
REFERRER ON
where people followed links from
FAILREF ON
where people followed broken links from
SEARCHQUERY ON
the phrases and words they used…
SEARCHWORD ON
…to find you from search engines
BROWSERSUM ON
which browser types people were using
OSREP ON
and which operating systems
FILETYPE ON
types of file requested
SIZE ON
sizes of files requested
STATUS ON
number of each type of success and failure

Cron job to handle multiple domains: /etc/cron.daily/analog
#!/bin/sh
cp /opt/etc/analog-domain1.com.cfg /etc/analog.cfg
/usr/bin/analog
cp /opt/etc/analog-domain2.com.cfg /etc/analog.cfg
/usr/bin/analog


Measuring Web Server Performance:
Web performance benchmarking tool httperf. Httperf sends requests to the web server at a specified rate and gathers stats. Increase till one finds the saturation point.
Installation:
• Debian: apt-get install httperf
Example useage:
• Print performance stats for home page of yourdomain.com: httperf –hog –server www.yourdomain.com
• Create 100 connections at a rate of 10/sec: httperf –hog –server http://www.yourdomain.com/ –num-conn 100 –rate 10 –timeout 5
• Generate 10 sessions at a rate of i seesion/sec every 2 seconds: httperf –hog –ser=www –wsess=10,5,2 –rate 1 –timeout 5
httperf command line options:
Commands and their descriptions
–hog
Use as many TCP ports as necessary to generate stats (else limited to port 1024-5000)
–num-calls
Session oriented workloads.
–max-connections=#
Limit the number of connections to that specified.
–num-calls=#
Specify the number of calls to issue on each connection before closing it.
–server host-name
Default localhost. Specify IP address of host name.
–wsess=N1,N2,X
Specify session where
N1: number of sessions
N2: number of calls per session
X: delay between calls (sec)
–timeout
Stop if there is no response within timeout period.

FTPd and FTP user account configuration
Many FTP programs exist. This example covers the popular vsftpd (Red Hat default 9.0, Fedora Core, Suse) and wu-ftpd (Washington University) program which comes standard with RedHat (last shipped with RedHat 8.0 but can be installed on any Linux system). (RPM: wu-ftpd) There are other FTP programs including proFtpd (supports LDAP authentication, Apache like directives, full featured ftp server software), bftpd, pure-ftpd (free BSD and optional on Suse), etc …
FTPd configuration tutorials:
• # vsFTPd: Configuration
• # WU-FTPd: Configuration
• # FTP Clients: Links
vsFTPd and FTP user account configuration
The vsFTPd ftp server was first made available in Red Hat 9.0. It has been adopted by Suse and OpenBSD as well. This is currently the recomended FTP daemon for use on FTP servers.
Enable vsftpd:
• Red Hat/Fedora Core/CentOS: VsFTPd is a stand alone service and by the default Fedora Core installation, not controlled by xinetd as is the wu-ftpd default installation.
Thus start service: service vsftpd start (or: /etc/init.d/vsftpd start)
Configure vsftpd to start upon system boot: chkconfig –add vsftpd
• SuSE: By default, the vsftpd is an xinetd controlled service. To enable FTP server services edit the file /etc/xinetd.d/vsftpd and change:
disable = yes
to:
disable = no
Restart the xinetd daemon: /etc/init.d/xinetd restart
Note: vsftpd can also be run as a stand-alone service to achieve a faster response time.
• Ubuntu (dapper/hardy) / Debian:
o Install: apt-get install vsftpd
o VsFTPd is a stand alone service.
 Start: /etc/init.d/vsftpd start
 Stop: /etc/init.d/vsftpd stop
 Restart: /etc/init.d/vsftpd restart
(Use this command after making configuration file changes)

Configuration files:
• vsFTPd configuration file:
o Fedora Core / Red Hat: /etc/vsftpd/vsftpd.conf
o S.u.S.e. / Ubuntu (dapper/hardy) / Debian: /etc/vsftpd.conf
Default for Fedora Core 3:
anonymous_enable=YES - Anonymous FTP allowed by default if you comment this out. Default directory used: /var/ftp

local_enable=YES - Uncomment this to allow local users to log in with FTP.

write_enable=YES - Uncomment this to enable any form of FTP write or upload command.

local_umask=022 - Default is 077. Umask 022 is used by most other ftpd’s.

#anon_upload_enable=YES - Uncomment to allow the anonymous FTP user to upload files.
Requires the above global write enabled. Directory must also be writable by user.
#anon_mkdir_write_enable=YES - Uncomment this to allow the anonymous FTP user to be able to create new directories.

dirmessage_enable=YES - Activate directory messages.
Messages given to remote users when they enter certain directories
xferlog_enable=YES - Activate logging of uploads/downloads.
connect_from_port_20=YES - PORT transfer connections originate from port 20 (ftp-data)
#chown_uploads=YES - Uploaded anonymous files set to a specified owner. (not root)
#chown_username=whoever
#xferlog_file=/var/log/vsftpd.log - Specify logfile explicitly. Default is /var/log/vsftpd.log
xferlog_std_format=YES - Output to log file in standard ftpd xferlog format
#idle_session_timeout=600 - Set timing out for an idle session.
#data_connection_timeout=120- Set timing out for an idle data connection. Port 20
#nopriv_user=ftpsecure - Run ftp server as an isolated and unprivileged user.
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it, may confuse older FTP clients.
#async_abor_enable=YES
#ascii_upload_enable=YES - Improve performance by disabling ASCII mode. Disables command “ascii” and “SIZE /big/file”.
#ascii_download_enable=YES
#ftpd_banner=Welcome to YoLinux - Customize the login banner string.
#deny_email_enable=YES - Disallow specified anonymous e-mail addresses. Used to combat certain DoS attacks.
#banned_email_file=/etc/vsftpd.banned_emails (default)
#chroot_list_enable=YES- List users chroot()’d to their home directory. If “NO”, list users not chroot()’d.
#chroot_list_file=/etc/vsftpd.chroot_list (default)
ls_recurse_enable=YES- Allow “ls -R” recursive directory list. Default is disabled.
pam_service_name=vsftpd
userlist_enable=YES - (Default) Deny users specified in file /etc/vsftpd.user_list If “userlist_enable=NO” then allow specified users.
#deny_email_enable=YES - Disallow specified anonymous e-mail addresses. Used to combat certain DoS attacks.

listen=YES - Enable for standalone mode as opposed to an xinetd service.
tcp_wrappers=YES

Restart the FTP service if the config file is changed: service vsftpd restart (or: /etc/init.d/vsftpd restart)
[Potential Pitfall]: vsftp does NOT support comments on the same line as a directive. i.e.:
directive=XXX # comment
vsftp.conf man page
• Specify list of local users chrooted to their home directories: /etc/vsftpd/vsftpd.chroot_list
(Requires: chroot_list_enable=YES)
user1
user2

user-n
• If userlist_enable=NO, then specify users not to be chroot’d..
• Specify list of users: /etc/vsftpd.user_list
(Deny list of users requires: userlist_enable=YES)
Also see PAM configuration below.
root
bin
daemon
adm
lp
sync
shutdown
halt

• If userlist_enable=NO, then specify valid users.
• PAM configuration file Fedora Core 3: /etc/pam.d/vsftpd
#%PAM-1.0
auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd.ftpusers onerr=succeed
auth required pam_stack.so service=system-auth
auth required pam_shells.so
account required pam_stack.so service=system-auth
session required pam_stack.so service=system-auth
• This causes PAM to check /etc/vsftpd.ftpusers for users who are denied. This duplicates /etc/vsftpd.user_list. Speciy user in both files.
• File: /etc/vsftpd.ftpusers
root
bin
daemon
adm
lp
sync
shutdown
halt

• Logrotate configuration file: /etc/logrotate.d/vsftpd.log
/var/log/xferlog {
# ftpd doesn’t handle SIGHUP properly
nocompress
missingok
}
Sample vsFTPd configurations:
• Anonymous download FTP server configuration: /etc/vsftpd/vsftpd.conf
# Access rights
anonymous_enable=YES - Turn on anonymous FTP
chown_uploads=YES - Uploaded files owned by an assigned user
chown_username=ftp - Uploaded files owned by this assigned user
local_enable=NO
write_enable=NO - No upload of files system changes allowed
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
# Security
anon_world_readable_only=YES
connect_from_port_20=YES
force_dot_files=NO
guest_enable=NO
hide_ids=YES
pasv_min_port=50000
pasv_max_port=60000
# Features
xferlog_enable=YES
ls_recurse_enable=NO
ascii_download_enable=NO
async_abor_enable=YES
# Performance
one_process_model=NO
idle_session_timeout=120
data_connection_timeout=300
accept_timeout=60
connect_timeout=60
max_per_ip=4
anon_max_rate=50000

pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YES
• Anonymous logins use the login name “anonymous” and then the user supplies their email address as a password. Any password will be accepted. Used to allow the public to download files from an ftp server. Generally, no upload is permitted.
• Web hosting configuration: /etc/vsftpd/vsftpd.conf
# Access rights
anonymous_enable=NO
local_enable=YES - Allow users to ftp to their home directories
write_enable=YES - Allow users to STOR, DELE, RNFR, RNTO, MKD, RMD, APPE and SITE
local_umask=022
# Security
connect_from_port_20=YES
force_dot_files=NO
guest_enable=NO - Don’t remap user name
ftpd_banner=Welcome to Super Duper Hosting - Customize the login banner string.
chroot_local_user=YES - Limit user to browse their own directory only
chroot_list_enable=YES - Enable list of system / power users
chroot_list_file=/etc/vsftpd.chroot_list - Actual list of system / power users
hide_ids=YES
pasv_min_port=50000
pasv_max_port=60000
# Features
xferlog_enable=YES
ls_recurse_enable=NO
ascii_download_enable=NO
async_abor_enable=YES
dirmessage_enable=YES - Message greeting held in file .message or specify with message_file=…
# Performance
one_process_model=NO
idle_session_timeout=120
data_connection_timeout=300
accept_timeout=60
connect_timeout=60
max_per_ip=4
#
pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YES
• Specify list of local users chrooted to their home directories: /etc/vsftpd/vsftpd.chroot_list
Ubuntu typically: /etc/vsftpd.chroot_list
(Requires: chroot_list_enable=YES)
user1
user2

user-n
• If userlist_enable=NO, then specify users not to be chroot’d..
• [Potential Pitfall]: Mispelling a directive will cause vsftpd to fail with little warning.
• File: .message
A NOTE TO USERS UPLOADING FILES:
File names may consist of letters (a-z, A-Z), numbers (0-9),
an under score (”_”), dash (”-”) or period (”.”) only.
The file name may not begin with a period or dash.
Test if vsftp is listening: netstat -a | grep ftp
[root]# netstat -a | grep ftp
tcp 0 0 *:ftp *:* LISTEN
WU-FTPd and FTP user account configuration:
There are three kinds of FTP logins that wu-ftpd provides:
• anonymous FTP - one logs in with the username ‘anonymous’
• real FTP - log in with a real username and password and has access to the entire disk structure.
• guest FTP - one logs in with a real user name and password, but the user is chroot’ed to his home directory and cannot escape from it. They are constrained to their home directory which also means that they don’t have access to /bin/ls and other commands on the server. Thus a local minimalist environment must be set up.
This tutorial covers “guest” FTP configuration.
The file /etc/ftpaccess controls the configuration of ftp.
# Don’t allow system accounts to log in over ftp
deny-uid %-99 %65534-
deny-gid %-99 %65534-

class all real,guest *
email webmaster@your-domain.com
loginfails 5

readme README* login
readme README* cwd=*
message /welcome.msg login
message .message cwd=*

compress yes all
tar yes all
chmod no guest,anonymous
delete no anonymous # delete files permission?
overwrite no anonymous # overwrite files permission?
rename no anonymous # rename files permission?
delete yes guest # delete files permission?
overwrite yes guest # overwrite files permission?
rename yes guest # rename files permission?
umask no guest # umask permission?

log transfers anonymous,real inbound,outbound

shutdown /etc/shutmsg

passwd-check rfc822 warn

# Must also create message file /etc/pathmsg of the guest directory.
# In this case it refers to /home/user1/public_html/etc/pathmsg.
path-filter guest /etc/pathmsg ^[-A-Za-z0-9_\.]*$ ^\. ^-
limit all 2
noretrieve passwd .htaccess core - Do not allow users to download files of these names
limit-time * 20
byte-limit in 5000 - Limit file size
guestuser * - Set system user default to be categorized as a “guest”. A “real” user can roam the system. Guestuser is chrooted.
realgroup regularuserx regularusery - Assign real user privileges to members of groups “regularuserx” and “regularusery”.
Visibility of the whole file system and subject to regular UNIX file permissions
realuser user4 - Assign real user privileges to user id “user4″.

restricted-uid user1 user2 user3 - Restricts FTP to the specified directories
guest-root /home/user1/public_html user1
guest-root /home/user2/public_html user2
guest-root /home/user3/public_html user3

Important note
• user1, user2 and user3 refer to login accounts. Use the appropriate login name.
• The above configuration disables anonymous FTP which allows anyone to perform an FTP login with the id anonymous and an email address as a password. To enable anonymous FTP, change the class directive to:
class all real,guest,anonymous *
• GUI FTP configuration tools:
o /usr/bin/kwuftpd
o /sbin/linuxconf
(Note: Linuxconf is no longer included with Red Hat 7.3 and later)

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

USB Kubuntu 8.04.1 Persistent install from Live CD

Posted in How To's by Shafkat Shahzad, M.Sc on April 16th, 2009

Kubuntu is a derivative of Ubuntu based on the KDE desktop environment. The tutorial will cover the process of installing Kubuntu 8.04 to a USB flash drive via a running Kubuntu 8 Live CD. Similar to the Ubuntu 8.04 persistent install, the casper persistence feature is being utilized to enable a user to save and restore changes on subsequent boots. It is important to note that you must use 8.04.1as the tutorial will not work with the older 8.0.4 version.

Essentials for Kubuntu 8.04.1 USB installation
Following are the essentials for Kubuntu 8.04.1 USB installation
• Working CD Drive and a Kubuntu 8.04.1 CD
• Established internet connection
• 1GB or larger USB flash drive

How to install Kubuntu 8.04.1 to a USB flash drive
Let’s have a look at the steps that are required to install Kubuntu 8.04.1 to a USB flash drive
1. Download the Kubuntu 8.04.1 ISO and burn it to a CD
2. Restart your computer and boot from the Kubuntu CD
3. Insert a 1GB or larger USB flash drive
4. Open a terminal window and type sudo su
5. Now type fdisk -l to list available drives/partitions (note which device is your flash drive Example: /dev/sdb). Throughout this tutorial, replace all instances of x with your flash drive letter. For example, if your flash drive is sdb, replace x with b.
6. Type umount /dev/sdx1
7. Type fdisk /dev/sdx
o type p to show the existing partition and d to delete it
o type p again to show any remaining partitions (if partitions exist, repeat the previous step)
o type n to make a new partition
o type p for primary partition
 type 1 to make this the first partition
 hit enter to use the default 1st cylinder
 type +750M to set the partition size
 type a to make this partition active
 type 1 to select partition 1
 type t to change the partition filesystem
 type 6 to select the fat16 file system
o type n to make another new partition
o type p for primary partition
 type 2 to make this the second partition
 hit enter to use the default cylinder
 hit enter again to use the default last cylinder
 type w to write the new partition table
8. Type umount /dev/sdx1 to unmount the partition
9. Type mkfs.vfat -F 16 -n kubuntu8 /dev/sdx1 to format the first partition
10. Type umount /dev/sdx2 to ensure the partition is unmounted
11. Type mkfs.ext2 -b 4096 -L casper-rw /dev/sdx2 to format the second partition
12. Remove and re-insert your flash drive (if prompted that a new medium has been detected, select to open in a new window and click ok)
13. Back at the terminal, type sudo apt-get install syslinux mtools
14. Type syslinux -sf /dev/sdx1
15. Type cd /cdrom
16. Type cp -rfv casper dists install pics pool preseed .disk isolinux/* md5sum.txt README.diskdefines install/mt86plus /media/kubuntu8
17. Type cd /media/kubuntu8
18. Type wget pendrivelinux.com/downloads/ku8/syslinux.cfg
19. Type cd casper
20. Type rm initrd.gz
21. Type wget pendrivelinux.com/downloads/ku8/initrd.gz
22. Reboot your computer and set your system BIOS boot priority to boot from the USB stick.
Now you should be able to boot kubuntu 8.04 from the USB flash device and by default it should save your changes, restoring them on boot.
Important note
Please not that if you are having any problems getting Ubuntu to boot, your memory stick may have a corrupted MBR. To repair the MBR of your USB device, at the terminal type sudo apt-get install lilo then type lilo -M /dev/sdx (replacing x with the letter of your flash device)

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

USB Xubuntu 8.04.1 Persistent install from Live CD- done

Posted in How To's by Shafkat Shahzad, M.Sc on April 16th, 2009

The tutorial will cover the process of installing Xubuntu 8.04.1 Hardy Heron to a USB flash drive via a running Xubuntu 8 Live CD. Xubuntu uses the xfce desktop environment. The xfce desktop environment is a slim yet very powerful GUI. Making Xubuntu less of a resource hog than KDE or Gnome. Xubuntu works well on slower or older computers. In this Linux USB installation tutorial, the casper persistence feature is used to retain and retrieve changes on subsequent boots.
It is important to note that it works using Xubuntu 8.04.1 only.

Prerequisites for Xubuntu 8.04.1 USB installation:
Let’s have a look at the pre requisites for Xubuntu 8.04.1 USB installation
• CD Drive and the Xubuntu 8.04.1CD
• Working internet connection
• 1GB or larger USB flash drive

How to install Xubuntu 8.04.1 to a USB flash drive:
Please follow the steps as required for installing the Xubuntu 8.04.1 to a USB flash drive:
1. Download the Xubuntu 8.04.1 ISO and burn it to a CD
2. Restart your computer, booting from the Xubuntu CD
3. Insert a 1GB or larger USB flash drive
4. Open a terminal window and type sudo su
5. Now type fdisk -l to list available drives/partitions (note which device is your flash drive Example: /dev/sdb). Throughout this tutorial, replace all instances of x with your flash drive letter. For example, if your flash drive is sdb, replace x with b.
6. Type umount /dev/sdx1
7. Type fdisk /dev/sdx
o type p to show the existing partition and d to delete it
o type p again to show any remaining partitions (if partitions exist, repeat the previous step)
o type n to make a new partition
o type p for primary partition
 type 1 to make this the first partition
 hit enter to use the default 1st cylinder
 type +750M to set the partition size
 type a to make this partition active
 type 1 to select partition 1
 type t to change the partition filesystem
 type 6 to select the fat16 file system
o type n to make another new partition
o type p for primary partition
 type 2 to make this the second partition
 hit enter to use the default cylinder
 hit enter again to use the default last cylinder
 type w to write the new partition table
8. Type umount /dev/sdx1 to unmount the partition
9. Type mkfs.vfat -F 16 -n xubuntu8 /dev/sdx1 to format the first partition
10. Type umount /dev/sdx2 to ensure the partition is unmounted
11. Type mkfs.ext2 -b 4096 -L casper-rw /dev/sdx2 to format the second partition
12. Remove and re-insert your flash drive (if prompted that a new medium has been detected, select to open in a new window and click ok)
13. Back at the terminal, type sudo apt-get install syslinux mtools
14. Type syslinux -sf /dev/sdx1
15. Type cd /cdrom
16. Type cp -rfv casper dists install pics pool preseed .disk isolinux/* md5sum.txt README.diskdefines casper/vmlinuz /media/xubuntu8/
17. Type cd /media/xubuntu8
18. Type wget pendrivelinux.com/downloads/xu8/syslinux.cfg
19. Type cd casper
20. Type rm initrd.gz
21. Type wget pendrivelinux.com/downloads/xu8/initrd.gz
22. Reboot your computer and set your BIOS boot priority or Boot Menu to boot from the USB device. Save your changes and proceed to boot from the USB device
You should now be booting Xubuntu 8.04 from the USB flash device. Xubuntu should automatically save your changes as you go and restore them on subsequent boots.
Notes: If your having trouble getting Ubuntu to boot, your memory stick may have a corrupted MBR. To repair the MBR of your USB device, at the terminal type sudo apt-get install lilo then type lilo -M /dev/sdx (replacing x with the letter of your flash device)

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

USB gOS Persistent Install from Live CD

Posted in How To's by Shafkat Shahzad, M.Sc on April 16th, 2009

The tutorial will cover the process of installing gOS to a USB flash drive using the gOS Live CD. In addition, the persistence option is being utilised for saving and restoring changes persistently on the fly. gOS is based on Ubuntu and features the enlightenment desktop environment. Enlightenment features a dock and stack that looks and functions much like “fan view” used in Mac OSX 10.5. We prefer gOS Rocket with also includes many useful google apps. gOS was produced by the Good OS LLC corporation and is commonly found on Everex PC’s.

USB gOS installation essentials:
Following are the USB gOS essentials for the installation process
• Working CD Drive
• gOS CD
• 1GB+ USB flash drive
• Working internet connection

USB gOS Persistent install via Live CD:
Let’s go through the process of USB gOS persistent installation via CD
1. Download the gOS ISO and burn to a CD
2. Reboot your PC from the gOS Live CD
3. Insert your USB flash drive
4. Left click on the desktop and select Run Command from the options. Then type xterm and press enter to launch the gOS terminal
5. Type sudo su (to become root)
6. Type apt-get update
7. Type apt-get install syslinux mtools
8. Now type fdisk -l to list available drives/partitions (note which device is your flash drive Example: /dev/sdb). Throughout this tutorial, replace all instances of x with your flash drive letter. For example, if your flash drive is sdb, replace x with b.
9. Type fdisk /dev/sdx
o type p to show the existing partition and d to delete it
o type p again to show any remaining partitions (if partitions exist, repeat the previous step)
o type n to make a new partition
o type p for primary partition
 type 1 to make this the first partition
 hit enter to use the default 1st cylinder
 type +750M to set the partition size
 type a to make this partition active
 type 1 to select partition 1
 type t to change the partition filesystem
 type 6 to select the fat16 file system
o type n to make another new partition
o type p for primary partition
 type 2 to make this the second partition
 hit enter to use the default cylinder
 hit enter again to use the default last cylinder
 type w to write the new partition table
10. Type mkfs.vfat -F 16 -n gOS /dev/sdx1 to format the first partition
11. Type mkfs.ext2 -b 4096 -L casper-rw /dev/sdx2 to format the second partition
12. Remove and re-insert your flash drive
13. Type mkdir /media/gOS
14. Type mount /dev/sdx1 /media/gOS
15. Type syslinux -sf /dev/sdx1
16. Type cd /cdrom
17. Type cp -rfv casper dists install pics pool preseed .disk isolinux/* md5sum.txt README casper/vmlinuz /media/gOS
18. Type cd /media/gOS
19. Type wget pendrivelinux.com/downloads/gOS/syslinux.cfg
20. Reboot your computer and set your BIOS boot priority or Boot Menu to boot from the USB device. Save your changes and proceed to boot from the USB device.

No you will be able to boot gOS from your flash drive using the persistence option saving and restoring your changes on each boot.

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

Ubuntu 8.10 Persistent Flash Drive Install from Live CD

Posted in How To's by Shafkat Shahzad, M.Sc on April 16th, 2009

Ubuntu 8.10 Persistent flash drive install using the Live CD. The tutorial will provide guidance to a user to install Ubuntu 8.10 Intrepid Ibex to a USB flash drive while booted from the Live CD. In addition the persistence or casper persistent feature will be utilized to automatically save changes back to the thumb drive as you work, and then restore those saved changes upon subsequent boots.
It is important to note that the tutorial will utilise a separate ext casper-rw partition instead of a loop file. The process enables the user to have a partition that is larger than the 4GB fat32 file size limit for saving and restoring changes.

Ubuntu 8.10 USB installation essentials
There are Ubuntu 8.10 installation essentials which are listed below:
• Working CD Drive and an Ubuntu 8.10 CD
• Established internet connection
• 1GB or larger USB flash drive (2GB or larger for script installations)

Create Ubuntu 8.10 flash drive automatically
If you are using this method, then you must use a 2GB or larger thumb drive.
1. Download the Ubuntu 8.10 ISO and burn it to a CD
2. Restart your computer, booting from the Live CD
3. Insert a 2GB or larger USB flash drive
4. Open a terminal and type the following into the terminal window:
wget pendrivelinux.com/downloads/u810/u810.sh
chmod +x u810.sh && sh u810.sh
5. Follow the onscreen instructions
6. Once the script has finished, reboot your computer and set your BIOS or boot menu to boot from the USB device

Create Ubuntu 8.10 flash drive manually
1. Download the Ubuntu 8.10 ISO and burn it to a CD
2. Restart your computer and boot from the Ubuntu Live CD
3. Insert a 1GB or larger USB flash drive
4. Open a terminal window and type sudo su
5. Now type fdisk -l to list available drives/partitions (note which device is your flash drive Example: /dev/sdb). Throughout this tutorial, replace all instances of x with your flash drive letter. For example, if your flash drive is sdb, replace x with b.
6. Type umount /dev/sdx1
7. Type fdisk /dev/sdx
o type p to show the existing partition and d to delete it
o type p again to show any remaining partitions (if partitions exist, repeat the previous step)
o type n to make a new partition
o type p for primary partition
 type 1 to make this the first partition
 hit enter to use the default 1st cylinder
 type +750M to set the partition size
 type a to make this partition active
 type 1 to select partition 1
 type t to change the partition filesystem
 type 6 to select the fat16 file system
o type n to make another new partition
o type p for primary partition
 type 2 to make this the second partition
 hit enter to use the default cylinder
 hit enter again to use the default last cylinder
 type w to write the new partition table
8. Type umount /dev/sdx1 to unmount the partition
9. Type mkfs.vfat -F 16 -n ubuntu810 /dev/sdx1 to format the first partition
10. Type umount /dev/sdx2 to ensure the partition is unmounted
11. Type mkfs.ext2 -b 4096 -L casper-rw /dev/sdx2 to format the second partition
12. Remove and re-insert your flash drive (if prompted that a new medium has been detected, select to open in a new window and click ok)
13. Back at the terminal, type sudo apt-get install syslinux mtools
14. Type syslinux -sf /dev/sdx1
15. Type cd /cdrom
16. Type cp -rfv casper dists install pics pool preseed .disk isolinux/* md5sum.txt README.diskdefines install/mt86plus /media/ubuntu810
17. Type cd /media/ubuntu810
18. Type cp isolinux.cfg syslinux.cfg
19. Type rm text.cfg
20. Type wget pendrivelinux.com/downloads/u810/text.cfg
21. Reboot your computer and set your system BIOS boot priority to boot from the USB stick

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

« Previous entries