Tuesday, March 28, 2006

Installation of Debian on a Dell Poweredge 715n

As promised here is a detailed installation guide for debian on a PE715n NAS, in my case I am using it as a high capacity mirrored offsite backup (one onsite, matching one in a different office)

I'm still working on ironing out some of the bugs in my atrocious grammar so don't expect this to be the final version.

Installing Debian on a Dell Poweredge 715n NAS

This device is a 1u headless (no keyboard, mouse or monitor) computer, PIII 1ghz w/ 256MB RAM and 4 IDE HDDs accessible through the front bezel. It is designed to be installed using the Dell OpenManage and Kickstart software to install windows, this isn’t the easiest solution in the world, I wasn’t able to get access to the machine to configure it using this method after 4-5hrs work but was able to install debian within an hour of setting to the task (I Was much quicker the second time round)

This document is intended to explain the process for anyone that is interested or has one of these boxes to install and want a free O/S on it.

This install was performed via PXE,

The PXE (Preboot eXecution Environment) as described in the [ftp://download.intel.com/labs/manage/wfm/download/pxespec.pdf specification (v2.1)] published by Intel and Systemsoft is an environment to bootstrap computers using a network interface card independently of available data storage devices (like hard disks) or installed operating systems (like GNU/Linux). ...

This method requires an additional PC with a network port and a serial port. I used two separate machines (desktop w/ serial connection and network connection) and a laptop with a network connection for logging in to the server via SSH post-installation and getting more information off the internet!

The hardware setup is as follows.


Crossover RJ45 network cable

Null-Modem serial cable

Active network connection (DHCP server preferred but not essential)

PC w/serial port and network connection

Step 1: configure Host PC for PXE environment

  1. get tftpd32 from http://tftpd32.jounin.net
  2. unzip this to any folder
  3. get the Debian net install from http://ftp.us.debian.org/debian/dists/unstable/main/installer-i386/current/images/netboot/
    download the netboot.tar.gz file and the pxelinux.0 file
  4. extract the netboot.tar.gz file to a folder called tftpboot and copy the pxelinux.0 file to this directory as well
  5. run tftpd32 and go to the settings button (centre at bottom of window)
  6. make sure the following boxes are ticked
    TFTP server, Syslog Server, DHCP Server, Save syslog message, PXE Compatibility, Show Progress bar. Set TFTP Security to none and set the base directory to where you extracted the netboot.tar.gz file, click on ok to return to the main menu
  7. on the DHCP server tab enter the following
    IP pool starting address:
    Size of pool: 10
    Bootfile: pxelinux.0
    WINS/DNS Server:
    Default Router:
    Domain name:
    Additional Option: 0
  8. click on save (vertical box to right of options)
  9. Set the “Current Directory” to the directory where you extracted netboot.tar.gz
  10. Exit tftpd32 and start it again
  11. Connect the network port on the PXE host pc to the 1st net interface on the powervault using the crossover cable and connect the serial cable as well
  12. in the tftpboot/debian-installer/i386/ directory there is a folder called pxelinux.cfg.serial-9600 copy the “default” file contained within to the tftpboot/pxelinux.cfg directory and open this file in your preferred text-editor (I used notepad as it was the only one installed on this PC)
  13. do a search and replace for 9600 and replace it with 115200
  14. Start hyperterminal or your preferred terminal emulator with the following parameters
    Bits per second: 115200
    Data bits: 8
    Parity: None
    Stop bits: 1
    Flow control: Xon/Xoff

Step 2: Setup the Powervault

  1. Power on the server and on the host computer hyperterminal window you will see the serial output of the boot process, there will be a prompt “Press F2 for Setup function” when you see this immediately press F2 (also try ESC+2), the boot will appear to continue but it will bring up a blue menu. Select option 3 “Reinstallation”, the server will bring up the message “This option will be carried out when the server reboots”, press Y to confirm this
  2. the server will reboot and after about 2-3 min will bring up a prompt(it may be a bit hard to read depending on your terminal emulator) press enter here and the debian installation process will begin.

Step 3: The debian installation pt.1 (Basics)

  1. Plug in the other network connection to the second Ethernet port on the server
  2. Select the default language (English)
  3. The next window will be the network setup, select eth1 as the primary (eth0 is the port connected to the crossover cable) if you have a DHCP server it should pick it up automatically, otherwise you will have to setup up your connection manually

Step 4: The debian installation pt. 2 (partitioning and LVM)

  1. At the partitioning options screen, select the manual method.
  2. On the next screen remove any existing partitions from all the drives
  3. create a new 100MB partition on the first drive, formatted as EXT3 and with a mount point of /boot
  4. create a new partition on the same drive for the remaining space, use these drives as “physical volume for LVM”
  5. create new partitions on the rest of the drives of %100 and used as “physical volume for LVM”
  6. on the main partitioning screen select the Configure LVM and select yes at the prompt (write partition changes to disk)
  7. select Modify Volume Groups
  8. add all the partitions available
  9. give it a meaningful name (PV715 in my case)
  10. select Modify Logical Volumes > Create Logical Volume
  11. give it the name “swap” press enter and select the Volume group it should belong to, in this case there is only one
  12. make it 1GB in size and use the “leave” option to return to the main menu
  13. repeat steps 10 – 12 for the following details
    a name of system and a capacity of 9GB
    a name of backups and 100% of the remaining capacity
  14. return to the partitioning menu and edit the LVM partitions at the bottom of the list, format them all as EXT3 except for the Logical Volume named swap, format it as swap. Mount the “system” Logical Volume as / and the backups Logical Volume as /backups
  15. select “write partition changes to disk” and let the installer format the drives.

Step 5: The debian installation pt. 3 (Finishing touches)

  1. When it prompts for what kind of system to install remove all options using the spacebar, the only one selected initially is standard setup, this includes an X-server amongst other things and is not necessary for a poweredge installation.
  2. let the installation complete and give it the required information, Root password, and the initial user account.
  3. When the installation completes altogether you will be presented with a login prompt on Hyperterminal on the host computer.
  4. Login using the standard user account and su to root, apt-get install the following options to make management easier: sudo vim nano jed ssh
  5. edit the /etc/network/interfaces file and give the server a static IP address on eth0 (initially)
  6. edit the /etc/sudoers file and add in any users that are to have SU privileges.
  7. do /etc/init.d/networking restart and the installation is complete!

Friday, March 24, 2006

Deploying ColdFusion 5 and MX7 on the same server

I have now successfully installed and have running CF5 and MX7 on the same server using multiple instances of Apache with different configuration files so that they run on different port numbers and each have their own administrator.
This was done so that a single laptop could be used to demo several different applications that the company I work for developed under CF5 and MX7, normally we would just use a dedicated demo serve but where the laptop is going there is no guarantee of connecting to them.

Apparently this is quite simple using Multiple instances of ColdFusion MX and MX7, but in this case it had to be CF5 which proved to be a bit of a pain. I initially thought about using IIS for CF5 with Apache running the MX7 side of things, but as IIS is the Server of the Beast I wanted to go for an all Apache installation.

The machine I started with had Apache 2.0.55 already installed and running CF5 so I will take it from there (see my earlier posts on how to get this working as Macromedia/Adobe dont officially support this combination)


1. Create a new Apache httpd.conf configuration file (copy and paste the CF5 httpd.conf if you like) in a subdirectory of Apache's "conf" folder , I called mine MX7 as this is what will be running on it. I also decided to subdivide the document roots for CF5 sites and for MX7 sites, this is not necessary but I found it made a confusing task a bit more manageable.

2. Create a new folder in your Apaches installation's conf folder (default installation will be c:\Program Files\Apache Group\Apache2\conf) name the folder MX7 and copy the httpd.conf file from the Apache conf folder into here.

3. Edit the httpd.conf file in the MX7 directory using your fave text editor, and amend the following lines

Listen 80 -> Listen 8080
ServerName servername:80 -> ServerName servername:8080
NameVirtualHost -> NameVirtualHost

make sure that the mod_rewite module is enabled in the LoadModule section(uncomment it in most Apache 2 installations)

4. Create a new VirtualHost with these details

ServerAdmin admin@server.com
DocumentRoot "Path/to/where/CFMX7/Administrator/is/going"
ServerName admin.localhost.com
ErrorLog logs/admin.localhost.com-error_log
CustomLog logs/admin.localhost.com-access_log common
RewriteEngine On
RewriteCond %{SERVER_PORT} !^8080$
RewriteRule ^/(.*) http://admin.localhost.com:%{SERVER_PORT}/$1 [L,R]

Make sure that the DocumentRoot exists!

Add this to your hosts file so admin.localhost.com

5. Install CFMX7 Enterprise edition and select Multiserver configuration when prompted. It willask you for the Apache Binary (c:\Program Files\Apache Group\Apache2\bin\apache.exe) and the location of the configuration files (c:\Program Files\Apache Group\Apache2\conf\mx7) It may complain about a pre-existing installation but you can safely ignore this as this is a copy of the CF5 enabled httpd.conf. When asked where the CFAdministrator is to be installed, give it the location you specified as the DocumentRoot in Step 4

6. Open up a "run" prompt and use the following command (assuming default installation paths etc.)

"C:\Program Files\Apache Group\Apache2\bin\Apache.exe" -f "C:\Program Files\Apache Group\Apache2\conf\mx7\httpd.conf"

Make sure to leave the quotes in for a change! You can also create a shortcut with the same parameters for easy access.

7. Go to "http://admin.localhost.com:8080/cfide/administrator" in your favourite browser and you should get the usual CFAdministrator prompt. You will however be asked about migration, you want to skip this step using the "skip" button as your installation has to exist alongside your CF5 installation and you copied a httpd.conf file that had been modified for CF5.

8. Your demo server is now ready to run applications for CF5 and MX7, now its time to add those VirtualHosts and DSNs to the CFAdministrators.


Administering CF5 (adding Applications and DataSources)

Edit your CF5 Apache configuration (I'll give you a hint, its not the one in the MX7 subdirectory)
and add a new VirtualHost in the normal way, you can copy and paste the example if you do not have any set up.
Add this directive inside the VirtualHost, I'm not sure if it is necessary for all installations but it was in my case so I am including it here for the sake of completeness.

DirectoryIndex index.cfm

This tells Apache to look for the index.cfm file as the index page, I also specify this in the general directive area.

The installation that I was preparing had a MSSQL server running on localhost, so I was using this as my Datasource.
When adding a DSN I had to add it using the CF5 CFadministrator and then go into Control Panel > Administrative Tools > Data Sources (ODBC) and amend the appropriate entry to make it point to the correct location and enable the connection

Administering CFMX7 (adding Applications and DataSources)

This is slightly more complicated as it is a non-standard deployment of CFMX7.
Firstly make sure that the MX7 enabled instance of Apache is running, if it is not, start it using the command shown above.

To add a new Application to Apache open up the MX7 httpd.conf file (found in the MX7 subdirectory if you followed these instructions) and add a VirtualHost, simply copy and paste the one you created for the CFAdministrator and change the following lines

ServerAdmin admin@server.com
DocumentRoot "Path/to/where/Application/is/located"
ServerName url.for.site
ErrorLog logs/url.for.site-error_log
CustomLog logs/url.for.site-access_log common
RewriteEngine On
RewriteCond %{SERVER_PORT} !^8080$
RewriteRule ^/(.*) http://url.for.site:%{SERVER_PORT}/$1 [L,R]

Once this is done and saved you can exit the MX7 Apache instance and restart it.

In my case I had to add the SQL server DBs as ODBC data sources and then add them in to CFadministrator that way instead of just adding them directly. I won't cover this here because if you are reading this far you obviously know your way around a server install.

There are a few additional notes that were important when running these installations.

If you need to restart the CF5 Apache instance (i.e. when adding a new application) it is necessary to stop the MX7 Instance and then restart CF5 and then start the MX7 instance again.

In the CF5 CFadministrator, Datasources that you added under MX7 will appear, but if you press "verify all connections" they will fail the check, this has the disadvantage that you cannot have a datasource in CF5 with the same name as an MX7 datasource.

If I was to do this installation again I would do some stuff differently, I would install MX7 first and give it port 80, this is down to the fact that in order to install CF5 along with Apache2 it is necessary to configure the httpd.conf file manually, I would also copy the httpd.conf file before installing CFMX7, this should stop it from complaining about migrating settings etc, also if I did install MX7 first, CF5 might barf when it sees the newer directives, I don't know for sure if it would do this, but better safe than sorry.

When the install was done, some of the applications didnt work straight away but this was down to the paths to the files and the URLs being slightly different.

I hope that this is of some use to someone else that comes across it. Next time I will probably try it using a VirtualMachine running Linux or Windows 2000 server edition, hopefully it would be a very tidy solution as the instances would run totally independently! That is an experiment for another day (Saturday, maybe?)

I have another fairly long post coming up detailing a headless install of a Dell Poweredge 715n NAS, using only a crossover network cable and a DB9 serial cable. Stay tuned!