OK, the following is the setup to allow a Tomcat 6.0.13 user to be able to
run Apache 2.2.4 and Tomcat 6.0.13 in concert
The following confg is what I used setup Apache / Tomcat on a local machine
for testing before I deployed to a live server.
I am going to start with Apache first. The Apache version is the latest:
2.2.4
1. First the http.config file in the Apache22/conf folder
2. Around line 115 add the following:
3. LoadModule jk_module modules/mod_jk.so
4. Down around line line 474, uncomment this line
5. # Virtual hosts
Include conf/extra/httpd-vhosts.conf
6. Save http.conf and exit.
1. The second item to be done is to find the httpd-vhosts.conf in the
Apache22/conf/extra folder.
2. The following is my config for this file for everything below line
42.. Everything down to line 42 I commented out.
JkWorkersFile D:/java/Apache22/conf/workers.properties
JkLogFile D:/java/Apache22/logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
<VirtualHost *:80>
ServerName red5
DocumentRoot D:/java/Tomcat6/webapps2
JkMount /* worker1
<Directory "/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Location "/WEB-INF/">
AllowOverride None
deny from all
</Location>
</VirtualHost>
3.
Edit httpd-vhosts.conf for your respective paths (Items in BLUE ) and
save the file.
4.
Next, download mod_jk-apache-2.2.4.so , rename it mod_jk.so and place
mod_jk.so in the
Apache22/modules folder. The following url is where to download:
http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/
5.
Copy the following item config and name it workers.properties and
place workers.properties in the Apache22/conf folder
# Define 1 ajp13 worker
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300
6. This is all that is to be done to the Apache side.
1. OK, now let's configure the Tomcat side:
Be sure in your environment variables that you have Catalina_Home
defined
where you have Tomcat installed. i.e.- D:/Tomcat6
2. Find the folder Tomcat6/conf and open up server.xml
Just below line 146, insert a space and add the following:
<Host name="red5"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path=""
docBase="${catalina.home}/webapps2/red5"
reloadable="true">
</Context>
</Host>
3.
Save server.xml and exit
4.
Manually add webapps2 folder to Tomcat6 : -> Tomcat6/webapps2
(The reason we add webapps2 is so you can have complete control over
Apache.
if not, then Tomcat's default page will display when you enter
http://localhost )
5.
Now if you use webapps2 in Tomcat, you will need to change 2 files in
RED5 and recompile in
order for red5 to find webapps2. The files are as follows:
red5/src/org/red5/server/Standalone.java - down around line 143
// Set Red5 root as environment variable
System.setProperty("red5.root", root);
log.info("Setting Red5 root to " + root);
System.setProperty("red5.webapp.root", root+"/webapps2/");
log.info("Setting webapp root to " + root);
red5/src/org/red5/server/TomcatLoader.java - down around line 81
(Actually I am not sure about this file but I chnaged it anyway.
static {
log.info("Init tomcat");
// root location for servlet container
String serverRoot = System.getProperty("red5.root");
log.info("Server root: " + serverRoot);
String confRoot = System.getProperty("red5.config_root");
log.info("Config root: " + confRoot);
// root location for servlet container
appRoot = serverRoot + "/webapps2";
log.info("Application root: " + appRoot);
// set in the system for tomcat classes
System.setProperty("tomcat.home", serverRoot);
System.setProperty("catalina.home", serverRoot);
System.setProperty("catalina.base", serverRoot);
6.
After all this, place red5 in the webapps2 folder
7.
Restart Tomcat Service
8.
Restart Apache Service
9.
Type http://red5 , You should see the RED5 default index.html page.
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org