Setting up Apache, OpenBD, Railo and ColdFusion - Part 2 - Installing Tomcat/Apache/OpenBD
ColdFusion, LinuxThis is the second part in a series of posts on setting up ColdFusion, OpenBlueDragon, and Railo all on the same machine using Apache webserver to listen for all requests and direct traffic. Part 1 can be found here
Remember, the steps below have some commands specific to Linux, and more specifically to Debian/Ubuntu, but the concepts in general should have at least some similarites across any supported platform, especially you Mac folks.
To start out, we need to make sure that we have the Apache webserver installed with optional "dev" package. Additionally, later on we will need to be compiling, so let's make sure that you have the build-essential package as well
$sudo apt-get install apache2 apache2-threaded-dev build-essential$sudo apt-get install sun-java6-jdkNext you want to go download Tomcat. I chose to use Tomcat 6, specifically v. 6.0.18, which the current release as of this posting. Now, using a terminal cd into the directory where you saved the dowloaded file and do the following:
$ sudo cp apache-tomcat-6.0.18.tar.gz /opt/
$ cd /opt
$ sudo tar xvzf apache-tomcat-6.0.18.tar.gz
$ sudo mv apache-tomcat-6.0.18 tomcat6
$ sudo rm apache-tomcat-6.0.18.tar.gzNext we will need to edit the Tomcat startup script, but to do so, we need to go get a little information first. We need to ensure that we know what the current Java home is on your machine. There are surely easier ways of accomplishing this, but here is the series of steps I took.
~$ which java
/usr/bin/java
$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 2009-01-30 23:00 /usr/bin/java -> /etc/alternatives/java
$ ls -l /etc/alternatives/java[return] lrwxrwxrwx 1 root root 36 2009-01-30 23:00 /etc/alternatives/java -> /usr/lib/jvm/java-6-sun/jre/bin/java From that last line I can see that the default Java lives at /usr/lib/jvm/java-6-sun/ (which too is a sym link, but that's ok!). Now that we have our Java home we can edit the Tomcat startup script
$sudo gedit /opt/tomcat6/bin/catalina.shPaste the following lines in just after the big comment block at the top. Make sure that if your Java path looked different than mine did, you will want to adjust accordingly.
JAVA_HOME=/usr/lib/jvm/java-6-sun
JRE_HOME=/usr/lib/jvm/java-6-sun/jre
JAVA_OPTS="-server -Xms1024M -Xmx1024M -XX:PermSize=256m -XX:MaxPermSize=256m \
-Duser.language=en -Duser.country=US -Dfile.encoding=UTF-8 \
-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl" Now we want to download the Apache Tomcat connector source so that we can pass requests from Apache webserver to Tomcat. This is the one I grabbed: http://apache.org/dist/tomcat/tomcat-connectors/jk/source/ Next you will want to browse to the directory that you downloaded that file into using in the terminal. Next run:
$ tar xvzf tomcat-connectors-current-src.tar.gz
$ cd tomcat-connectors-1.2.27-src/native
$ ./configure --with-apxs=/usr/bin/apxs2
$ make
$ sudo make installNow we will need to create a jk mod file to be included by Apache so that it loads the adapter when Apache starts. In your terminal cd to /etc/apache2/mods-available. In this directory we will create a file named jk.load.
$sudo gedit jk.loadIn that file pasted the following, then save and exit:
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
# Where to find workers.properties
# Update this path to match your conf directory location (put workers.properties next to httpd.conf)
JkWorkersFile /etc/apache2/workers.properties
# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile /var/log/apache2/mod_jk.shm
# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log next to access_log)
JkLogFile /var/log/apache2/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the timestamp log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "Now we want to create a symbolic link to this file in /etc/apache2/mods-enabled so that it is loaded when Apache starts.
$ cd /etc/apache2/mods-enabled
$ sudo ln -s ../mods-available/jk.load ./jk.load Next we want to create a virtual host in Apache to catch the requests. We are going to create a new file in the sites-available directory.
$ cd /etc/apache2/sites-available
$ sudo gedit localhost.bd <VirtualHost *> ServerName localhost.bd JKMount /* worker1 </VirtualHost>
Now we need to create a symbolic link to that file from sites-enabled so that it is available when apache2 starts.
$ cd /etc/apache2/sites-enabled
$ sudo ln -s ../sites-available/localhost.bd ./001-localhost.bdNext we want to make sure that we can get to that site in a browser, so we are going to add 'localhost.bd' to our hosts file. Open up /etc/hosts, and append 'localhost.bd' (without quotes!) to the line that begins with 127.0.0.1. Now we need to define that "worker1" that we just referenced above in the VirtualHost definition. We will do that by creating a workers.properties file in our apache2 directory.
$ cd /etc/apache2
$ sudo gedit workers.propertiesInsert the following. Then save and exit:
# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost.bd
worker.worker1.port=8009 Next we want to create a webapp in Tomcat for Apache to send to.
sudo gedit /opt/tomcat6/conf/server.xml<Host name="localhost.bd" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="true" xmlNamespaceAware="false">
<Context path="" docBase="localhost.bd/" reloadable="true" privileged="true" antiResourceLocking="false" anitJARLocking="false">
</Context>
</Host>
Now we need to create the local.bd directory under Tomcat. Note: as you get more comfortable and adventurous, you may want this to be a symbolic link to another place on your machine where your source resides, but for now we are keeping it as simple as we can. Once the directory is created, we will download the OpenBlueDragon war file and extract it.
$ sudo mkdir /opt/tomcat6/webapps/localhost.bd
$ cd /opt/tomcat6/webapps/localhost.bd
$ sudo wget http://openbd.viviotech.net/downloader.cfm/id/64/file/openbd.war
$ sudo jar xvf openbd.war And with that step, and after restarting Apache, and starting Tomcat, OpenBlueDragon will now be available.
$ sudo /etc/init.d/apache2 restart
$ /opt/tomcat6/bin/catalina.sh startOpen up your browser and go to: http://localhost.bd/bluedragon/administrator
You should be created with your OpenBD admin page like this:
Next: Part 3 - Installing ColdFusion 8 and customizing the JRun connector






Loading....