NOTE: THIS IS A ROUGH DRAFT 1st ATTEMPT IF YOU FIND ERRORS PLEASE LET US KNOW
PLEASE FORGIVE THE BAD FORMATTING AND/OR TYPO'S! :)
Ubuntu, Smith, Apache, Tomcat, MySQL
- Install Ubuntu server
-
sudo apt-get install fluxbox xserver-xorg xfonts-base xterm mysql-server mysql-admin firefox gcc build-essential fastjar
-
startx
-
download zlib:
-
tar xvf zlib-1.2.3.tar.gz
-
cd zlib-1.2.3
-
./configure
-
make
-
sudo make install
-
download/build/install apache from source
-
cd /home/getopen
-
wget http://apache.tradebit.com/pub/httpd/httpd-2.2.4.tar.gz
-
tar xvf httpd-2.2.4.tar.gz
-
cd httpd-2.2.4
-
./configure -prefix=/usr/local/apache2 -enable-mods-shared=all
-
make
-
sudo make install
-
-
start apache
-
sudo /usr/local/apache2/bin/apachectl start
-
“It Works”
-
-
download (to /home/getopen) and install java jdk from http://java.sun.com
-
cd /home/getopen
-
sudo sh ./jdk-6u1-linux-i586.bin
-
sudo cp -R jdk1.6.0_01 /usr/lib/jvm/
-
sudo update-alternatives –install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_01/jre/bin/java 300
-
-
download tomcat from tomcat.apache.org
-
# wget http://mirrors.isc.org/pub/apache/tomcat/tomcat-5/v5.5.20/bin/apache-tomcat-5.5.20.tar.gz
-
move the tar.gz to the /opt directory
-
# mv apache-tomcat-5.5.20.tar.gz /opt
-
-
extract the file
-
# tar xvf apache-tomcat-5.5.20.tar.gz
-
-
move the extracted files to the /opt/tomcat5 directory (you will need to create it)
-
# mv /opt/apache-tomcat-5.5.20 /opt/tomcat5
-
-
Edit the catalina.sh file to denote the path to the newly installed JDK
-
# vim /opt/tomcat5/bin/catalina.sh
-
add the following info:
-
JAVA_HOME=/usr/java/jdk1.6.0_01
-
-
-
JRE_HOME=/usr/java/jdk1.6.0_01/jre
JAVA_OPTS="-server -Xms1024M -Xmx1024M -XX:PermSize=256m -XX:MaxPermSize=256m \
-Duser.language=de -Duser.country=CH -Dfile.encoding=UTF-8 \
-
-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl"
-
Apache – Tomcat connector
-
download the connector source:
-
# wget http://apache.org/dist/tomcat/tomcat-connectors/jk/source/tomcat-connectors-1.2.23-src.tar.gz
-
extract the tar.gz file
-
# tar xvf tomcat-connectors-1.2.23-src.tar.gz
-
-
cd into the native folder within the newly created folder
-
# cd tomcat-connectors-1.2.23-src/native
-
(within the native direcotry )
-
# ./configure – with-apxs=/usr/local/apache2/bin/apxs
-
# make
-
# make install
-
-
-
Configuring mod_jk
-
open the httpd.conf file and add the following: (sudo vim /usr/local/apache2/conf/httpd.conf)
-
-
-
# Load mod_jk module
# Update this path to match your modules location
LoadModule jk_module 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/httpd/conf/workers.properties
# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile /var/log/httpd/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/httpd/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] "
-
create a file called workers.properties under your /etc/httpd/conf directory (this directory may be located elsewhere depending on where you installed apache)
-
add the following to your workers.properties file: (ajp113 stands for Apache JServ Protocol version 1.3, and basically says we are using JK2 http://tomcat.apache.org/connectors-doc-archive/jk2/common/AJPv13.html)
# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
-
open /opt/tomcat5/conf/server.xml and comment out the connectorPort 8080 ensure that the connectorport 8009 isn't commented out.
-
Now, set up your virtual hosts in apache to include this JKMount /* worker1 like so:
ServerName localhost
JKMount /* worker1
-
And add a host to your /opt/tomcat5/conf/server.xml
(NOTE: the appBase “webapps” is the relative path from /opt/tomcat5. In this case, it is a directory directly beneath it. The docBase attribute is a relative path from appBase, in this case ROOT is a directory under webapps)
-
-
download the smith.war file from http://smithproject.org
-
copy the war to the /opt/tomcat5/webapps/ROOT directory
-
sudo cp smith_1_3.war /opt/tomcat5/webapps/ROOT/
-
cd /opt/tomcat5/webapps/ROOT
-
extract the smith.war file (sudo war xvf smith_1_3.war)
-
-
start apache and tomcat
-
sudo /usr/local/apache2/bin/apachectl start
-
sudo /opt/tomcat5/bin/startup.sh
-
-
MySQL connector
-
In order to connect Smith and MySQL, we need to supply the Smith instance with the MySQL J connector.
-
download the connector from http://dev.mysql.com/downloads/connector/j/5.0.html
-
extract the tar file tar xvf mysql-connector-java-5.0.6.tar.gz
-
cd into the folder for the mysql connector we extracted eariler.
-
# cd /home/getopen/mysql-connector-java-5.0.6
-
# cp mysql-connector-java-5.0.6-bin.jar /opt/tomcat5/webapps/ROOT/WEB-INF/lib
-
restart tomcat
-
# /opt/tomcat5/bin/shutdown.sh
-
# /opt/tomcat5/bin/startdown.sh
-
-
-
Now, lets add a datasource (make sure mysql is running /etc/init.d/mysqld start)
-
Assuming there is a schema named 'Test'
-
Name = test
-
JDBC URL = jdbc:mysql://localhost:3306/test
-
JDBC Driver full class name = com.mysql.jdbc.Driver
-
Username = root
-
Password = password
-
check Keep DB connection during request
-
click on the 'Save Data Source' button
-
-
-
