LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 03-08-2005, 08:38 AM   #1
nicolasdiogo
Member
 
Registered: Oct 2003
Location: UK
Distribution: debian lenny x64
Posts: 129

Rep: Reputation: 20
SuSE 9.2 - apache2 & tomcat5 - how to configure VIRTUAL HOSTS & JSP?


Hello,

I have installed my SuSE 9.2 pro with a DHCP server, DNS server, and even LDAP authetication (thanks to help found on this forum!).
At present, I have also intalled my apache2 webserver easily, but I can not figure out how to configure tomcat5 to work with my apache2.
Let me make it clear that I have installed both packages, apache2 & tomcat5, accoding to SuSE's descriptions so I have the usual JSP pages working (/jsp-examples/ and /servlets/), however I do not understand how to configure Apache2 VIRTUAL HOSTS to serve JSP pages.
SuSE as you know comes with a mod_jk rpm which is easily installed and remaining of cofiguration is fairly straigth forward thanks to notes in the /var/ directory.
But even after a lot of time searching and reading I still can not setup the server.

I have tried ProxyPass and ProxyPassReturn as an alternative but that did not work.
And also tried [uri:/domainPath/*] configuration, again, without any lucky.

I swear that I have searched, but it seems that I still missing something!?

What I am seeking is to enable the following VIRTUAL HOSTS (with JSP & servlets) to be processed through tomcat5:

<VirtualHost *:80>

<IfDefine SSL>
SSLEngine off
</IfDefine>

DocumentRoot /srv/www/vhosts/brainpowered.net/
ServerName www.brainpowered.net
ServerAdmin admin@brainpowered.net

DirectoryIndex index.jsp index.html


</VirtualHost>



the default jk.conf (/etc/apache2/conf.d/jk.conf) is as follows:

########################start#############################
# simple configuration for apache (for AJP connector, modul mod_jk.so)

<IfModule mod_jk.c>

JkWorkersFile /etc/tomcat5/base/workers.properties
JkLogFile /var/log/tomcat5/base/mod_jk.log

# Log level to be used by mod_jk
JkLogLevel error

# The following line makes apache aware of the location of
# the /servlets-examples context
Alias /servlets-examples "/srv/www/tomcat5/base/webapps/servlets-examples"
<Directory "/srv/www/tomcat5/base/webapps/servlets-examples">
Options Indexes FollowSymLinks
allow from all
</Directory>


# The following line makes apache aware of the location of
# the /jsp-examples context
Alias /jsp-examples "/srv/www/tomcat5/base/webapps/jsp-examples"
<Directory "/srv/www/tomcat5/base/webapps/jsp-examples">
Options Indexes FollowSymLinks
allow from all
</Directory>

# The following line mounts all JSP files and the /servlet/ uri to tomcat
JkMount /servlets-examples/servlet/* ajp13
JkMount /jsp-examples/*.jsp ajp13

# The following line prohibits users from directly accessing WEB-INF
<Location "/jsp-examples/WEB-INF/">
AllowOverride None
deny from all
</Location>
<Location "/servlets-examples/WEB-INF/">
AllowOverride None
deny from all
</Location>

</IfModule>

########################end#############################

And the workers.properties file is:

#######################start#############################

# workers.properties -
#
# This file provides jk derived plugins with the needed information to
# connect to the different tomcat workers. Note that the distributed
# version of this file requires modification before it is usable by a
# plugin.
#
# As a general note, the characters $( and ) are used internally to define
# macros. Do not use them in your own configuration!!!
#
# Whenever you see a set of lines such as:
# x=value
# y=$(x)\something
#
# the final value for y will be value\something
#
# Normaly all you will need to do is un-comment and modify the first three
# properties, i.e. workers.tomcat_home, workers.java_home and ps.
# Most of the configuration is derived from these.
#
# When you are done updating workers.tomcat_home, workers.java_home and ps
# you should have 3 workers configured:
#
# - An ajp12 worker that connects to localhost:8007
# - An ajp13 worker that connects to localhost:8009
# - A jni inprocess worker.
# - A load balancer worker
#
# However by default the plugins will only use the ajp12 worker. To have
# the plugins use other workers you should modify the worker.list property.
#
#

# OPTIONS ( very important for jni mode )

#
# workers.tomcat_home should point to the location where you
# installed tomcat. This is where you have your conf, webapps and lib
# directories.
#
workers.tomcat_home=/var/tomcat3

#
# workers.java_home should point to your Java installation. Normally
# you should have a bin and lib directories beneath it.
#
workers.java_home=/opt/IBMJava2-13

#
# You should configure your environment slash... ps=\ on NT and / on UNIX
# and maybe something different elsewhere.
#
ps=/

#
#------ ADVANCED MODE ------------------------------------------------
#---------------------------------------------------------------------
#

#
#------ DEFAULT worket list ------------------------------------------
#---------------------------------------------------------------------
#
#
# The workers that your plugins should create and work with
#
# Add 'inprocess' if you want JNI connector
worker.list=ajp12, ajp13
# , inprocess


#
#------ DEFAULT ajp12 WORKER DEFINITION ------------------------------
#---------------------------------------------------------------------
#

#
# Defining a worker named ajp12 and of type ajp12
# Note that the name and the type do not have to match.
#
worker.ajp12.port=8007
worker.ajp12.host=localhost
worker.ajp12.type=ajp12
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.ajp12.lbfactor=1

#
#------ DEFAULT ajp13 WORKER DEFINITION ------------------------------
#---------------------------------------------------------------------
#

#
# Defining a worker named ajp13 and of type ajp13
# Note that the name and the type do not have to match.
#
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.ajp13.lbfactor=1

#
# Specify the size of the open connection cache.
#worker.ajp13.cachesize

#
#------ DEFAULT LOAD BALANCER WORKER DEFINITION ----------------------
#---------------------------------------------------------------------
#

#
# The loadbalancer (type lb) workers perform wighted round-robin
# load balancing with sticky sessions.
# Note:
# ----> If a worker dies, the load balancer will check its state
# once in a while. Until then all work is redirected to peer
# workers.
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp12, ajp13


#
#------ DEFAULT JNI WORKER DEFINITION---------------------------------
#---------------------------------------------------------------------
#

#
# Defining a worker named inprocess and of type jni
# Note that the name and the type do not have to match.
#
worker.inprocess.type=jni

#
#------ CLASSPATH DEFINITION -----------------------------------------
#---------------------------------------------------------------------
#

#
# Additional class path components.
#
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar

#
# Setting the command line for tomcat.
# Note: The cmd_line string may not contain spaces.
#
worker.inprocess.cmd_line=start

# Not needed, but can be customized.
#worker.inprocess.cmd_line=-config
#worker.inprocess.cmd_line=$(workers.tomcat_home)$(ps)conf$(ps)server.xml
#worker.inprocess.cmd_line=-home
#worker.inprocess.cmd_line=$(workers.tomcat_home)

#
# The JVM that we are about to use
#
# This is for Java2
#
# Windows
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)jvm.dll
# IBM JDK1.3
#worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)libjvm.so
# Unix - Sun VM or blackdown
#worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)lib$(ps)i386$(ps)classic$(ps)libjvm.so

#
# And this is for jdk1.1.X
#
#worker.inprocess.jvm_lib=$(workers.java_home)$(ps)bin$(ps)javai.dll


#
# Setting the place for the stdout and stderr of tomcat
#
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr

#
# Setting the tomcat.home Java property
#
#worker.inprocess.sysprops=tomcat.home=$(workers.tomcat_home)

#
# Java system properties
#
# worker.inprocess.sysprops=java.compiler=NONE
# worker.inprocess.sysprops=myprop=mypropvalue

#
# Additional path components.
#
# worker.inprocess.ld_path=d:$(ps)SQLLIB$(ps)bin
#

#########################end#############################

Many, Many thanks in Advance!

Nicolas
 
Old 03-20-2005, 08:57 AM   #2
chrisc3616
LQ Newbie
 
Registered: Mar 2005
Posts: 1

Rep: Reputation: 0
Hi. I'm in the same boat. It looks like it is tomcat5 configured by default. I thought I might have a problem with my router on port 8080 but it should be loading JSPs on port 80. What are you using to test it? Have you checked your logs directory? Try to deploy a war in the webapps and restart tomcat
 
Old 03-20-2005, 09:06 AM   #3
nicolasdiogo
Member
 
Registered: Oct 2003
Location: UK
Distribution: debian lenny x64
Posts: 129

Original Poster
Rep: Reputation: 20
thanks,


i have posted a response to my forum on the link below:

http://www.linuxquestions.org/questi...hreadid=298860

if you need further assistance, let me know.

Nicolas
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
apache2 & tomcat5 - how to configure VIRTUAL HOSTS & JSP? nicolasdiogo Suse/Novell 2 04-05-2007 10:06 AM
Wiki & Apache Virtual Hosts deadlock Fedora 2 11-11-2005 09:19 PM
Sub Domains & Virtual Hosts oO_SwooP_Oo Linux - General 11 09-21-2005 03:07 PM
Virtual Hosts & Other Simple Qu's! owoods Linux - Newbie 1 08-25-2004 07:10 AM
MDK 9.1 & Virtual Hosts nvargas Mandriva 0 09-04-2003 10:25 AM


All times are GMT -5. The time now is 09:15 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration