Thursday, May 5, 2011

Integration of Tommcat App Server and Apache Web Server

Building a Web Server, for Windows

Requirements
Java 1.5 JDK (SDK), Apache 2.2, mod_jk 1.2
Download them and install them.

Our Configuration
Java JDK path : D:\jdk1.5.0_07
Apache path : D:\Apache2
Tomcat path : D:\tomcat5
JSP/Servlet webroot (via Apache2/mod_jk) : D:\tomcat5\webapps
JSP/Servlet webroot (via native Tomcat server, port 8080) : D:\tomcat5\webapps
Access JSP/Servlet pages via Apache2/mod_jk : http://localhost/[jkmount-mapped url of your webapp]
Access native Tomcat server : http://localhost:8080/
Install Java 1.5 JDK
Run file jdk-1_5_0_07-windows-i586-p.exe
Install under your %SystemDrive% (D:\), forming D:\jdk1.5.0_07
Unpack and place Tomcat5 and mod_jk
Unpack file apache-tomcat-5.5.17.tar.gz under directory D:\www
Rename directory D:\apache-tomcat-5.5.17 to D:\tomcat5
Rename file mod_jk-apache-2.x.xx.so to mod_jk.so, and place under directory D:\Apache2\modules
Configuration and Setup
Set Environmental Variables : JAVA_HOME=D:\jdk1.5.0_07 and CATALINA_HOME=D:\tomcat5
Set variables under Start » Settings » Control Panel » System » Advanced » Environment Variables » System variables » New...


To add worker (Worker is nothing but connector.)

Create empty file D:\Apache2\conf\workers.properties, insert code...
workers.tomcat_home=D:/www/tomcat5
workers.java_home=D:/jdk1.5.0_07
ps=\

# Define worker 'test1'
worker.list=test1

# Set properties for worker 'test1' (ajp13)
worker.test1.type=ajp13
worker.test1.host=localhost
worker.test1.port=8009

worker.test1.cachesize=10
worker.test1.cache_timeout=600
worker.test1.socket_keepalive=1
worker.test1.recycle_timeout=300

To add virtual directories

Edit file D:\Apache2\conf\httpd.conf, insert code...
LoadModule jk_module modules/mod_jk.so
<<>> /ifmodule mod_jk.c
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel error
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
Alias /jsp-examples "D:/tomcat5/webapps/jsp-examples/"
<<>> /directory
Options Indexes +FollowSymLinks
AllowOverride None
Allow from all
<<>> /directory
Alias /servlets-examples "D:/www/tomcat5/webapps/servlets-examples/"
<<>> /directory
Options Indexes +FollowSymLinks
AllowOverride None
Allow from all
<<>> /directory
<<>>location
AllowOverride None
deny from all
<<>>/location
JkMount /jsp-examples/*.jsp example
JkMount /servlets-examples/* example
<<>>/ifmodule

Edit file D:\tomcat5\conf\tomcat-users.xml, insert lines...
<<>>role rolename="manager"
<<>> user roles="manager" password="manager" username="manager"
Install and Start Tomcat
Tomcat can be installed as a Service or started as a Standalone Console application. Note to make sure that Apache has been started at this point.
Start Tomcat service either through services panel or net stop/start.
Test the native Tomcat server...
http://localhost:8080/
http://localhost:8080/manager/status -- User:manager, Password:manager
Test Apache/mod_jk...
http://localhost/jsp-examples/
http://localhost/servlets-examples/

In above article if you see <<>> /directory, then "/directory" has to go inside the brackets. It applies wherever you find <<>>.

Have a nice day! Its only guidance and you are responsible for your results.

Tuesday, May 3, 2011

Error : Another simpana is running on Linux media agents

This artcile is on Commvault

I was getting this error while start or stop services on Linux media agent
"Error : Another simpana is running on Linux media agents"
Follow these steps to fix it:
1. Simpana status
It shows what is running on the server
2. Simpana list
It shows which services are running
3. Simpana start/stop
It starts/stops simpana services on the server
But recently we have got issues on Linux media agent and it was giving error of “another simpana is running” whenever we start/stop services on it.
4. Go to /tmp folder and rename the following file with command mv
# mv .lock_Galaxy .lock_Galaxy_old
5. Now start services with # simpana start
6. Check services with # simpana list
7. Also run a backup job and see how it is running with this media agent.

Have a Nice day!