You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by Kal Lin <ka...@cs.toronto.edu> on 2000/03/14 19:47:04 UTC

tomcat beta + apache + mod_jserv + mysql + JDBC

Here is a little script I use to install the above components.
Your mileage WILL vary but it might help some people get started.

Cheers,
--Kal




#/bin/sh

# Prerequisites:
# RedHat 6.1
# IBM JDK 1.1.8
#

#
# This will install apache, tomcat, mod_jserv, mysql, JDBC
# into the home directory of the user and run apache on port
# 8000 and tomcat on 8080.   See the end for instructions on
# adding a context.
#

#
# set this to wherever you have downloaded all the following files
#
TARBALLS=/u/tarballs/jakarta

# apache_1.3.12.tar.gz         (ftp://ftp.apache.org/dist)
# jakarta-tomcat.tar.gz        (http://jakarta.apache.org/builds/tomcat/release/v3.1_beta_1/bin)
# mm.mysql.jdbc-1.2c.tar.gz    (http://www.worldserver.com/mm.mysql/)
# mysql-3.22.32.tar.gz         (http://www.mysql.org/download_3.22.html)
# mod_jserv.so                 (http://jakarta.apache.org/builds/tomcat/release/v3.1_beta_1/bin/linux/i386/)

#
# unpack all the tarballs
#
cd $HOME
tar xvfz $TARBALLS/apache_1.3.12.tar.gz
tar xvfz $TARBALLS/jakarta-tomcat.tar.gz
tar xvfz $TARBALLS/mm.mysql.jdbc-1.2c.tar.gz
tar xvfz $TARBALLS/mysql-3.22.32.tar.gz

#
# make a local jars dir and copy stuff there
#
mkdir $HOME/jars
cp $HOME/mm.mysql.jdbc-1.2c/*.jar $HOME/jars
cp $HOME/jakarta-tomcat/lib/*.jar $HOME/jars
rm -rf $HOME/mm.mysql.jdbc-1.2c

#
# fix the classpath so we can find servlet.jar, etc with javac
# fix the path so we can have the apache and mysql bin in it
#
echo "PATH=\$PATH:\$HOME/apache/bin:\$HOME/mysql/bin" >> $HOME/.bashrc
echo "export CLASSPATH=\$CLASSPATH:\$HOME/jars/mysql_comp.jar:\$HOME/jars/servlet.jar:." >> $HOME/.bashrc
source $HOME/.bashrc

#
# run tomcat so it will generate the conf/tomcat-apache.conf file
#
cd $HOME/jakarta-tomcat
bin/startup.sh

#
# configure and make apache
#
cd $HOME/apache_1.3.12
./configure \
        --prefix=$HOME/apache \
        --enable-module=rewrite \
        --enable-shared=rewrite \
        --enable-module=so
make
make install
cp $TARBALLS/mod_jserv.so $HOME/apache/libexec
grep -v "Port 8080" $HOME/apache/conf/httpd.conf > $HOME/httpd.tmp
echo Port 8000 >>  $HOME/httpd.tmp
echo Include $HOME/jakarta-tomcat/conf/tomcat-apache.conf >> $HOME/httpd.tmp
cp $HOME/httpd.tmp $HOME/apache/conf/httpd.conf
$HOME/apache/bin/apachectl start

#
# configure and make mysql
#
cd $HOME/mysql-3.22.32
./configure --prefix=$HOME/mysql 
make
make install
$HOME/mysql/bin/mysql_install_db
$HOME/mysql/bin/safe_mysqld &

#
# give the mysqld a chance to get started then change the password
#
sleep 10
$HOME/mysql/bin/mysqladmin -u root password 'XXXXXX'

#
# If you now point your browser at
# http://localhost:8080/              the tomcat homepage
# http://localhost:8000/              the apache homepage
# http://localhost:8080/examples/     the tomcat examples via tomcat
# http://localhost:8000/examples/     the tomcat examples via apache
#
# To add a context XX:
# 1) put the files under jakarta-tomcat/webapps/XX
# 2) edit the file jakarta-tomcat/conf/server.xml 
#    before </ContextManager> line at the end add the lines
#
#       <Context path="/XX" docBase="webapps/XX" debug="0" reloadable="true" > 
#       </Context>
#
# 3) restart tomcat: bin/shutdown.sh  bin/startup.sh
# 4) restart apache: apachectl restart
#
# Note: the httpd.conf file in apache/conf includes the file 
# jakarta-tomcat/conf/tomcat-apache.conf which is generated
# by tomcat when it is restarted.  When you restart apache
# the new context XX will be properly aliased in apache.
#