Tomcat and apache mod_jk or mod_webapp
Hello,I am using linux and I am running a apache web server and I also use tomcat.
I have upgraded from tomcat 4.0 to 4.1.24 and I am now wanting to use servlets and jsp with apache.I have messed around with servlet etc for awhile now but I wish to use them on my server,which is apache.My question is,do you know of a good website that explains how I can use the mod_jk,mod_jk2 or mod_webapp with apache 2.0 so I can use servlet with apache.I have looked but have not came up with nothing good and the stuff I have found is for older version and I am not sure if I need to use the mod_jk ,mod_jk2 or mod_webapp with the version of apache and tomcat I have.Ps,A good tut page on this would be nice.
Thank you for your time.
"Note" the new tomcat is a pain in the %$# to set up cause you have to uncomment the servlet invoker in the conf/xml file.Older version you did not have to do this cause it was already done for you.So this note is for people that has ever had trouble with setting up the new tomcats cause it was a pain in my @$$ figuring out why the hell the servlet was not working.
Regards,
D.W.A
"Note",I cross posted this thread see
http://forum.java.sun.com/thread.jsp?forum=54&thread=396478
Similar Messages
-
Configuring tomcat and apache on the same system
i need to configure tomcat and apache on the same system.
first i have configured apache and it is working well.
Next is have configured tomcat and it is working well.
i need to interlink tomcat and apache. so i downloaded jk connector and i have configured it.
i gave an entry in the httpd.conf as
Include /tomcat/conf/auto/mod_jk.conf
i have copied the file mod_jk.so to /usr/local/apache/libexec/
went i start apache after the entry is given it gives the error like this
cannot load /usr/local/apache/libexec/mod_jk.so into server: ld_so.1. /usr/local/apache/bin/httpd: fatal : libgcc_s.so.1 : openfailed : no such file or directory in linux
please help to configure this.
i have done every thing as it is in apache.org documentation. please give the complete configuration. some say that tomcat is not compiled according to apache1.3. but i configure jk connector as --with-apxs=/usr/local/apache/bin/apxs
send me the reply
thankqs in advanceHi,
I'm working in a linux machine and choose to use also two different users. Of course I'm using two different ORACLE_HOME directories.I think that the best approach.Just a question ,are you keeping the "GROUP" same or different?
Anand -
Problem in configuring tomcat and apache
I am using mod_jk to configure tomcat and apache. In the server.xml file in /TOMCAT_HOME/conf, I have added this line:
<Listener className="org.apache.jk.config.ApacheConfig" modJk="/TOMCAT_HOME/mod_jk/mod_jk.so" />
And when I restart the tomcat, I get this error:
Caused by: java.lang.RuntimeException: Unable to create path to config file :
/usr/local/tomcat/apache-tomcat-5.5.15/conf/auto/mod_jk.conf
What this error is and how it will be removed. Any suggestion?
JosephSeems like a filesystem user rights problem. Perhaps tomcat is running as a seperate user and this user has no rights to write to one of the subdirectories?
-
Hello,
Has anybody ever gotten tomcat and apache working properly? I'm having a hell of a time with it. I have them working independently, and have JK2 installed (made a package for it). I used the tomcat 4.1 package from incoming...
I can post configs and such if anybody thinks they can help. Right now, this is just a probe to see if anyone thinks they can help. I need a break from it, been scrapping with it for three hours now.
Once I get this working, I'll post a howto to the Wiki, I promise. :-D
Thanks for any info,
DustyThanks for the info so far, it's still not working though... here's what I'm getting:
chane wrote:I might be able to help a bit. I have apache 2.x and Tomact 4.1.29 running with JK2.
I've got apache 2.0.48, tomcat 4.1.27, and jk2 2.0.2. Tomcat is from incoming, I built jk2 from ABS myself; It puts mod_jk2.so in /usr/lib/apache.
in httpd.conf added a module:
LoadModule jk2_module lib/apache/rh72-2.0.2-mod_jk2.so
I've got:
LoadModule jk2_module lib/apache/mod_jk2.so
I think that's right; it seems to be loading the module (see error messages below)
in the same directory (as httpd.conf) there is the workers2.properties file:
I've tried various versions of that file. I just tried it with the one you gave copy-pasted into place, same problems.
In the tomcat server.conf there is a connector for Coyote/JK2 AJP 1.3, make sure this is not commented and is on port 8009.
I think I've got that set up properly. Isn't there some command I can use to test if there is a service running on port 8009?
Anyway, when I go to http://localhost:8080/examples/jsp, for example, it works with tomcat. But if I go to http://localhost/examples/jsp I get a 404 not found; apache isn't forwarding the request to tomcat, for whatever reason.
In /var/log/httpd/error_log, I've got this info:
[Wed Mar 10 10:44:18 2004] [error] config.update(): Can't find config file /usr/conf/workers2.properties
[Wed Mar 10 10:44:18 2004] [error] shm.init(): No file
[Wed Mar 10 10:44:18 2004] [error] jk2_init() Can't find child 452 in scoreboard
[Wed Mar 10 10:44:18 2004] [error] shm.init(): No file
[Wed Mar 10 10:44:18 2004] [error] mod_jk child init 1 -2
[Wed Mar 10 10:44:18 2004] [error] jk2_init() Can't find child 453 in scoreboard
[Wed Mar 10 10:44:18 2004] [error] shm.init(): No file
[Wed Mar 10 10:44:18 2004] [error] mod_jk child init 1 -2
[Wed Mar 10 10:44:18 2004] [error] shm.init(): No file
[Wed Mar 10 10:44:18 2004] [error] shm.init(): No file
[Wed Mar 10 10:44:18 2004] [error] jk2_init() Can't find child 456 in scoreboard
[Wed Mar 10 10:44:18 2004] [error] shm.init(): No file
[Wed Mar 10 10:44:18 2004] [error] mod_jk child init 1 -2
[Wed Mar 10 10:44:18 2004] [notice] Apache configured -- resuming normal operations
[Wed Mar 10 10:44:28 2004] [error] shm.init(): No file
[Wed Mar 10 10:44:28 2004] [error] [client 127.0.0.1] File does not exist: /home/httpd/html/examples
I can't tell if it isn't finding workers2.properties in the right place (why look in /usr/conf), or if its looking in two places and then not finding the shm file??
Do you have anything in ${TOMCAT_HOME}/conf/jk2.properties? All the stuff I've seen online wants me to add stuff to that file, but its never the same stuff.
Thanks very much,
Dusty -
Upgrade the default Tomcat and Apache
Hi
Is there a working and correct way to upgrade and run a Tomcat and Apache server of your pick instead of the pre installed versions in OSX 10.4.8 server.
Meaning that i want to start and admin them throught Server Admin interface, and making Jboss notice the new Tomcat aswell.
MikaelIf you're asking here, the answer is probably no.
It is possible to build and install later versions of all the Mac OS X Server-bundled apps, including Apache, Tomcat, postfix, bind, etc., etc., but in most cases once you do you lose the ability to drive them via Server Admin.
Server Admin knows what it knows - more importantly it doesn't know any of the features of later versions of the apps (it may work with point released (e.g. Apache 1.3.20 -> 1.3.30, but it won't work with major versions like 1.3 -> 2.0).
So if you go that way you're on your own as far as configuring and maintaining the service is concerned.
Leopard (10.5) will include later versions of these apps if you're prepared to wait. -
Run tomcat and apache together
how can i do that tomcat 4.0.6 and apache work at same time? , it is to say, how get Tomcat to runs application server while leaving your static pages on Apache under standard distribution for linux, and do not uses the port 8080, if not, that jsps runs in the domain, example:
i don't want this:
http://mydomain:8080/index.jsp
i want this:
http://mydomain/index.jsp
thanks in advanced.i have encountered a similar problem, here's a useful URL:
http://raibledesigns.com/tomcat/index.html -
Tomcat and Apache/Tomcat is the same?
Hello,
I�m new to jsp and somedays ago I asked here a question and the solution was about installing Apache or Apache/Tomcat.
Now, my question is the following.
When I started to learn jsp , what I did were to install Tomcat. After reading some questions in these forums I do not know what is the difference between the installation of Tomcat and the installation of Apache/Tomcat.
What I have done for the moment is to have a server with Apache and another server for my jsp pages with Tomcat....
Does it means that it is possible to integrate two installations in only one server and to run all the pages in the same server? Where can I find information about that?
Thanks a lot and regards,
PattyTomcat has an HTTP listener built in, so you don't necessarily need Apache to run Tomcat and serve up HTML, JSP, and servlets.
But if you want to have Apache handle static HTML and forward servlet/JSP requests to Tomcat, there are docs at the Tomcat site to tell you how to bolt Tomcat onto Apache.
The Wrox book "Professional Apache Tomcat" has good instructions, too. I've done it successfully many times. - MOD -
hi,
i am having problem connecting Apache and Tomcat with mod_jk connector. i am not getting any exceptions. the problem is when i am trying to access .jsp pages from apache ... its showing me code ....
i have used this just below the <server port=8080> in server.xml :
<Listener className="org.apache.ajp.tomcat4.config.ApacheConfig" modJk="/usr/local/apache2/modules/mod_jk.so" />
in the same server.xml file i have used this line in the host tag :
<Listener className="org.apache.ajp.tomcat4.config.ApacheConfig" append="true" forwardAll="false" modJk="/usr/local/apache2/modules/mod_jk.so" />
and i have used the "Include <path>/mod_jk.conf " in httpd.conf
is there nething i am missing ...
thanx in advance ...
psrHere are my particular settings that work. There's only this file you need to alter. Usually it's called httpd.conf
<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"
JkMount /Market/* example
JkMount /Market example
JkMount /Market/*.do example
JkMount /Market/*.jsp example
JkMount /se/* example
JkMount /se example
JkMount /se/*.do example
JkMount /se/*.jsp example
</IfModule> -
Integrating Tomcat and Apache - typo in the instructions??
I'm a total newbie at this, but one line in the "Flashguide" instructions I found on Galatea http://galatea.com/flashguides/home looked wierd to me:
In the instructions for integrating Tomcat 4.0.x to Apache 2.0.x using mod_jk, it states that the mod_jk.so file should go in the APACHE_HOME/libexsec folder.
Then, further on down in section 5 it says that, for Apache 2.0, one should add the line:
"LoadModule jk_module modules/mod_jk.so" to the httpd.conf file.
Shouldn't that be "LoadModule jk_module libexec/mod_jk.so"?? Thats what is says to do for Apache 3.x,
The Galatea instructions otherwise seem pretty succinct and easy to follow.Tomcat 4.0.6 happens to be on the server - and I can't change it (yet). Right now it isn't working in either folder, I am trying to remove this issue as an unknown before looking at other things. Do the math - it'll save about half my time when I try to correct other things.
-
Tomcat and Apache: No go
Hi,
Some time ago I've been working with Apache (3.17 or something) and Tomcat 3.x on a Win98 system. This worked quite well...
Now I have downloaded and installed Apache 3.20 and Tomcat 4.0 on a WinME system. Apache works properly and I can also run the JSP and servlet examples of Tomcat (http://localhost:8080).
However, I cannot access the sample JSP's and servlets when I'm using Apache. That is, if I go to the default index.html of Apache (http://localhost/) I get the page, but http://localhost/examples fails.
I have tried to find information on how to link the Tomcat 4.0 'engine' with Apache 3.20 (I expect having to make changes to the httpd.conf file), but the renewed documentation on the Jakarta-Tomcat pages is total cr*p. I hope someone in these forums can show me an example of how to enable Tomcat 4.0 support in Apache 3.20 webservers...Okay, so far I've found out that MOD_WEBAPP takes care of accessing Tomcat 4.0 from Apache, so that problem is solved.
Suppose I want to add an example JSP of my own to the examples directory. I'm able to put the JSP file in a new subdirectory called "temp" under $CATALINA_HOME/webapps/examples/jsp and it runs.
However, after putting a new feature in my JSP file it crashed. When I put a classfile that is now required under $CATALINA_HOME/webapps/examples/WEB-INF/classes/temp, which is exactly where the Tomcat examples leave their classfiles, Tomcat tells me it cannot find the class. Can someone please show me an example of what I need to type in the server.xml file, a web.xml file and where exactly I'm supposed to put my classfile... -
I installed Apache HTTP server and Tomcat, but I cannot run the examples coming with Tomcat. What config should I change, or what should I do? Thanks.
Thanks for all of your help. Now I am using Tomcat only and it works well. Just wondering what is the advantage of using Apache along with Tomcat.Benefit of using Tomcat + Apache
1. For reverse proxy.
For example, your domain name is www.abcd.com.
Now you have program written in PHP and Java.
PHP run under Apache.
Java run under Tomcat.
Here, you can use Apache as PHP server as well as reverse proxy.
Using reverse proxy, you can redirect all incoming request which begin with http://www.abcd.com/servlet/ to Tomcat. Other than that, go to php.
2. Apache is faster for file download.
For example, if your website is a multimedia website. You may think to make your website more responsive. Retrieving picture/sound/html files from Apache is generally faster than Tomcat.
You can put all the pictures in 1 directory (/pictures/). If client request for picture, let apache handle it. But if client request for JSP/Servlet, forward it to Tomcat (reverse proxy).
3. Rewrite Engine
Apache is very powerful with its rewrite engine. You can learn this from apache website. Basically rewrite engine is a request string reconstructor module.
For example:
http://www.mydomain.com/ARTICLE_12341555.HTM
can be reconstructed by apache rewrite into
http://www.mydomain.com/servlet?action=getArticle&varticle_id=12341555&jsp=ShowArticle
As you see, generally people like shorter url.
The advantage of the first url is its spiderability. Generally web crawler (yahoo, hotbot, google) crawl url which is static. The first url looks static, right?
rgds,
Alex -
Tomcat and apache bundle in Solaris10
I am a little confused between apache and apache2 bundled with Solaris10
There is
/usr/apache/tomcat/
/usr/apache2/
I have apache2 web server started on my sol10 instance but there is no tomcat container
How do I configure tomcat to run with apache2 on a default install of solaris10? Must I migrate the tomcat that comes with apache or install a new version of tomcat? or ??
thanksThe stuff that ships with Solaris is primarily used by Solaris utilities.
If you want to use it for your own purposes then you're better off installing your own version somewhere in the fileystem and then configure accordingly.
A patch to the supplied stuff could break your custom config.
alan -
Hi,
Wanted to know regarding the performance difference between apache'Jserv and tomcat.
I'm using apache with Jserv for JSP and i have an search engine application which fetches values from the database and if multiple users are accessing the site at the same time...the JVM goes 100% and the page is not displayed.
I wanted to know that if i switch from Apache and JServ to Apache and Tomcat..will it make any difference performance wise or will it be the same.
Platform: WindowsNT
Backend: Oracle 8i.
Thanks in advance.To my understanfing, JServ was the older jsp container from apache and it is not being developed or maintained anymore. Tomcat is the new apache jsp container and it is activley develped (They release minor version very often).
You can find more info on the tomcat documentation at
http://jakarta.apache.org/tomcat
Ylan -
Apache HTTP server and Tomcat integration using mod_jk
Hi, I'm trying to get Apache version 2 Server running with Tomcat 7 as the Java Servlet container (I'll be using Solr as the webapp next). Followed the instructions in the wiki articles Tomcat and Apache and Tomcat.
The applications work fine separately. It's only when I modify the httpd.conf files as instructed that I get this error when I restart httpd and tomcat. This problem seems identical to this topic although the user that posted it does't know how he fixed the problem.
Terminal wrote::: Starting Apache Web Server [BUSY]
/usr/sbin/apachectl: line 84: 8640 Bus error $HTTPD -k $ARGV [FAIL]
The only bit that I didn't follow to the letter is the part where it says to set TOMCAT_JAVA_HOME=/opt/java \. I have it as
TOMCAT_JAVA_HOME=/usr/lib/jvm/java-7-openjdk. No idea why it repeats that the java home is in the /opt directory.
I installed mod_jk from the AUR version 1.2.37-1.
Any idea what the problem is?download the binary version of TomCat from
http://jakarta.apache.org/
and install it. but your need to set the environment variable...pls refer to
http://www.amazon.com/exec/obidos/tg/stores/detail/-/books/1861002092/reader/18/ref=lib_dp_TT01/103-9996294-0061449#reader-link
JSP hava some similarity of ASP. ASP is using Personal Web Server.
heng -
Apache - mod_jk - tomcat site filesystem question
hi all
we finished today to set up apache+mod_jk+tomcat togheter
we done it because in this way apache will serve static pages and tomcat jsp + servlet right?
now, a (maybe stupid) question:
how to make apache serve static pages and tomcat jsp & servlets? shall we divide our site into two directories (one, with static pages and the other with servlet and jsp) or there is a way to map our site under tomcat and apache in order to avoid such a division?
thanx a lot
sandrothanx a lot for your answer
but i need another suggestion:
lets imagine i have my little site with this directory sistem:
directory "mysite"
here a lot of *.htm files and a directory named "dinamic" containing all the dinamic content (*.jsp and the WEB-INF/classes/*.class files)
now my question is:
can I leave this structure intact or shall i divide the *.htm files from the dinamic content?
what do the standard tell?
thanx a lot
sandro
Maybe you are looking for
-
.Mac aliases no longer appearing in Account pop-up menu
Hi, a couple of days ago I noticed that my .Mac aliases are no longer listed in the Account pop-up menu of new messages. I thought it's a temporary .Mac problem, but this has continued. The account is a .Mac account (not POP nor IMAP), and I can go t
-
Does 5870 support ACD/VGA/HDMI at the same time?
I have a 5870 video card in my 2010 Mac Pro. One mini displayport (mDP) is connected to a 27" ACD. Currently I have the second mDP connected through a mDP-to-VGA adapter to a 17" VGA monitor. Everything works fine. I decided to free up the second mDP
-
HT1420 How do you see what computers are authorized for your account?
How do you see what computers are authorized for your itunes account?
-
I upgraded to Lion yesterday. Now I keep getting and error message: there was a problem connecting to the server. URLs with type "file:" are not supported. What server? How do I get rid of this.
-
My iphone started deleting folders when syncing or updating
My iPhone has started deleting folders when I sync or update my apps. This is a brand new problem since my recent software upgrade. Never occurred before. Any ideas what is going wrong?