You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by nbd95 <nb...@macconnect.com> on 2001/09/12 21:01:33 UTC

Help: Tomcat 3.2.3 and Apache on FreeBSD **Java newbie**

The details:

FreeBSD 4.1
Jakarta-Tomcat 3.2.3
JDK-1.1.8
Apache 1.3.20 (DSO)
mod_jk

I've been around the block with PHP, Perl, Bash, Apache, Unix, Linux,
Postfix, BIND, Netatalk, Samba, Kernels. Building, configuring, patching,
set-up, custom compiling, all no problem. I am *new* to Java.

I've installed Tomcat-Apache and it appears to work.
http://localhost/examples accessed through Apache, the Tomcat examples all
function. http://localhost:8080/ accesses the Tomcat main page, the examples
work here as well.

I have returned my configuration to the beginning, removing my muddled
attempts at setup. Currently I have this line added to my httpd.conf,

Include /usr/local/tomcat/conf/mod_jk.conf

mod_jk.conf has been changed *only* to correct the path to mod_jk.so and the
path to the mod_jk.log file. At this point Apache starts, loads mod_jk.so,
and the examples can be accessed and run successfully.

Thhhhpppppppppppppp! Phooey.

My problem is I am trying to get examples of *.jsp code to work
unsuccessfully. I have example code from a book (Core JSP) that I cannot
run. Can anyone step me through creating a directory where I might store
*.jsp files for experimenting? I'm simply trying to eval JSP and explore
it's environment.

I've read the book, Core JSP, and the "Working with mod_jk" - "Tomcat-Apache
HOWTO" papers. I still don't get which *.conf files I need to modify to send
*.jsp files to Tomcat from the Apache directory structure.

I thank you for your indulgence.

DAve



Re: Help: Tomcat 3.2.3 and Apache on FreeBSD **Java newbie**

Posted by nbd95 <nb...@macconnect.com>.
Of course you are correct, an admin with my experience should have thought
of that ;^) 

I do have everything running now, but I am having troubles with some sample
pages not compiling properly, specifically those which use higher level
functions such as Calendar. I'm going to browse around and look for answers
before I come back to the group with more questions.

I'd still like any recommendations on docs or tutorials though. After using
many different web tools, many during beta cycles for their first release, I
have to say Tomcat/JSP seems to be the least documented beast I've ever run
across. Much knowledge seems to be assumed. If I end up using JSP I'd like
to help change that.

I appreciate the help.

DAve

P.S. Your English is fine. I'm sorry that I'm not bilingual, as you are ;^)

on 9/14/01 4:35 AM, Plamen Petkov at plamendp@bgstore.com wrote:

