User Tools

Site Tools


virtualbox_and_coldfusion_9

These instructions cover installing ColdFusion 9 on VirtualBox.

  • This will setup a virtual server running ColdFusion and MySQL.
  • Shared drives will be configured between the guest and host to share a CFEclipse workspace.
  • Virtual directories will be configured in Apache to map to those workspaces.

:!: WARNING: These instructions are for MY use and may or may not work for you. If you erase your hard drive, blow up your computer or otherwise harm yourself, your cat or others while following these instructions I am not responsible.

What We Will Install (details below)

  • VirtualBox
  • Apache
  • MySQL
  • phpMyAdmin
  • Adobe ColdFusion 9

My Environment

  • Host: Windows Vista
  • Guest: Ubuntu 9.04

What You Need To Download

  • VirtualBox (latest version)
  • ColdFusion Server 9 (32bit for Ubuntu 9)
  • Ubuntu Server 9.04 (32 bit)

Adobe doesn't list 64bit Ubuntu as supported so it would probably work but for my needs (development) 32bit is fine.

VirtualBox Installation and Configuration

This assumes some basic working knowledge of VirtualBox. You will need to mount iso images, etc. VirtualBox is very similar to VMWare and other virtual machines. If you have problems - please consult VirtualBox site for help.

Manual Method: (this method is outdated - please update to VirtualBox 4 where it is very easy to do port forwarding!)

  • Edit: C:\Users\Jim\.VirtualBox\VirtualBox.xml
  • Add the following lines within the ExtraData section of VirtualBox.xml. Modify port numbers accordingly:
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" value="2222"/> 
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" value="22"/> 
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" value="TCP"/> 
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/HostPort" value="8888"/> 
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/GuestPort" value="80"/> 
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol" value="TCP"/> 

