Showing posts with label tomcat. Show all posts
Showing posts with label tomcat. Show all posts

Saturday, October 31, 2009

How to run PHP in a Tomcat server instance

One of the very few tutorials that actually works, thanks to the blog pointing to both a download for PHP and PECL libraries that match each other:

How to Run PHP 5.x with Apache Tomcat 4.x or Apache Tomcat 5.x @ AurosBlog


Wednesday, February 27, 2008

UTF-8 Problem Between Apache and Tomcat via Mod_JK

If the UTF-8, GBK, Chinese or whatever character set it may be, is showing via Tomcat (i.e. accessing from port 8080) but not showing in Apache (via mod_jk) then one step might be to check that the AJP connector has the URIEncoding set too as mod_jk uses that connector rather than the one that might be set on port 8080.

For Example:

<connector port="9011" enablelookups="false" redirectport="8443" protocol="AJP/1.3" uriencoding="UTF-8"></connector>

Monday, August 14, 2006

Two Tomcats, One Apache.

Running two tomcat installations one different ports via one apache server and mod_jk.


In apache's httpd.conf
------------------------

<IfModule !mod_jk.c>
LoadModule jk_module "c:/Progra~1/Apache~1/Apache2/modules/mod_jk.so"
</IfModule>


JkWorkersFile "C:/tomcat/conf/workers.properties"
JkLogFile "C:/tomcat/logs/mod_jk_new.log"
JkLogLevel info
JkMount /* ajp13
JkMount /*.jsp ajp13


JkMount /Tomcat2 tomcat2
JkMount /Tomcat2/* tomcat2
JkMount /Tomcat2/*.jsp tomcat2


In server.xml for the second tomcat instance
--------------------------------------------

- Change the SHUTDOWN port to another port that doesnt conflict with the first instance.

- Change the AJP 1.3 Connector port to another that doesnt conflict with the first.

- Set the connector port to something other than 8080, which you want to run your second tomcat from.




In C:/tomcat/conf/workers.properties
------------------------------------
workers.tomcat_home=C:/tomcat
workers.java_home=C:/jdk1.5.0_02
ps=worker.list=ajp13, tomcat2

#first tomcat
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1

#second tomcat
worker.tomcat2.port=8007
worker.tomcat2.host=localhost
worker.tomcat2.type=ajp13
worker.tomcat2.lbfactor=1


worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp13
worker.inprocess.type=jni
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)server$(ps)lib$(ps)catalina.jar
worker.inprocess.cmd_line=start
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)server$(ps)jvm.dll
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr

Thursday, August 10, 2006

Changing or renaming the ROOT folder in Tomcat

1.
Look for this...
<Context path="" docBase="ROOT" />
and change it to
<Context path="" docBase="NEW_FOLDER_NAME" >

If it is not there as default. Then it needs to be added inside the <host> tag. (which is inside the <engine> tag)


2. Stop tomcat

3. Delete the files in

work\Catalina\localhost

4. Start tomcat