wiki:java_tomcat
I would integrate Apache tomcat as described in my Tutorial here: 
http://vhcs.net/new/modules/newbb/viewtopic.php?topic_id=6493&forum=14

I'm thinking about writing a Java program which does some configuration related parts 
(especially tomcat issues like creating new Tomcat Virtual Hosts). The vhcs2-rqst-mngr just has to call it.

Problem:
Tomcat doesn't match the security issues, I'm searching for something like SuPHP for tomcat.

Old Entry


At the moment to integrate Tomcat in ISPCP you must do most of configurations on Server Side.

1. Install Tomcat and Java Applications:

 http://www.mogilowski.net/?p=24&lang=de-de

This is a very goot install instruction to do this.

2. Configuration of Tomcat after you installed the ispcp user:

Creat a folder called webapps in the /var/www/virtual/domain.tld folder of the user.

After this you look, what is the system user the other files at the domain folder.

ls -l

Then you set the permissions and user to the folder

chown -R vu0001:www-data webapps chmod 775 webapps

after this you must edit the Tomcat5.5 server.xml, that you say to tomcat which folder is the webapps folder for this application.

nano /etc/tomcat5.5/server.xml

Add the follogwing line between the area <Server> <Service> <Engine> --here the following code-- </Server> </Service> </Engine>

change domain.tld to your webspace user

<Host name="domain.tld" appBase="/var/www/virtual/domain.tld/webapps" unpackWARs="true">
<Alias>www.domain.tld</Alias>
<!--
<Context path="" docBase="htdocs" reloadable="true" />
-->
</Host>

After this settings, restart Tomcat

/etc/init.d/tomcat5.5 restart

3. Configuration of Apache:

First of all, you must think about if you want to send all files in htdocs folder to tomcat or only a subfolder. This is importen becaus, if you send all files to apache, you can't use html or php files on the website any longer.

nano /etc/apache2/sites-enabled/ispcp.conf

Search the vHost of the user

unter the error alias of this you set the following line: JkMount? "/*" "mainworker" (if you want to give all files to tomcat) JkMount? "/Apps/*" "mainworker" (if you want to give only a subfolder to tomcat - at this example its the folder Apps in /var/www/virtual/domain.tld/htdocs)

Now restart Apache

/etc/init.d/apache2 restart

and if the restart is done, copy the ispcp.conf file to workin folder of ispcp

cp /etc/apache2/sites-enabled/ispcp.conf /etc/ispcp/apache/working

Now you can upload .war archives to the webapps folder and tomcat will unpack them. When you copy the unpacked sources to htdocs folder, apache2 will show it over tomcat on website.