LAMP (Ubuntu, Apache, MySQL, PHP)

  • Install Ubuntu Server (10 LTS)
    • go with defaults
    • partition entire disk
    • if you are lazy when given the option you can install the LAMP stack and save some steps below
  • Install Apache ( sudo apt-get install apache2 )
  • Open a browser and confirm you can access: http:\\localhost
    • If not adjust port forwarding and try again!
  • Install MySQL ( sudo apt-get install mysql-server )
    • provide a root password for MySQL login
  • Install phpmyadmin ( sudo apt-get install phpmyadmin ) (installing this is optional)
  • Restarting:
    • MySQL: sudo service mysql restart\
  • Verify you can connect to both Apache (http://localhost) and mySql (using the client of your choice)
    • You may need to grant permission on MySQL to allow access your network.

VirtualBox Guest Additions

  • Install VirtualBox Guest Additions
    • install some prerequisites ( sudo apt-get install build-essential linux-headers-`uname -r` )
      • You may need to directly install headers… type uname-r to get installed header info and then do 'sudo apt-get install' the header name reported.
    • click Devices > Install Guest Additions from main menu
    • mount the media: ( sudo mount /dev/cdrom /media/cdrom )
    • verify you can access guest addition files ( ls /media/cdrom )
    • run the appropriate installer ( sudo ./media/cdrom/VBoxLinuxAdditions-x86.run )
    • unmount the media: (umount /media/cdrom )

Configure Your Shared Workspace

  • Setup shared drive for your workspace (this assumes you are using Eclipse)
    • On host: add the path to your Eclipse workspace ( D:\workspace ) and give it a name ( 'workspace' )
    • On guest: create a folder ( sudo mkdir /var/www/workspace )
    • Change owner: ( sudo chown nobody workspace )
    • Mount the share within the guest ( sudo mount -t vboxsf workspace /var/www/workspace )
    • Edit rc.local: ( sudo vi /etc/rc.local )
  • Configure the mount points to be persistent so they will remain after a reboot (you don't need sudo!)
mount -t vboxsf workspace /var/www/workspace 

Notes:

  • I usually create a directory within my workspace folder called “vmshare” and use that to transfer files between my guest and host…
  • When creating the shared folder in VirtualBox - do not select 'auto mount'

Snapshot

  • Now might be a good time to create a VirtualBox snapshot in case you screw up something below…

ColdFusion Installation

  • On the host - download ColdFusion for Linux into your shared directory ( D:\workspace\vmshare )
  • On the guest - install C++ library that is required by ColdFusion: ( sudo apt-get install libstdc++5 )
    • This may not be in the Ubuntu repositories. In not - add a Debian mirror to your sources.list
      • Open /etc/apt/sources.list
      • Add a repository: deb http://ftp.us.debian.org/debian lenny main
      • Update apt: sudo apt-get update
      • Install library: ( sudo apt-get install libstdc++5 )
  • Run the ColdFusion installer 'sudo ./ColdFusion_9_WWE_linux.bin' (you may need to make this executable 'sudo chmod 777 ColdFusion_9_WWE_linux.bin' should do it)
    • Follow installation prompts:
    • Click enter a zillion times and accept license agreement
    • Select to install the Developer Edition
    • I'm a KISS person so I select the basic Server configuration
    • Continue with defaults
    • Add a Web Server Configuration - Select Apache
    • Default paths:
      • Apache config: /etc/apache2
      • Apache binary: /usr/sbin/apache2
      • Control file: /etc/init.d/apache2
      • Webroot: /var/www
    • Skip OpenOffice integration
      • OpenOffice allows you to convert Office documents to PDF. If you need this you'll need to install: sudo apt-get install openoffice.org-core
    • Enable RDS
    • Verify installation information
    • Start ColdFusion: sudo /opt/coldfusion9/bin/./coldfusion start
    • Try to access ColdFusion administrator: http://localhost/CFIDE/administrator/index.cfm
  • Configure ColdFusion to start on startup
    • Add to: /etc/rc.local - the following startup line: ./opt/coldfusion9/bin/coldfusion start
    • Reboot and verify it works correctly
  • Configure your debugging IP. By default CF only allows local users (127.0.0.1). Verify debugging works - if not - add your IP to the debugging IP list.

Snapshot

  • This is another great spot to stop and take a VirtualBox snapshot! :-D

Apache Configuration / Virtual Directories

  • Configure Apache to handle index.cfm files
    • edit /etc/apache2/mods-enabled/dir.conf and add index.cfm to the list of file names
  • Create a Virtual Directory in Apache
    • Navigate to: /etc/apache2/sites-available
    • Copy default to 'yoursitename'
    • Modify accordingly ( ServerName yoursitename.localhost )
    • Modify hosts file accordingly ( add a record for yoursitename.localhost )
    • Enable the new site ( sudo a2ensite yoursitename ) this will create the appropriate links to: /etc/apache2/sites-enabled
    • Run a2dissite to disable a site!
    • Reload the Apache config ( /etc/init.d/apache2 reload )
    • Attempt to access new site at http://yoursitename.localhost

My default config:

  • Aliases setup for CFIDE and model-glue stuff
  • Document root pointing to my CFEclipse workspace - means any new project I create I can access via localhost/project-name
  • Disabled logging
  • :!: Please note there is NO security enabled below - if you need to restrict access - RTFM!
<VirtualHost *:80>
	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/workspace

	Alias /CFIDE /var/www/cfide
        Alias /modelglueextensions /var/www/workspace/frameworks/modelglueextensions
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride all
		Order allow,deny
		Allow from all
	</Directory>

	# ErrorLog /var/log/apache2/error.log
	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	# LogLevel warn
	# CustomLog /var/log/apache2/access.log combined
</VirtualHost>

Install Hot Fix

  • Install unzip (for installing Adobe hot fixes)
  • $ sudo apt-get install unzip
  • Example: $ sudo unzip CFIDE-901.zip -d /var/www
  • You will be prompted to replace files - select (A) All
  • Do this for all the .zip files in the hot fix.
  • .jar files are can be installed through the ColdFusion Administrator
/home3/thecrumb/public_html/wiki/data/pages/virtualbox_and_coldfusion_9.txt · Last modified: 2011/11/05 10:44 by thecrumb