ColdFusion 8 on Ubuntu with LAMP

I have an old PC and I wanted to use the box as a development server for a Flex project. The PC did not have Windows installed and I didn’t want to buy a new Windows license since the license would have cost more than the PC was worth, so I decided to look into setting up the PC with Linux.

After doing some research it seemed that the Ubuntu Linux-based OS would be the easiest to get going. Not having much experience in Unix it took a bit of work to get everything functioning properly, so just to make sure I did not forget anything if I had to do it again I documented the process.

The steps I followed are listed below, so if you ever have the urge to put an old PC back to work but didn’t know where to start, perhaps the following will help. Note that I’m not a Unix expert so I’m not able to answer technical questions if something doesn’t work for you the way it worked for me.

1) Ubuntu

Start with a fresh install of Ubuntu 7.04 Desktop.

2) Apache 2

Install Apache 2 using Terminal:

sudo apt-get install apache2

To test Apache, open a browser and enter:

http://localhost/

You should see a folder entitled apache2-default/. Open it and you will see a message saying “It works!”

3) PHP

Install PHP 5 using Terminal:

sudo apt-get install php5 libapache2-mod-php5

Restart Apache:

sudo /etc/init.d/apache2 restart

To test, type the following into Terminal to create the file testphp.php (you must have root authority to create a file in /var/www so sudo is used):

sudo gedit /var/www/testphp.php

Enter the following line in the editor:

<?php phpinfo(); ?>

Browse to the following URL and you should see data listed about PHP:

http://localhost/testphp.php

4) MySQL

Install MySQL using Terminal:

sudo apt-get install mysql-server

In order for other computers on the network to view the server, edit the “Bind Address” by opening my.cnf in Terminal:

gksudo gedit /etc/mysql/my.cnf

Change the line:

bind-address = 127.0.0.1

to:

# bind-address = 127.0.0.1

Start the MySQL command line interface by typing the following in Terminal:

mysql -u root

Once the “mysql>” prompt is displayed, type the following:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');

Quit MySQL by typing “exit” at the “mysql>” prompt.

Restart MySQL using Terminal

sudo /etc/init.d/mysql restart

5) phpMyAdmin

This program is a browser-based front-end for MySQL; to install type the following in Terminal:

sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin

To get PHP working with MySQL edit the file php.ini by typing the following in Terminal:

gksudo gedit /etc/php5/apache2/php.ini

Search for the “Dynamic Extensions” section and add the following after the commented section:

extension=mysql.so

Restart Apache:

sudo /etc/init.d/apache2 restart

phpMyAdmin can be accessed at the following URL:

http://localhost/phpmyadmin/

Use “root” for the username and the password you set in step 4 above for the password.

To allow remote access to MySQL, select the “Privileges” option, then click “Add new user” and add a new account with user name “root“, a password, and a “Host” value of “Any host”. Under the “Global privilges” section click “Check all” to enable all privileges and click the “Go” button at the bottom of the page.

6) ColdFusion 8

Download the Linux ColdFusion install files from the following URL:

http://www.adobe.com/go/trycoldfusion

Make the downloaded file “Coldfusion-8-lin.bin” executable:

a) Right click on the file
b) Click “Properties”
c) Click the “Permissions” tab
d) Select the “Execute” check box
e) Click “Close”

Open a Terminal window and type:

sudo -i

(Note: -i is used to simulate initial root login)

Find the directory where the installation package is located by right-clicking on “Coldfusion-8-lin.bin” file and selecting “Properties”. Change to the location of the “Coldfusion-8-lin.bin” installer (for example “cd /home/USERNAME/desktop“) and type:

./Coldfusion-8-lin.bin

The ColdFusion 8 installer will begin to run:

* For language, choose “1″ for English

* Press “Enter” a to get through the legalize (read thoroughly)

* Press “y” to accept license

* Select “Install Type” (choose 3 for Developer Edition)

* Choose an “Installer Configuration” (choose 2 for Multiserver configuration)

* When asked if earlier versions of ColdFusion are installed choose “2″ (No)

* Select subcomponents

* Select default install folder (”/opt/jrun4“)

* Press “Enter” a to get through the legalize (read thoroughly, again)

* Press “y” to accept license

* Enter a blank serial number for the development server

* When asked if earlier versions of ColdFusion are installed choose “2″ (No)

At this point the installer will ask if you want to configure a web server. For Apache integration, do the following:

* Select Add Web Server Configuration (”1″)

* Select the Apache web server option (”1″)

* For the Apache configuration file directory enter “/etc/apache2/

