How to deploy to Apache web server
I have an Apache2 web server and Studio Creator on the same server.
I have developed and run Web Applications within S.C. but can't figure out how to deploy the application in a way that I can invoke them from a browser pointed at my Apache Server.
FYI. Just learning Studio Creator and Java.
# 3
Here are the steps I have taken to get my application working on Apache with a Tomcat and Apache Connector...
Creating an Apache - Tomcat Connector
Step 1:
Have Fun...
Step 2:
Download the source from Apache's web site
http://tomcat.apache.org/connectors-doc/index.html
Step 3:
Download Tomcat 5.5
http://tomcat.apache.org/
Step 4:
Download Java
http://java.sun.com/javase/downloads/index_jdk5.jsp
Step 5:
Use the source files from the apache connector download to build the mod_jk.so file.
We do this by using the c++ command line compiler or the guey compiler
The location is relative to where you installed or placed the download source code
For example my location is as follows:
C:\apache13\tomcat-connectors-1.2.20-src\native\apache-1.3 (the actual project file is,mod_jk.dsw)
Through the guey is easy just select the rebuild from the build menu.
It should build if you remebered to set your environmental variables
For Example
Java_home = C:\Program Files\Java\jdk1.5.0_10
Apache1_home = C:\apache113\Apache (this would be apache2 for version 2 of Apache)
I also had to even though my environmental variable was set,
had to copy and past a file (jni.h) locally into the the following directory;
C:\apache13\tomcat-connectors-1.2.20-src\native\apache-1.3
Within the Apache Directory I had to change a couple of the library names of some of the files
to relect what files the source compile was looking for
I also downloaded the latest apache server and wehn i was building the connection in C++
Linked to 2 files and changed there names as these files were not in the version of Apache I was using
and that is why the names had to be changed of the following 2 files
libaprutil-1 changed to libaprutil
libapr-1 changed to libapr
Step 6:
Once successfully built move the mod_jk.so from this directory
C:\apache13\tomcat-connectors-1.2.20-src\native\apache-1.3\Release
to C:\apache113\Apache\modules\ directory
Step 7:
Use the Depends Tool (C:\Program Files\Microsoft Visual Studio\Common\Tools\depend.exe) to see if the
.so files can find all of the associated .dlls. If the program cannot you may need to import (copy & paste) into the
directory which the mod_jk.so is looking for it. .
For Example the issue I had was the following 2 .dlls where in the wrong directory
Win9xConHook.dll
ApacheCore.dll
The mod_jk.so was looking for this in its current directory (C:\apache113\Apache\modules)
Step 8:
You must modify the httpd.conf file (C:\apache113\Apache\conf directory) by adding the following line:
Include "C:/Program Files/Apache Software Foundation/Tomcat 5.5/conf/auto/mod_jk.conf"
This .conf file is created when Tomcat is started so dont fret if its not built...
Step 9:
In the Tomcat directory you must edit the server.xml file
(C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf)
Right below the following tag add the listner tag
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.jk.config.ApacheConfig"
modJk="C:/apache113/Apache/modules/mod_jk.so"/>
**** This pathing must point to the mod_jk.so file***
Right above the following tag add the listner tag
</Host>
<Listener className="org.apache.jk.config.ApacheConfig"
modJk="C:/apache113/Apache/modules/mod_jk.so"/>
**** This pathing must point to the mod_jk.so file***
<Listener className="org.apache.jk.config.ApacheConfig"
append="true"
forwardAll="false"
modJk="C:/apache113/Apache/modules/mod_jk.so"/>
**** This pathing must point to the mod_jk.so file***
Please create a folder in the conf directory and call it jk
within this new directory you will create the following file
workers.properties
With in this file, please place the following code
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
Step 10:
Run Tomcat
To see if its started and running properly
http://localhost:8080/ (you should get the Tomcat webpage if you did it right)
Step 11:
Wait 30 Seconds and then start Apache
To see if its started and running properly
http://localhost
Step 12:
If both services are running then try this to ensure that the jsp are running correctly
http://localhost:8080/jsp-examples/index.html (test tomcat)
http://localhost/jsp-examples/index.html (test Apache)
I originally used Apache 1.something but I found out the hard way that version did not have multithreading built into it So I upgraded to apache2. something (the latest stable build)
Message was edited by:
dupey00_ca