> Hi,
> 
> Don't ask WHY, but I feel it is not good idea to allow acces to any
> tomcat administrative apps  through Apache. I mean: don't include
> webapp/admin to mod_jk.conf.  (wich allows  http://yourhost/admin  )
> 
> Just use:
> 
> http://yourhost:8080/admin
> 
> For example, any config mistake in <Directory> section in mod_jk.conf
> may lead to an undesired (browse) access to your /access app directory.
> Yes, Apache is highly configurable - ergo: mistakes are "highly
> possible" :-)  /forgive my broken english :-)/
> 
> Pozdravi,
> ---
> Plamen D. Petkov, ICQ# 2214327
> plamendp@bgstore.com
> http://www.bgstore.com
> 
> 
> ----- Original Message -----
> From: nbd95 <nb...@macconnect.com>
> To: <to...@jakarta.apache.org>
> Sent: Thursday, September 13, 2001 7:36 PM
> Subject: Re: Help: Tomcat 3.2.3 and Apache on FreeBSD **Java newbie**
> 
> 
>> Ahhh, ignore <tomcat_home>conf/tomcat-apache.conf
>> 
>> Add webapps/admin and webapps/test to mod_jk.conf. Restart everything
> and
>> now core,admin,test,examples all work. Though I cannot get a welcome
> or
>> index page to work, accessing examples/jsp/ does provide a directory
>> listing.
>> 
>> Still digging.
>> 
> 
> 


Re: Help: Tomcat 3.2.3 and Apache on FreeBSD **Java newbie**

Posted by Plamen Petkov <pl...@bgstore.com>.
Hi,

Don't ask WHY, but I feel it is not good idea to allow acces to any
tomcat administrative apps  through Apache. I mean: don't include
webapp/admin to mod_jk.conf.  (wich allows  http://yourhost/admin  )

Just use:

http://yourhost:8080/admin

For example, any config mistake in <Directory> section in mod_jk.conf
may lead to an undesired (browse) access to your /access app directory.
Yes, Apache is highly configurable - ergo: mistakes are "highly
possible" :-)  /forgive my broken english :-)/

Pozdravi,
---
Plamen D. Petkov, ICQ# 2214327
plamendp@bgstore.com
http://www.bgstore.com


----- Original Message -----
From: nbd95 <nb...@macconnect.com>
To: <to...@jakarta.apache.org>
Sent: Thursday, September 13, 2001 7:36 PM
Subject: Re: Help: Tomcat 3.2.3 and Apache on FreeBSD **Java newbie**


> Ahhh, ignore <tomcat_home>conf/tomcat-apache.conf
>
> Add webapps/admin and webapps/test to mod_jk.conf. Restart everything
and
> now core,admin,test,examples all work. Though I cannot get a welcome
or
> index page to work, accessing examples/jsp/ does provide a directory
> listing.
>
> Still digging.
>



Re: Help: Tomcat 3.2.3 and Apache on FreeBSD **Java newbie**

Posted by nbd95 <nb...@macconnect.com>.
Ahhh, ignore <tomcat_home>conf/tomcat-apache.conf

Add webapps/admin and webapps/test to mod_jk.conf. Restart everything and
now core,admin,test,examples all work. Though I cannot get a welcome or
index page to work, accessing examples/jsp/ does provide a directory
listing.

Still digging.

DAve

on 9/13/01 9:53 AM, nbd95 at nbd95@macconnect.com wrote:

> Thank you Plamen! I can now run the core files. I am still having some
> problems with failures on the majority of the examples *.jsp from the core
> cd though. I'm looking into it, I'll post again if I can't find an answer.
> 
> Two questions and an observation.
> 
> First, as installed by default I'm able to execute both
> <tomcat_home>/webapps/examples and <tomcat_home>/webapps/core (my app) but I
> am unable to execute <tomcat_home>/webapps/admin. I don't see anything in
> the *.conf files to prevent this, why?
> 
> Second,  can anyone suggest a url/book/diet for more documentation? The
> provided docs are well written and doubtless make sense to to many, but for
> new users they are very vague.
> 
> Observation, all docs give example and make reference to adding the line
> "Include <tomcat_home>/conf/tomcat-apache.conf"
> to my httpd.conf. This causes apache to fail, not being able to open
> "/usr/local/./logs/mod_jserv.log" I can find no reference to "mod_jserv.log"
> in any file in <tomcat_home>/conf/*. Besides, I don't seem to need this line
> as tomcat appears to work.
> 
> I appreciate everyone's indulgence here,
> 
> DAve


Re: Help: Tomcat 3.2.3 and Apache on FreeBSD **Java newbie**

Posted by nbd95 <nb...@macconnect.com>.
Thank you Plamen! I can now run the core files. I am still having some
problems with failures on the majority of the examples *.jsp from the core
cd though. I'm looking into it, I'll post again if I can't find an answer.

Two questions and an observation.

First, as installed by default I'm able to execute both
<tomcat_home>/webapps/examples and <tomcat_home>/webapps/core (my app) but I
am unable to execute <tomcat_home>/webapps/admin. I don't see anything in
the *.conf files to prevent this, why?

Second,  can anyone suggest a url/book/diet for more documentation? The
provided docs are well written and doubtless make sense to to many, but for
new users they are very vague.

Observation, all docs give example and make reference to adding the line
"Include <tomcat_home>/conf/tomcat-apache.conf"
to my httpd.conf. This causes apache to fail, not being able to open
"/usr/local/./logs/mod_jserv.log" I can find no reference to "mod_jserv.log"
in any file in <tomcat_home>/conf/*. Besides, I don't seem to need this line
as tomcat appears to work.

I appreciate everyone's indulgence here,

DAve

on 9/12/01 5:00 PM, Plamen Petkov at plamendp@bgstore.com wrote:

> nbd95 wrote:
<snip>
>> My problem is I am trying to get examples of *.jsp code to work
>> unsuccessfully. I have example code from a book (Core JSP) that I cannot
>> run. Can anyone step me through creating a directory where I might store
>> *.jsp files for experimenting? I'm simply trying to eval JSP and explore
>> it's environment.
>> 
>> I've read the book, Core JSP, and the "Working with mod_jk" - "Tomcat-Apache
>> HOWTO" papers. I still don't get which *.conf files I need to modify to send
>> *.jsp files to Tomcat from the Apache directory structure.
>> 
>> I thank you for your indulgence.
>> 
>> DAve
> 
> 
> Here is my directory structure for testing all "Core JSP" book examples.
> I gave this Application a "core" name. All dirs are relative to tomcat's
> "webapps" directory, wich is /usr/local/tomcat/webapps.
> 
> [/usr/local/tomcat/webapps/]core   <-- HTMLs, JSPs
> core/jsp <-- HTMLs, JSPs
> core/WEB-INF     
> core/WEB-INF/classes   <-- non-packaged servlets
> core/WEB-INF/classes/coreservlets  <-- coreservlets's package servlets
> 
> As for your last question: use symlinks. The "core" application may
> reside anywhere. Just symlink /usr/local/tomcat/webapps/core to the
> place where it is.
> Apache directory structure and Tomcat's one are not related at all.
> 
> 
> http://mylocalhost/core/jsp/some.jsp
> http://mylocalhost/core/servlet/SomeServletInClassesDirectory
> 
http://mylocalhost/core/servlet/coreservlets.SomeServletFromCoreservletsPack
ag> e
> 
> 
> have a nice day.
> 
> p.s. I am new to Java/JSP/Servlets/Beans/etc/etc too :-)  But I like it.
> Coming from PHP world, it is a bit hard to get the point at once.. but..
> try :-)
> 
> Just split your mind into many pieces: one for Apache, one for Tomcat,
> one for this container, one for the other one..  :-)
> 
> 
> 
> 
> Regards,


Re: Help: Tomcat 3.2.3 and Apache on FreeBSD **Java newbie**

Posted by Plamen Petkov <pl...@bgstore.com>.
nbd95 wrote:
> 
> The details:
> 
> FreeBSD 4.1
> Jakarta-Tomcat 3.2.3
> JDK-1.1.8
> Apache 1.3.20 (DSO)
> mod_jk
> 
> I've been around the block with PHP, Perl, Bash, Apache, Unix, Linux,
> Postfix, BIND, Netatalk, Samba, Kernels. Building, configuring, patching,
> set-up, custom compiling, all no problem. I am *new* to Java.
> 
> I've installed Tomcat-Apache and it appears to work.
> http://localhost/examples accessed through Apache, the Tomcat examples all
> function. http://localhost:8080/ accesses the Tomcat main page, the examples
> work here as well.
> 
> I have returned my configuration to the beginning, removing my muddled
> attempts at setup. Currently I have this line added to my httpd.conf,
> 
> Include /usr/local/tomcat/conf/mod_jk.conf
> 
> mod_jk.conf has been changed *only* to correct the path to mod_jk.so and the
> path to the mod_jk.log file. At this point Apache starts, loads mod_jk.so,
> and the examples can be accessed and run successfully.
> 
> Thhhhpppppppppppppp! Phooey.
> 
> My problem is I am trying to get examples of *.jsp code to work
> unsuccessfully. I have example code from a book (Core JSP) that I cannot
> run. Can anyone step me through creating a directory where I might store
> *.jsp files for experimenting? I'm simply trying to eval JSP and explore
> it's environment.
> 
> I've read the book, Core JSP, and the "Working with mod_jk" - "Tomcat-Apache
> HOWTO" papers. I still don't get which *.conf files I need to modify to send
> *.jsp files to Tomcat from the Apache directory structure.
> 
> I thank you for your indulgence.
> 
> DAve


Here is my directory structure for testing all "Core JSP" book examples.
I gave this Application a "core" name. All dirs are relative to tomcat's
"webapps" directory, wich is /usr/local/tomcat/webapps.

[/usr/local/tomcat/webapps/]core   <-- HTMLs, JSPs
core/jsp <-- HTMLs, JSPs
core/WEB-INF       
core/WEB-INF/classes   <-- non-packaged servlets
core/WEB-INF/classes/coreservlets  <-- coreservlets's package servlets

As for your last question: use symlinks. The "core" application may
reside anywhere. Just symlink /usr/local/tomcat/webapps/core to the
place where it is.
Apache directory structure and Tomcat's one are not related at all.


http://mylocalhost/core/jsp/some.jsp
http://mylocalhost/core/servlet/SomeServletInClassesDirectory
http://mylocalhost/core/servlet/coreservlets.SomeServletFromCoreservletsPackage


have a nice day.

p.s. I am new to Java/JSP/Servlets/Beans/etc/etc too :-)  But I like it.
Coming from PHP world, it is a bit hard to get the point at once.. but..
try :-)

Just split your mind into many pieces: one for Apache, one for Tomcat,
one for this container, one for the other one..  :-)




Regards,
-- 
Plamen D. Petkov ICQ#2214327
plamendp@bgstore.com
http://www.bgstore.com