* For the Apache program binary file location enter “/usr/sbin/apache2

* For the Apache control file location enter “/etc/init.d/apache2

* Select “Continue with installation” (4)

* For ColdFusion 8 Administrator Location enter “/var/www

* For Runtime User enter your user ID

* Create an administrator password

* Enable RDS (optional) and create a password

* After the install summary is displayed, press Enter to begin the installation

When the install completes, open Terminal start ColdFusion by entering the following two lines:

cd /opt/jrun4/bin
./jrun -start cfusion

Once ColdFusion starts, open another Terminal window and enter these two lines:

cd /opt/jrun4/bin
sudo bash ./cf-connectors.sh

You should eventually see a message that says “Connector installation succeeded for apache.”

Open a browser and enter:

http://localhost/CFIDE/administrator/index.cfm

You should see the ColdFusion 8 login screen. Login to the Administrator screen using the user ID and password you chose in order to complete the installation.

To start ColdFusion without needing to keep the Terminal window open, use the following command:

sudo nohup /opt/jrun4/bin/jrun -start cfusion; exit;

Terminal can be closed when “nohup: appending output to 'nohup.out'” is displayed.

7) Web Root Permissions

a) Press the ALT and F2 keys together to open the “Run Application” dialog

a) Type “gksudo nautilus” and click the “Run” button

b) Browse to “/var

c) In the “var” directory right click the “www” directory and select “Properties”

d) Select the “Permissions” tab and in the “Group” section then select your User ID.

e) Set “Folder Access” to “Create and Delete Files”

f) Set “File Access” to “Read and write Access”

g) Click the button “Apply permissions to enclosed files”

h) Click the “Done” button

8) Share Web Root

Still in Nautilus, right click the “www” folder and select “Share Folder.” If the services required to share files and folders is not installed, you will be prompted to install them (install support for NFS and SMB).

When the Shared Folder options window is displayed select SMB for the “Share Through” option and give the share a name (and optionally a comment). Uncheck the “Read only” checkbox.

Open Terminal and create a SMB password for your user ID:

sudo smbpasswd -a USERNAME

Now restart SMB (perhaps this is not necessary, but it won’t hurt):

sudo /etc/init.d/samba restart

To enable Windows Vista so that it can see the Ubuntu machine, in Vista click “Start -> Run.” In the Run field type: “secpol.msc“. That will bring you to Vista’s security policy system. Once there, use “Go to: Local Policies > Security Options” and then find “Network Security: LAN Manager” authentication level. Once there, change the Setting from “Send NTLMv2 response only” to “Send LM & NTLM — use NTLMv2 session security if negotiated.”

9) Auto Login when Booting

Go to terminal and type “sudo gdmsetup“. You will get login window preferences. Select Security tab; check “Enable automatic Login” and select the user.

10) FTP Server

Open a Terminal window and type the following to install a FTP server and GUI:

sudo apt-get install proftpd
sudo apt-get install Gproftpd

Start the GUI by typing “sudo gproftpd” at a shell prompt and you’re ready to add some users.

Set the “Home Directory” to “/var/www” if you want to FTP a web site.

When adding a user, be sure to set directory permissions at the very bottom of the “Users” screen

11) Gnome-schedule

Gnome-schedule can be used to run tasks (like start up or shut down) according to a pre-determined schedule.

Open a Terminal window and type the following:

sudo apt-get install gnome-schedule

To open this application go to Applications -> System tools -> Schedule

To run as root enter “sudo gnome-schedule” in Console.

See also:

Schedule Tasks Using Gnome-schedule
Forcing Hibernation

12) Install Microsoft Windows Core Fonts

Use the following command from the command line:

$sudo apt-get install msttcorefonts

This will give you the core fonts, but if there are other TrueType fonts that you want installed, it is as easy as copying the font files to the “~/.fonts/” directory.

After installing new fonts, you will have to log out and log in again to be able to see and use the new fonts. If you want to avoid this, you can regenerate the fonts cache by issuing the following command:

$sudo fc-cache -fv

REFERENCES

Ubuntu LAMP for Newbies
MySQL Password Reset
How to Share Files and Folders in Ubuntu
Auto Login in Ubuntu
Gadmintools (GPROFTPD)
Getting Vista to Work with Samba
Installing Microsoft Fonts

Published in: on February 11, 2008 at 3:06 pm Leave a Comment
Tags: , , , ,

The URI to TrackBack this entry is: http://blog.mediablur.com/2008/02/11/coldfusion-8-on-ubuntu-with-lamp/trackback/

RSS feed for comments on this post.

Leave a Comment