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.

[313 byte] By [1209Hadriana] at [2007-11-26 21:11:05]
# 1

Hi!

You can read something about deployment to Apache Tomcat here:

http://developers.sun.com/prodtech/javatools/jscreator/reference/docs/help/2upd ate1/deploy/howtodeploy/deploy_tomcat.html

http://blogs.sun.com/harcey/entry/adventures_in_deploying_creator_app

http://blogs.sun.com/david/entry/defining_java_studio_creator_2

For Creator's application You need have application server, If You use Apache httpd, I'm not sure that your application will work well.

Thanks,

Roman.

-Grif-a at 2007-7-10 2:48:22 > top of Java-index,Development Tools,Java Tools...
# 2

My application works extremely well under Apche HTTPD server. Thei is a couple of issues to get it up and running perfectly as you have to have Apache Tomcat running to serve up the JSP pages as the HTTPD server cannot serve up JSP pages. You have to set apache tomcat to listen to the HTTPD server and you have to use the MOD_JK connector.

My application uses a file upload and buttons and listboxes and sessionbeans and the JNI and its functioning as good as if it was on the Sun Apllication server. There is a lot of information available on "HOW TO" get the connector and the 2 servers up and running on the internet, just google it....

dupey00_caa at 2007-7-10 2:48:22 > top of Java-index,Development Tools,Java Tools...
# 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

dupey00_caa at 2007-7-10 2:48:22 > top of Java-index,Development Tools,Java Tools...