Experience in Creating a Virtual Appliance



Pre-configured Accounts


Type

Username

Password

OS super-user

jeoser

password

MySQL administrator

root

password

FTP account

joomla

password

Joomla administrator

admin

password



Basic Unix Commands

Command

Description

apt-get

To manage installation, update, upgrade and removal of application packages

chown

To change the owner of a file or directory

chmod

To change permission of a file or directory

ifconfig

To display the network information (e.g. IP address)

mount

To mount a CD-ROM within the drive for use

sudo

Allows execution of commands with super-user privileges

useradd

To add users to the operating system

vim

My favourite text editor!

wget

Acts as a faceless browser to retrieve HTML or other files over the network



Additional Resources

Description

URL

Give information about installing JeOS as a virtual appliance

https://help.ubuntu.com/community/JeOS

Gives information about installing Joomla! onto Ubuntu

http://www.doyouubuntu.com/wordpress/?p=57&lang=en



Steps/ Experience

 

Step

Time Taken (min)

Conclusion/ Result

VMware installation (30 minutes)

 

Searched for the most appropriate VM software (30 minutes)

30

The “best” is VMware which happens to be free!

Downloaded VMware Server – requires 500+MB

15

 

Waited for the registration key to be sent by email

5

 

Installed VMware and tested administrative interface using IE8

10

Fail to load the VMware ActiveX console

 

Search the web for resources and realized it’s due to Vista’s permission problems

30

Run IE8 with elevated privilege (as administrator); added localhost:[port] to trusted sites

Operating System Download (5 minutes)

 

Search out for the most user-friendly Linux distribution

(e.g. distrowatch)

20

Found Ubuntu

 

Noted that Ubuntu has several flavours. Had to decide.

10

Decide to use JeOS 8.04

Downloaded jeos-8.04.3-jeos-i386.iso – requires 100+ MB

5

 

Virtual Machine installation (35 minutes)

Create and setup a suitable Virtual Machine

15

Setup Ubuntu VM with 1 CPU; 1 GB RAM; USB and CD-ROM drive. Boot up with ISO mounted onto CD-ROM drive

Install jeos-8.04.3-jeos-i386

20

 

Post-OS installation (20 minutes)

Run OS/ software updates

15

Execute sudo apt-get update and apt-get upgrade

Install LAMP stack

5

Execute sudo apt-get install lamp-server^

Prepare FTP (Can be skipped)

 

Joomla! requires FTP for file transfers

5

Install VsFTPd using sudo apt-get install vsftpd

 

Edit /etc/vsftp.conf

1

Enable local_enable and write_enable. Disable error_displays

 

Create user account for FTP from Joomla!

1

Execute useradd and passwd

 

Create a home directory for the above user

1

Execute mkdir /home/[ftp username]

 

Create soft-link

in /var/www/joomla to /home/[ftp username]

1

Execute sudo ln -s /home/[ftp username] /var/www/joomla

Install Joomla! (27 minutes)

Edit /etc/php5/apache2/php.ini

1

Uncomment session.save_path=/var/lib/php5

Install wget to download files

3

Execute sudo apt-get install wget

Joomla! is not available using apt !! Need to separately download Joomla!

5

Execute wget http://joomlacode.org/gf/download/frsrelease/12193/49780/Joomla_1.5.17-Stable-Full_Package.zip

unzip is not available by default !!

5

Execute sudo apt-get install unzip; unzip [Joomla archive] -d /var/www/joomla

Allow Joomla! to modify/ install itself

1

Execute sudo chmod 777 -R /var/www/joomla

Restart both apache2 and vsftpd daemons

2

Execute sudo /etc/init.d/[daemon] restart for both

Install Joomla!

5

Use a web browser to go to http://[ip address]/joomla

Follow the installation instructions

5

Mostly guided



Quirks

  1. What it is recommended to use FTP to upload the Joomla components, I could not get both FTP and Component installation (via web interface) to work together. Searching the forums reveal similar complaints.
  2. File permission was tricky. While it was easy to make everything work using full read and write access (e.g. chmod 777), it is definitely not recommended for production use. Performed the following instead:
    1. Change owner for all files in joomla by: sudo chown www-data:www-data –R /var/www/joomla
    2. Change permission for all files in joomla by: sudo chmod -R u+rwX,g+rX-w,o+rX-w /var/www/joomla

Other Recommended Software to Install or Configuration to Set

Software

Command

Purpose

VMware tools

 

To have optimized vmware drivers and interface with vmware controls

Aptitude

sudo aptitude install unattended-upgrades

To allow auto OS upgrades

OpenSSH Server

apt-get openssh-server

To allow remote shell access to the Operating System using Putty

VsFTP Server

apt-get install vsftpd

To allow uploading of Joomla components



Clean up the Virtual Appliance

  1. Regenerate the openSSH keys by
    1. Deleting existing keys: sudo rm /etc/ssh/ssh_host_*
    2. Creating a new set of keys: sudo dpkg-reconfigure openssh-server
  2. Change MySQL password for root by executing: mysqladmin -u root --password=<current password> password <new password>
  3. Purge unnecessary installation files by executing: sudo aptitude purge
  4. Purge all temporary files by executing: sudo rm -R /tmp/*
  5. Reconfigure the IP address for the network interface by editing /etc/network/interfaces
    1. Change this:
      auto eth0
      iface eth0 inet dhcp
    2. To this:
      auto eth0
      iface eth0 inet static
      address 192.168.1.<assign value>
      netmask 255.255.255.0
      network 192.168.1.0
      broadcast 192.168.1.255
      gateway 192.168.1.1
    3. Restart the network interface: sudo /etc/init.d/networking restart
  6. Lastly, remove the history of the executed commands b y executing: history –c

Comments

Popular posts from this blog

Understanding ITIL Service Management the UML way…

Apache Web Server Troubleshooting