Setting up Apache and Lucee on Ubuntu Server

No preamble, this is a walkthrough to setup Lucee and Apache on Ubuntu Server. So let's get to it.

First things first, you need to install Ubuntu on a machine or VM. I used Ubuntu Server 18.04.4 LTS so this tutorial will be 100% command line. I won't get into the specifics about installing Ubuntu but it is a pretty easy process with tons of tutorials floating around.

Once you have Ubuntu up and running, you'll want to get it up to date with the following commands.

sudo apt update && sudo apt upgrade -y

If you are interested in automatic updates for Ubuntu Server, you can use the following command to set that up.

sudo apt install unattended-upgrades
sudo dpkg-reconfigure unattended-upgrades

When prompted about installing important updates, just hit enter to select Yes.

Next, you'll need to install a couple of packages (or at least apache2). You don't really need axel, you could just use curl. Axel, however, is a download accelerator and will download files from most places much faster.

sudo apt install axel apache2

Once apache is installed, you should be able to open a browser and go to http://[server ip address] and see the default apache2 page.

Next, you will need to download the Lucee linux installer, set the appropriate permissions and run it to start the installation.

mkdir ~/downloads
cd ~/downloads
chmod 744 ./
sudo ./ --mode text

The last command will start the Lucee installation and ask you a number of questions. Most of the defaults are just fine for our purposes but you'll need to enter the admin password when prompted and, likely, increase the default heap sizes (though not entirely necessary).

Once the Lucee installer is complete, you can open a browser and navigate to http://[server ip address]:8888. You should see the Lucee welcome screen. Now that Lucee is installed, you have two admin contexts; one for the server context (http://[server ip address]:8888/lucee/admin/server.cfm) and one for the web context (http://[server ip address]:8888/lucee/admin/server.cfm).

When you log into the server context, the overview page will inform you of any updates you might need to install.

The default apache page is located in the default webroot at /var/www/html. You can drop your files in that directory or edit /etc/apache2/apache2.conf and /etc/apache2/sites-available/000-default.conf to change references to "/var/www/html" to your new directory or add a second site.

Here is a quick way to test out CF in the existing webroot.

sudo touch /var/www/html/index.cfm
echo "<cfscript>dump(server)</cfscript>" | sudo tee -a /var/www/html/index.cfm

Navigate to http://[server ip address]/index.cfm and you should see a dump of the server scope.

That's all there is to it.

Most Recent Photos