Re: Hi, Using Tomcat for the first time:

2001-02-13 Thread Geoff Lane

Yes, there are max_threads, min_spare_threads and max_spare_threads.
See:
http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/uguide/tomcat_ug.html
under 'Configuring thread pools'

Example:








Andrew Stewart wrote:
> 
> and I have to say I am impressed so far
> 
> I've tried three other Java VM's and have had very dissapointing
> experiences with them (Caucho's Resin, NA's ServletExec, and Allaire's
> JRun).
> 
> Anyway, one of the few questions I'd like to ask is if there's anyway to
> control the number of threads (or workers) that come up when Tomcat is
> run.
> 
> I tried looking for a setting something like MinServers / MaxServers
> akin to Apache but no dice, any help would be appreciated.
> 
> Thanks in advance.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 

Geoff Lane <[EMAIL PROTECTED]>
(650) 969-5000 x104

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Antigen found VBS/SST virus

2001-02-12 Thread Geoff Lane

It's a Windows/Outlook virus, they run the attachments in some cases
without you opening the file or anything. I got the same email, but
since I don't use Windows or Outlook, it has not gone on to anybody else
in my company. (I will avoid a flame fest here with making jokes about
MS products :))

Supposedly this virus does no damage - it's just annoying.
http://dailynews.yahoo.com/h/nm/20010212/wr/tech_virus_dc_1.html

The main concern to me is why the list notices it's a virus and then
retransmits it as an attachment on the notification! Seems like a pretty
bad idea. Any way to stop the SMTP server from doing that?

Anthony Ikeda wrote:
> 
> Whats the story with this? Has anyone else had this distributed through
> their company? Since this came through to my account, everyone else in my
> company has been receiving it (without effects, thankfully the virus agent
> picked this up) and the file hasn't even been opened!
> 
> Cheers,
> Anthony Ikeda,
> Web Application Developer,
> Proxima Technology,
> 
> Level 13,
> 181 Miller Street,
> North Sydney
> Australia
> 
> PH: +612-9458-1718
> Mob: 041 624 5143
> 
> > -Original Message-
> > From: ANTIGEN_SCOOBY [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, 13 February 2001 9:41 AM
> > To: '[EMAIL PROTECTED]'
> > Subject: Antigen found VBS/SST virus
> >
> >
> > Antigen for Exchange found AnnaKournikova.jpg.vbs infected
> > with VBS/SST
> > virus.
> > The file is currently Deleted.  The message, "Here you have, ;o)", was
> > sent from tsaiching wong  and was discovered in IMC Queues\Inbound
> > located at Brightspark/BSPARK-MAIN/SCOOBY.
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, email: [EMAIL PROTECTED]
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 

Geoff Lane <[EMAIL PROTECTED]>
(650) 969-5000 x104

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Servlet as welcome page?

2001-02-11 Thread Geoff Lane

If you want to have a servlet handle just the initial page, just map the
servlet to index.html. One thing is that you might have to actually have
an index.html file - it can be empty - to trick Tomcat into serving it
up.


Ritwick Dhar wrote:
> 
> Hello,
> 
> I want my servlet to handle all requests to the webapp. The servlet is
> defined in the web.xml as mainservlet, like so:
> 
> 
> mainservlet
> 
> 
> com.foo.bar
> 
> 1
> 
> 
> 
> 
> mainservlet
> 
> 
> /start
> 
> 
> 
> How can I make this servlet handle the request http://servername/webapp ?
> I'm assuming I need to tweak the welcome-file element in web.xml, but I
> can't quite get it to do what I want. Any examples?
> 
> (I tried searching in the archives, but all questions are concerned with
> html or jsp files)
> 
> Thanks
> Ritwick
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 
---
Geoff Lane  <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Running Tomcat as non-root

2001-02-06 Thread Geoff Lane

A Yang wrote:
> 
> > /usr/local/tomcat doesn't necessarily have to be
> > owned by root. The only thing you need to so is make
> 
> > sure that whichever user you run tomcat as has write
> 
> > permissions to the logs, conf and work directories
> > (those are the only ones Tomcat writes to I think).
> 
> I was a little iffy about leaving the entire conf
> directory writable by the nobody group, so I wound up
> just checking the java exceptions and permitting group
> write access to the affected files - mostly they are
> the automatically generated files like *.conf-auto.

I'm sure that will work as long as you don't miss any. :)
Generally the idea is to have a 'root jail' or sandbox. The idea is that
the server (tomcat) will be able to read and possibly write anything in
it's sandbox, but not read or write(especially not write) anything
outside of that. This will minimize a security exploit to being able to
trash the sandbox in most cases and not effect the rest of the system.
To truly implement this, native code would need to be called because
these are OS level calls, but you can get a rough approximation with
privleges.
 
> On a side note, I found that I was regenerating the
> Windows registry settings for redirecting IIS every
> time I started up Tomcat.
> 
> > This doesn't have to be 'nobody' though. You could
> > create a tomcat or www user for example.
> 
> Yes, I just figured I would use the same nobody user
> that apache was using.
> 
> Would it be best practises to have apache and tomcat
> running on separate, minimal userids?

That's probably a pretty good idea. This would allow you to limit the
ability of apache to read the 'raw' files that are intended to be served
by tomcat so that people couldn't snoop at your stuff (if you care about
that).

> > And if you want it to be owned by root, that's fine,
> > just use the group permissions to set the write
> > access.
> 
> Do you mean something like:
> 
>  1 -r--rw-r-- 1 root nobody    1024  foo

That's fine, but giving root write access won't hurt anything (if
someone has root privs, they can change the write privs anyway).

-- 
---
Geoff Lane  <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Running Tomcat as non-root

2001-02-06 Thread Geoff Lane

/usr/local/tomcat doesn't necessarily have to be owned by root.
The only thing you need to so is make sure that whichever user you run
tomcat as has write permissions to the logs, conf and work directories
(those are the only ones Tomcat writes to I think). This doesn't have to
be 'nobody' though. You could create a tomcat or www user for example.
And if you want it to be owned by root, that's fine, just use the group
permissions to set the write access.

A Yang wrote:
> 
> Hello All,
> 
> Can anyone tell me how to set up directory permissions
> to permit running Tomcat as a non-root user?
> 
> According to previous posts in the mailing list, I
> should be using 'su - nobody' when kicking off Tomcat,
> but nobody doesn't have authorities to write to
> usr/local.
> 
> What is the best practise for setting up Tomcat?
> /usr/local/tomcat should be owned by Root shouldn't
> it? I'm running Red Hat 6.2.
> 
> Thanks,
> 
> ___
> Do You Yahoo!?
> Get your free @yahoo.ca address at http://mail.yahoo.ca
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 
---
Geoff Lane  <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Automatic reloading of modified .jar/.class files

2001-02-03 Thread Geoff Lane

Yes it does, but it is a significant performance impact to enable it
(it's enabled by default).
Tomcat does not (that I know of) have a way of rereading configuration
files on the without a restart though.

James Bucanek wrote:
> 
> Greetings,
> 
> I'm a complete newbie to Tomcat.  I glanced through the documentation
> and FAQs and didn't find an answer to this.  So, now I'll annoy the
> list.  ;)
> 
> My ISP has just installed Tomcat and I plan to move several servlets
> that have been running under Sun's JSWDK reference server over to it.
> 
> One really annoying problem (actually the lack of a feature) under
> the JSWDK server is that the servlet's class loader wasn't smart
> enough to recognized when a .jar or .class file had been modified and
> know to reload those Classes.
> 
> The end result was, whenever I made a change to my servlet, I had to
> kill the server and start it up again.  Rather rude to those users
> with active sessions!
> 
> So, does Tomcat's class loader do this?  If not, is there some other
> way of forcing it to reload the servlet code?  That is, some way
> accessible to a mere user, and not one that requires root/admin
> privileges?
> 
> Thanks in advance,
> 
> James
> 
> __
> James Bucanek
> <mailto:[EMAIL PROTECTED]>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 
---
Geoff Lane  <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: performance

2001-02-02 Thread Geoff Lane
> throught
> > the source and see where they initalize the thread pool (probably in
> > PoolTcpConnectors).  Uping this size should give you more concurrent
> users,
> > however it will add more overhead when the server is idle.  While you're
> > running your test, keep an eye on your network bandwidth usage and cpu
> > utilization.  Its possible that you might be saturating the network (are
> the
> > responses very large?) or that you are only using one of your 4 processors
> > (I have no idea how to fix this).
> >
> > Randy
> >
> > PS Bob - where can I get some more fingers for my system?  It needs to
> count
> > to 2.
> >
> > -Original Message-
> > From: Steve Ruby [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, February 01, 2001 6:08 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: performance
> >
> > That math didn't really work with JMeter anyway... even if you did
> > have 20 threads with 1ms delay, you don't get 20,000 request/sec. Jmeter
> > starts up 20 threads which each make a GET request to the server
> > but each thread only makes another request after it receives an answer
> > then it waits 1ms or 100ms whatever you have it sent to... So if none
> > of the threads get an ansewr then you have 0 requests/sec after they
> > are all tied up.
> >
> > [EMAIL PROTECTED] wrote:
> > >
> > > Sorry, that was a typo. Jmeter is configured with a 100 ms delay, 20
> > threads
> > > :) , although the story is pretty much the same even with a 1000 ms
> delay.
> > >
> > > ( p.s. I also added an extra couple of fingers to the server so it could
> > > count higher ;) )
> > >
> > > Bob
> > >
> > > -Original Message-
> > > From: Randy Layman [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, February 01, 2001 3:50 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: RE: performance
> > >
> > > Light load?  It looks to me that you are sending
> > > 1ms * 1000 ms/s * 20 threads = 20,000 requests per second to the
> > > server.  This would translate to 20K request/second * 60 seconds/min *
> 60
> > > minutes/hour = 72,000,000 request per hour.  Maybe I'm not understanding
> > the
> > > numbers you quote (I'm not familary with JMeter), but I would be
> suprised
> > if
> > > any non-clustered web server running on Intel hardware could handle 72
> > > million hits per hour.
> > >
> > > (Although I would also be suprised if a Microsoft operating
> system
> > > could count to 72 million ;) )
> > >
> > > Randy
> > >
> > > -Original Message-
> > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, February 01, 2001 4:12 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: performance
> > >
> > > Hi,
> > >
> > > I know that Tomcat does not claim to strive for the performance
> > > characteristics of other servlet containers, such as resin. However, I
> am
> > > wondering just how bad the performance is. I have run some tests, and I
> > have
> > > been a bit surprised.
> > >
> > > Test environment is a 4 proc NT server with 1 gig of memory. I am using
> > > tomcat 3.2.1 running standalone, and have set the max heap size for the
> > JVM
> > > to be about half of physical memory, also I have the server hotspot jit
> > > installed.. Additionally I am using Jmeter to apply some load.
> > >
> > > With 1 Jmeter client configured with a standard delay of 1 ms and 20
> > > threads, the website being hit becomes essentially non-responsive. Using
> > the
> > > same configuration, but substituting resin for tomcat, shows no
> noticeable
> > > degradation in performance.
> > >
> > > Again, I am not surprised that resin performs better, but I am surprised
> > > that Tomcat is that much slower, with even a light load applied.
> > >
> > > Are these performance characteristics to be expected. Does these results
> > > surprise anyone.
> > >
> > > Any feedback would be appreciated, and thanks in advance.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 

Geoff Lane <[EMAIL PROTECTED]>
(650) 969-5000 x104

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: starting Tomcat at boot time on Linux

2001-02-01 Thread Geoff Lane

Here's one I wrote - works on Solaris and Linux . . .

Nael Mohammad wrote:
> 
> Do you want to contribute your script to the community? I for one would like
> to see it as a learning tool that I can use.
> 
> Thanks,
> Nael
> 
> Nael Mohammad
> Customer Support Analyst
> Neomar, Inc.
> 180 Montgomery Street
> Suite 2000
> San Francisco, CA 94104
> Tel: 415-403-7300 ext. 274  Fax: 415-403-7373
> " Wireless Means Business"
> --
> Sent from my BlackBerry Wireless Handheld (www.BlackBerry.net)
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 
---
Geoff Lane  <[EMAIL PROTECTED]>

#!/bin/sh
#
# Startup wrapper sript for Tomcat
# Sets up the environment variables needed to run Tomcat and then calls
# the proper tomcat script
# 
# chkconfig: - 85 15
# description: Tomcat is a servlet engine.
#
# Geoff Lane <[EMAIL PROTECTED]>
# 1/5/2001

# Environment variables
OS=`uname`

# Solaris takes different options
if [ $OS = SunOS ]; then
TOMCAT_OPTS="-Xms16m -Xmx128m -native"
else
TOMCAT_OPTS="-Xms16m -Xmx128m"
fi

LANG=en_US # Workaround for a Solaris/JDK 1.3 bug
CLASSPATH=
TOMCAT_HOME=
JAVA_HOME=

export JAVA_HOME TOMCAT_HOME CLASSPATH TOMCAT_OPTS LANG

# error "description"
error () {
  echo $0: $* 2>&1
  exit 1
}

# find the named process(es)
findproc() {
  pid=`/bin/ps -ef |
  /bin/grep -w $1 | 
  /bin/grep -v norestart |
  /bin/grep -v grep |
  /bin/awk '{print $2}'`
  echo $pid
}

# kill the named process(es) (borrowed from S15nfs.server)
killproc() {
   pid=`findproc $1`
   [ "$pid" != "" ] && kill -9 $pid
}


case "$1" in
start)
$TOMCAT_HOME/bin/tomcat.sh start &
;;
stop)
$TOMCAT_HOME/bin/tomcat.sh stop
if [ $OS = SunOS ]; then 
killproc tomcat
elif [ $OS = Linux ]; then
killall java # This is dangerous - take it out?
fi
;;
restart)
$0 stop
sleep 3
$0 start
;;
*)
echo "Usage: $0 { start | stop | restart }"
;;
esac

exit 0




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


Re: starting Tomcat at boot time on Linux

2001-02-01 Thread Geoff Lane

try appending an '&' to the end of your start line. That will fork the
process to the background. Sometimes when you don't do that and you log
out, the process will stop. Worth a shot . . .


Brett Perkes wrote:
> 
> I added a line to export JAVA_HOME and still get the same results.  Any
> other ideas?
> 
> - Original Message -
> From: "Kevin Sangeelee" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; "Brett Perkes" <[EMAIL PROTECTED]>
> Sent: Thursday, February 01, 2001 3:23 PM
> Subject: Re: starting Tomcat at boot time on Linux
> 
> I noticed that while you set TOMCAT_HOME, you didn't set JAVA_HOME. Could
> it be that Tomcat is using the wring JVM (i.e. kaffe that's installed by
> some distributions)?
> 
> On Thu, 1 Feb 2001, Brett Perkes wrote:
> 
> > I can start Tomcat from the command line and it continues to run great,
> even
> > runs my servlets nicely.  My problem is that when I start it at boot time
> it
> > runs for a short period of time and then dies.  I'm curious if there is a
> > some sort of log file or listing that I can read in order to get an idea
> of
> > why the program quits.
> >
> > Start up script:
> >
> > export TOMCAT_HOME=/usr/jakarta/dist
> >
> > case "$1" in

-- 
Geoff Lane <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: JDK 1.3 - Tomcat 3.2

2001-01-31 Thread Geoff Lane

I use the IBM 1.3 JDK on Linux and the Sun 1.3 JDK on Solaris. Both of
them work well with no Tomcat specific issues. You'll need to make other
code changes to get up to date with any deprecated APIs, but that's not
too difficult.

The only issue that I found was the Sun JDK on Solaris was not getting a
default encoding, so it was not handlin non-ASCII characters in a Cipher
method that we have. This was fixed by setting LANG=en_US before
starting Tomcat. But this was specific to this JDK/OS and had nothing to
do with Tomcat actually.

J2EE User wrote:
> 
> Friends:
> Our application works great with JDK 1.2.2 and Tomcat 3.2
> 
> Does any one know any issues if we upgrade to JDK 1.3
> 
> I know of one issue where the Tomcat 3.2 with not work as a service in Win
> NT with JDK 1.3
> Are there any other issues
> 
> Best Regards
> J2EE User
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 

Geoff Lane <[EMAIL PROTECTED]>
(650) 969-5000 x104

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: running as non-root/auto mode?

2001-01-30 Thread Geoff Lane

I wrote a shell script that sets environment variables and then called
the tomcat start script. This works well. Then you just need to put it
in /etc/init.d/ and make the symbolic links from the appropriate run
levels.

You can make tomcat run as a non-root user, but only if you want to have
it listen on ports above 1024. It has to run as root to bind to port 80
and doesn't have the ability (like Apache) to change user after the
binding takes place.

You can do something like: su - www -c ''
to get it to run as a non-root user in a startup script (with GNU su at
least, I don't think the BSD version has the -c switch).


Joe Laffey wrote:
> 
> What is the easiest way to have tomcat startup at boottime running as user
> www?
> 
> Also, can we now use the non-manual auto-startup mode that worked with
> ApacheJServ1.0? (Where Java starts up automagically)??
> 
> Thx,
> 
> Joe Laffey
> LAFFEY Computer Imaging
> St. Louis, MO
> -
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 

Geoff Lane <[EMAIL PROTECTED]>
(650) 969-5000 x104

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: HTTPS to HTTP proxying

2001-01-30 Thread Geoff Lane

Because it allows us to have multiple machines serving one URL without
having multiple SSL certificates. It also offloads SSL encryption to
dedicated hardware. Those are the main reasons.

Stefán F. Stefánsson wrote:
> 
> Any particular reason you're using a proxy instead of Tomcats built in
> HTTPS support? (it came with 3.2 so you need to get that version if
> you're not already using it).
> 
> Regards, Stefan.
> 
> -Original Message-
> From: Geoff Lane [mailto:[EMAIL PROTECTED]]
> Sent: 29. janúar 2001 23:31
> To: [EMAIL PROTECTED]
> Subject: HTTPS to HTTP proxying
> 
> Ok, so
> I have a situation where we are doing an HTTPS to HTTP proxy.
> Essentially a proxy recieves the HTTPS request, makes an HTTP request to
> the server with Tomcat running standalone and then the response is
> returned through the proxy back to the user.
> 
> So, I access something like: https://somehost/index.html and there is a
> redirect in it like: out.sendRedirect( "nextpage.html" );
> Tomcat in this case will return the user to
> http://somehost/nextpage.html (notice no https). This makes some sense
> because Tomcat sees the scheme as HTTP not HTTPS. The odd part though is
> that this same setup worked with Java Web Server.
> 
> Anyone know how to handle this other than rewriting all of the redirects
> to absolute URLs?
> Thanks.
> 
> --
> Geoff Lane <[EMAIL PROTECTED]>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 
---
Geoff Lane  <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




HTTPS to HTTP proxying

2001-01-29 Thread Geoff Lane

Ok, so 
I have a situation where we are doing an HTTPS to HTTP proxy.
Essentially a proxy recieves the HTTPS request, makes an HTTP request to
the server with Tomcat running standalone and then the response is
returned through the proxy back to the user.

So, I access something like: https://somehost/index.html and there is a
redirect in it like: out.sendRedirect( "nextpage.html" );
Tomcat in this case will return the user to
http://somehost/nextpage.html (notice no https). This makes some sense
because Tomcat sees the scheme as HTTP not HTTPS. The odd part though is
that this same setup worked with Java Web Server.

Anyone know how to handle this other than rewriting all of the redirects
to absolute URLs?
Thanks.

-- 
Geoff Lane <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Odd error

2001-01-26 Thread Geoff Lane

Oh yeah forgot about ping being ICMP. :)

I'm going to look into exactly what the 'heartbeat' is. I think it opens
a connection and then doesn't send a request - but that's speculation. I
agree that the more robust method would be to actually do a GET and see
the results (maybe to a specific file and it can look for a keyword or
something).

I'll avoid the 'fork' route if at all possible cause I'm lazy and don't
want to maintain a patch that won't get included in the main distro. :)

Thanks for the thoughts . . .

"Craig R. McClanahan" wrote:
> 
> Geoff Lane wrote:
> 
> > Reply to myself. :)
> > So after some more digging, I find out that it's caused by a 'heartbeat'
> > monitor that we have on our servers to check the status. It pings port
> > 80 to check if the webserver is alive. Apache does not log this in it's
> > error logs as a Connection reset, but running Tomcat standalone does.
> >
> > Is this a bug? No request is actually being made, just a ping to port 80
> >
> 
> If by "ping" you mean "run the Unix 'ping' utility", you would be right.  The only 
>problem with that theory
> is that you can only ping hosts, not individual ports ...
> 
> What is happening is that your monitor program is violating the HTTP protocol, 
>because it is establishing a
> network connection to port 80, but never sending a valid request.  Therefore, it's 
>perfectly within Tomcat's
> rights to complain about it.
> 
> It is also perfectly within your rights to modify Tomcat to *not* complain about it, 
>since this is specific
> to your site's approach to network monitoring.  However, IMHO it is not a bug.
> 
> An alternative approach for your particular situation would be to have your monitor 
>process actually perform
> an HTTP request, instead of just connecting and disconnecting.  Besides avoiding 
>these error messages, this
> is also a more robust test to see if Tomcat is actually up and running (consider: if 
>all the request
> processing threads were hung for some reason, but the server socket thread was still 
>running, your monitor
> process would give you a false sense of security that everything is fine when it 
>really was not).
> 
> Craig McClanahan
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 
---
Geoff Lane  <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Odd error

2001-01-26 Thread Geoff Lane

Reply to myself. :)
So after some more digging, I find out that it's caused by a 'heartbeat'
monitor that we have on our servers to check the status. It pings port
80 to check if the webserver is alive. Apache does not log this in it's
error logs as a Connection reset, but running Tomcat standalone does. 

Is this a bug? No request is actually being made, just a ping to port 80
. . .


Geoff Lane wrote:
> 
> Solaris 7
> Tomcat 3.2.1
> Java2 SE (1.3)
> 
> So, we've been running Tomcat with our application without any problems.
> Everything has been working well on a number of test machines - both
> Linux and Solaris all using JDK 1.3 (IBM and Sun respectively).
> 
> A number of the machines have been spitting out errors like the
> following:
> 
> 2001-01-26 05:30:27 - Ctx(  ): 400 R( /) null
> 2001-01-26 05:30:27 - ContextManager: SocketException reading request,
> ignored - java.net.SocketException: Connection reset by peer
> at java.net.PlainSocketImpl.socketAvailable(Native Method)
> at java.net.PlainSocketImpl.available(PlainSocketImpl.java:451)
> at
> java.net.SocketInputStream.available(SocketInputStream.java:137)
> at
> 
>org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:214)
> at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
> at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> at java.lang.Thread.run(Thread.java:484)
> 
> It seems like it's happening every ~5 seconds, a new error like this is
> spit out. The number of Ctc(  ): 400 lines is variable from one to about
> five. Has anyone seen this?
> 
> (Sorry if this is common, the search is down in the archives)
> Thanks.
> 
> --
> Geoff Lane <[EMAIL PROTECTED]>
> 
> -----
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 

Geoff Lane <[EMAIL PROTECTED]>
(650) 969-5000 x104

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Odd error

2001-01-26 Thread Geoff Lane

Solaris 7
Tomcat 3.2.1
Java2 SE (1.3)

So, we've been running Tomcat with our application without any problems.
Everything has been working well on a number of test machines - both
Linux and Solaris all using JDK 1.3 (IBM and Sun respectively).

A number of the machines have been spitting out errors like the
following:

2001-01-26 05:30:27 - Ctx(  ): 400 R( /) null
2001-01-26 05:30:27 - ContextManager: SocketException reading request,
ignored - java.net.SocketException: Connection reset by peer
at java.net.PlainSocketImpl.socketAvailable(Native Method)
at java.net.PlainSocketImpl.available(PlainSocketImpl.java:451)
at
java.net.SocketInputStream.available(SocketInputStream.java:137)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:214)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)

It seems like it's happening every ~5 seconds, a new error like this is
spit out. The number of Ctc(  ): 400 lines is variable from one to about
five. Has anyone seen this?

(Sorry if this is common, the search is down in the archives)
Thanks.

-- 
Geoff Lane <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: 'Dir checksum error' untarring jakarta-tomcat-3.2.1-src.tar onSolaris .. ??

2001-01-23 Thread Geoff Lane

I'm pretty sure the tar that comes with Solaris and GNU tar can be
subtely incompatible. Try installing gnutar on the Solaris machine. (Get
it at http://www.sunfreeware.com as a pkg).

Tim Darling wrote:
> 
> Same error untarring jakarta-tomcat-3.1.1-src.tar on Solaris.
> 
> Anyone seen this?  If I untar on Linux and retar then ftp to Solaris, I
> get the same error.  Please help!
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 
---
Geoff Lane  <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Tomcat - MySql Question

2001-01-22 Thread Geoff Lane

I've used the mm.mysql at http://mmmysql.sourceforge.net/ with good
results. But to be honest, never in a very intensive environment, only
for some small testing projects - so I can't comment on stability under
load or anything. It is released under the GPL so you can fix bugs if
you find any . . .

Web master wrote:
> 
> Hello,
> 
> Is there anyone here using Tomcat-MySql, I need help to install the
> driver. I would like to know which is the best driver and how to install it.
> 
> Thanks in advance.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 

Geoff Lane <[EMAIL PROTECTED]>
(650) 969-5000 x104

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Howto share objects between mutiple jsp pages

2001-01-20 Thread Geoff Lane

We run multiple sites on a single machine all that use the same
servlets. We put our JARs in the $TOMCAT_HOME/lib directory and it works
like a charm. The normal rules apply to Objects, static data is shared
among all instances, etc. Is that what you were asking? I think the same
thing is accomplished by having a CLASSPATH available to tell tomcat
where to find a package.

> mall wrote:
> 
> 
> Can anybody tell me if it is possible for the container(tomcat) to
> load an object and to make
> that object available to all the pages/servlets contained within the
> container? I've
> asked this question before but i don't think i made my question clear
> enough the last time.
> 
> Thank you for your time.


-- 
---
Geoff Lane  <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: mod_jk.so Problem

2001-01-20 Thread Geoff Lane

venkatesan wrote:
> 
> Hi all,
> 1) I downloaded binary version of jakarta-tomcat-3.2.1.tar. I
> configured it
> in my Linux6.3 system. The tomcat server is running locally. While i try

You are running a Distribution that is at version 6.3 I assume, since
the latest release of Linux is 2.4.0. I don't know what distribution
that is, so I can't be sure of where your Apache stuff is installed or
anything.
 
> to configure it to Apache server which is in the same machine, i gone
> through the user guide and it tells that there should be one mode_jk
> module and in that there would be mod_jk.so file. But i could not find
> out mod_jk.so file else anywhere in my tomcat directory. I have both
> mod_jk.conf and mod_jk.conf-auto. How can i get the file mod_jk.so
> and include in my Apache httpd.conf.

Under /etc/httpd create a directory called 'libexec' and put the
mod_jk.so file in there.
Then in /etc/httpd/conf/httpd.conf add a line like:
Include //conf/mod_jk.conf

I don't like to use the mod_jk.conf-auto because it makes assumptions
about your setup (using /servlet/* for all servlet calls for example).
So, just edit the mod_jk.conf to however you need it - you could use the
auto created version as a starting point.

> 2) I donwnloaded a source version too. But i could not get mod_jk.so
> file after giving the command make -f Makefile.linux int the director
> .../native/apache1.3/.. it tells that  the file namely jni.h in
> ./jk/jk_jni_worker file is not found. so mod_jk.so files build is
> failed.. How can i get and the file mod_jk.so..  Pls help me i am
> spending lots time
> because of this...

jni.h is one of the Java Native Interface headers. These are needed by
Java programs to be able to call C code. To fix this, run: 'export
JAVA_HOME=' before you use the make command..

-- 
---
Geoff Lane  <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: can't get tomcat to launch

2001-01-20 Thread Geoff Lane

Look in the archives from a few days ago, I sent a response to the same
question with a script that can be used to run tomcat at boot. (Or start
and stop it manually at any time.) If you can't find it, let me know and
I'll eamil it to you.

[EMAIL PROTECTED] wrote:
> 
> I know this is really a linux 101 question, but I can't get tomcat to
> launch automatically out of rc.local. startup.sh and tomcat.sh run fine
> when I am logged in as root with all of my .bashrc settings, but the
> startupd doesn't seem to start the tomcat server on my machine.
> 
> Thanks,
> Alex
> 

-- 
---
Geoff Lane  <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: mod_jk.so

2001-01-19 Thread Geoff Lane

On RedHat (and many Linux distributions) - the apxs and header files are
provided in an apache-devel package if you installed it from an RPM or
DEB or the like. If you installed from sources you would need to look
under the base directory where you installed it, possibly under
/usr/local for example.

Hope that helps.

Eric Paul wrote:
> 
> Do a locate/find to figure out where your copy of apxs really lives and
> edit the Makefile to call it from the right location.
> 
> Eric
> 
> At 02:41 PM 1/19/2001, you wrote:
> >Hi Eric,
> >I make this, but the following error occurred:
> >make: /usr/sbin/apxs: command not found
> >What it can be this?
> >
> >
> >
> >--- Eric Paul <[EMAIL PROTECTED]> escreveu: > You need to download
> >the source and compile it yourself.  The
> > > mod_jk faq
> > > has info on how to do this, but some of it doesn't exactly work (as
> > > I found
> > > out today).  Perhaps the best solution is untar the source, change
> > > to the
> > > native/apache1.3 directory, rename Makefile.linux to Makefile,
> > > set/export
> > > your JAVA_HOME variable to point to your JDK installation (usually
> > > something like /usr/java/jdk1.3) and type make.
> > >
> > > Hope this helps!
> > >
> > > Eric
> > >
> > > At 12:49 PM 1/19/2001, you wrote:
> > > >Where I get mod_jk.so for linux??
> > > >Thanks
> > > >
> > > >__
> > > >Do You Yahoo!?
> > > >Get email at your own domain with Yahoo! Mail.
> > > >http://personal.mail.yahoo.com/
> > > >

-- 

Geoff Lane <[EMAIL PROTECTED]>
(650) 969-5000 x104

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: How do I assing more memory to Tomcat

2001-01-19 Thread Geoff Lane

I put that in a wrapper script that I use to start and stop tomcat using
the script that is shipped with the tomcat stuff. I also set the
CLASSPATH, JAVA_HOME, TOMCAT_HOME, etc in that script so that it is
really easy to just run the script and not have to worry about setting
environment variables.

Carlos López wrote:
> 
> Thank a lot.
> 
> Where is the best place to put TOMCAT_OPS?
> 
> then 16m and 128 are Megabytes.??
> 
> The machine I install tomcat to has 2Gigabytes off memory, 500 Mg are asiggn
> to Sybase, the server will work as dns and mail server, what would by a
> optimun number off bytes to assign to tomcat, we tink our site will have
> like 4000 user?
> 
> ----- Original Message -
> From: Geoff Lane <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, January 19, 2001 10:29 AM
> Subject: Re: How do I assing more memory to Tomcat
> 
> > The TOMCAT_OPTS are really just JVM parameters. e.g.:
> > TOMCAT_OPTS="-Xms16m -Xmx128m -native" or
> > TOMCAT_OPTS="-Xms16m -Xmx128m"
> > Run 'java -X' to get the options that your JVM supports.
> >
> > > Carlos López wrote:
> > >
> > > Hola
> > >
> > > I nedd to assing more memory to Tomcat how do -I do this.
> > >
> > > Where can I find more information about TOMCAT_OPS
> > >
> > > Thanks
> >
> > --
> > ---
> > Geoff Lane  <[EMAIL PROTECTED]>
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, email: [EMAIL PROTECTED]
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 

Geoff Lane <[EMAIL PROTECTED]>
(650) 969-5000 x104

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: How do I assing more memory to Tomcat

2001-01-19 Thread Geoff Lane

The TOMCAT_OPTS are really just JVM parameters. e.g.:
TOMCAT_OPTS="-Xms16m -Xmx128m -native" or
TOMCAT_OPTS="-Xms16m -Xmx128m"
Run 'java -X' to get the options that your JVM supports.

> Carlos López wrote:
> 
> Hola
> 
> I nedd to assing more memory to Tomcat how do -I do this.
> 
> Where can I find more information about TOMCAT_OPS
> 
> Thanks

-- 
---
Geoff Lane  <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Tomcat Not Shutting down properly

2001-01-19 Thread Geoff Lane

Kill all the threads, for some reason, the shutdown script doesn't seem
to kill them all. 
(IBM 1.3 JDK)

> Allan M wrote:
> 
> Hi,
> 
> After I shutdown Tomcat once using it's shutdown script i  am unable
> to run the server again till i restart my Linux Server. It gives a
> error message saying something like "Address already in use". I think
> it is not shutting down properly.
> 
> How can I solve this problem? Or some work around?
> 
> - Allan

-- 
---
Geoff Lane  <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Can't shutdown

2001-01-18 Thread Geoff Lane

On Unix, use ps to see if there are still Java/Tomcat processes running.
If so, you'll need to kill them manually before you can restart Tomcat.
I included method to kill all the remaining threads in the rc script
that I sent to the list yesterday.

I've seen this on the IBM 1.3 JDK for Linux.

Thomas Jenkins wrote:
> 
> I've installed Tomcat ver 3.2.1. I can start it up okay. The tomcat home
> page
> displays and functions okay. I shut it down and read "Stop tomcat."
> 
> However, when I try to start it up again, I get "Fatal error: address
> already being
> used." I've tried changing the default port designation (after killing
> tomcat), but the
> results are the same. ./shutdown.sh is not really shutting it down.
> 
> Thanks for any insight on this problem.
> 
> Tom
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 

Geoff Lane <[EMAIL PROTECTED]>
(650) 969-5000 x104

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: So can no one help with my Socket Write Error Question ?

2001-01-17 Thread Geoff Lane

Ok, I'll take a shot in the dark. :)
Is there a file called 'tomcat-power.gif' in your $TOMCAT_HOME/webapps
directory? If so, what is likely happening is that Tomcat is trying to
auto configure a context to /tomcat-power.gif - and since it can't
expand it or find a WEB-INF/web.xml inside it doesn't know what to do.

Just a guess, try moving the file and see if that changes anything.

Damian Penney wrote:
> 
> Just in case you missed it the first time :)
> 
> Can anyone tell me why I'm getting this error in the command prompt window ?
> The page seems to load ok though. I'm running W2K Advanced Server, and
> tomcat 3.2.1
> 
> 2000-10-24 01:41:19 - Ctx(  ): IOException in: R(  + /tomcat-power.gif =
> + null) Connection aborted by peer: socket write error
> 
> Thanks for your help,
> Damian
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 

Geoff Lane <[EMAIL PROTECTED]>
(650) 969-5000 x104

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: startup tomcat

2001-01-17 Thread Geoff Lane

Here's a startup script that I wrote:
#!/bin/sh
#
# Startup wrapper sript for Tomcat
# Sets up the environment variables needed to run Tomcat and then calls
# the proper tomcat script
# 
# chkconfig: - 85 15
# description: Tomcat is a servlet engine.
#
# Geoff Lane <[EMAIL PROTECTED]>
# 1/5/2001

# Environment variables
OS=`uname`

# Solaris takes different options
if [ $OS = SunOS ]; then
TOMCAT_OPTS="-Xms16m -Xmx128m -native"
else
TOMCAT_OPTS="-Xms16m -Xmx128m"
fi

CLASSPATH=
TOMCAT_HOME=
ANT_HOME=
JAVA_HOME=

export JAVA_HOME TOMCAT_HOME CLASSPATH ANT_HOME TOMCAT_OPTS

# error "description"
error () {
  echo $0: $* 2>&1
  exit 1
}
# find the named process(es)
findproc() {
  pid=`/bin/ps -ef |
  /bin/grep -w $1 | 
  /bin/grep -v norestart |
  /bin/grep -v grep |
  /bin/awk '{print $2}'`
  echo $pid
}

# kill the named process(es) (borrowed from S15nfs.server)
killproc() {
   pid=`findproc $1`
   [ "$pid" != "" ] && kill -9 $pid
}


case "$1" in
start)
$TOMCAT_HOME/bin/tomcat.sh start &
;;
stop)
$TOMCAT_HOME/bin/tomcat.sh stop
if [ $OS = SunOS ]; then 
killproc tomcat
elif [ $OS = Linux ]; then
killall java
fi
;;
*)
 echo "Usage: $0 { start | stop }"
;;
esac

exit 0

This will work for both Solaris or Linux. Be sure to edit the
environment variables for your setup.
The process is a bit different for each of them on how to get it to
start on boot. With Red Hat at least, there is a utility called
'chkconfig'. After you copy this file into /etc/init.d - run 'chkconfig
--add tomcat'. Then run 'chkconfig --level 345 tomcat on' to turn it on
for runlevels 3, 4, and 5.

Hope that helps.

Dario Novakovic wrote:
> 
> i run tomcat3.2 on linux box and i haven't got much expirience with linux so
> idon't know how to load tomcat on startup and i have to start ti allways
> manualy. i tryed placing startup.sh in rclocal and rcd.3 but it didn't work.
> what is a proper way to make tomcat start everytime my box is booted.
> 
> -----
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

-- 

Geoff Lane <[EMAIL PROTECTED]>
(650) 969-5000 x104

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: oracle blob problem

2001-01-17 Thread Geoff Lane

Eric:
I've never experienced that problem exactly, but you might need newer
Oracle JDBC drivers. There is a classes12.jar which is what we use.
Don't know if that will solve the problem, but it's worth a shot.

And for what it's worth, there's a serious bug in the Oracle drivers.
NEVER call Statement.setQueryTimeout() - If the query returns within the
time set, the thread will go to sleep and become a zombie . .. banged my
head against a wall for quite some time before I figured that one out.
:)

Good luck.

Eric Weber wrote:
> 
> Hi
> 
> I try to get a BLOB from an oracle database and to save it to a file.
> >From a small test program everything works fine. When I copy the code
> into a servlet I get a strange error from the database at the moment
> when I try to read the first byte on the InputStream:
> 
> java.io.IOException: ORA-01013: user requested cancel of current
> operation
> at oracle.jdbc.dbaccess.DBError.SQLToIOException(DBError.java)
> at
> oracle.jdbc.driver.OracleBlobInputStream.needBytes(OracleBlobInputStream.java)
> at
> oracle.jdbc.driver.OracleBufferedStream.read(OracleBufferedStream.java)
> at
> oracle.jdbc.driver.OracleBufferedStream.read(OracleBufferedStream.java)
> at lib.download.service(download.java:60)
> at
> org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
> at
> org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:597)
> at
> org.apache.tomcat.servlets.InvokerServlet.service(InvokerServlet.java:257)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
> at
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
> at
> 
>org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
> at
> org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
> at java.lang.Thread.run(Thread.java:484)
> 
> The JDBC connection works fine for Varchar and other "normal" data from
> the database.
> 
> I saw in the archive that somebody had a similar problem, but I couldn't
> find any answer to the problem.
> 
> I use Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_01)
> and Oracle8i Enterprise Edition Release 8.1.5.0.0. with the thin
> driver(classes111.zip) from oracle.
> I use Tomcat 3.1.
> 
> Does anybody have an idea about this problem?
> 
> ERic

-- 

Geoff Lane <[EMAIL PROTECTED]>
(650) 969-5000 x104

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Bug report

2001-01-17 Thread Geoff Lane

Does this happen on both a POST and a GET?
That 2048 limit is Netscape limit for GETs I think also (if I recall
correctly).
Does seem like a potential problem though . . .

Zsolt Koppany wrote:
> 
> Hi,
> 
> I use tomcat-3.2.1 under Linux and found probably a bug. When the
> request is longer then 2048 bytes tomcat produces an
> ArroyIndexOutOfBoundExceptions in HttpRequestAdapter.parseHeaderFiled.
> After I changed bufSize = 2048 to 10240 the error does not appear (my
> request is shorter).
> I tried to fix the problem in  HttpRequestAdapter.readHeader where the
> "buf" array should be reallocated, but I found no working solution.
> 
> Do you have any better ideas?
> 
> --
> Zsolt Koppany
> Intland GmbH www.intland.com
> Schulze-Delitzsch-Strasse 16
> D-70565 Stuttgart
> Tel: +49-711-7871080 Fax: +49-711-7871017

-- 
---
Geoff Lane  <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Running Tomcat as non-root user

2001-01-16 Thread Geoff Lane

Kitching - Thanks for the response. I was afraid of that.
'ifconfig' is the utility that lets you see information about the
network interfaces, not a firewall. :) Do you run multiple machines with
a firewall in front of them to do the redirection (w/ load balancing for
example) or do you run the firewall on each machine individually?

I asked our operations people about the same thing being done in our
load balancer (F5/BigIP) - but apparently it can't be done there.
Setting up a redirect on each machine could be a pain - not that I'd
have to do it. :)
Thanks again.

Kitching Simon wrote:
> 
> Hi Geoff,
> 
> As far as I know (and I did a fair bit of research on this
> topic), there is no way for any java app to start as one
> user, then switch to running as another user.
> 
> What I do is run tomcat on port 8080 as non-root, and
> use a firewall product to redirect port 80 -> 8080. This
> works fine.
> 
> I can't give you great details, as the firewall stuff was
> set up by a sysadmin (which I am not), but we use
> Solaris and I think the firewall is "ifconfig". I guess
> that linux' ipchains or ipfilter or whatever can do the
> same job.
> 
> Regards,
> 
> Simon
> > -Original Message-
> > From: Geoff Lane [SMTP:[EMAIL PROTECTED]]
> > Sent: Monday, January 15, 2001 11:46 PM
> > To:   [EMAIL PROTECTED]
> > Subject:  Running Tomcat as non-root user
> >
> > In the Tomcat UG under the heading 'Modify and Customize the Batch
> > Files' it says one of the reasons to do so (modify start up scripts)
> > would be: "To switch user from root to some other user using the "su"
> > UNIX command."
> >
> > This is an excellent idea from a security standpoint. But to bind to
> > port 80 (instead of the default high port 8080) root is needed. How many
> > applications do this (Apache for example) is to initially run as root,
> > bind to port 80, and then drop root privileges. Is something like this
> > possible with Tomcat running standalone? Running concurrently with
> > Apache would accomplish this because the AJP connection could be run as
> > any user since it's on a high port.
> >
> > Thanks.
> >

-- 

Geoff Lane <[EMAIL PROTECTED]>
(650) 969-5000 x104

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: How to disable the port in Tomcat with IIS

2001-01-15 Thread Geoff Lane

In your server.xml file there is something like:


  
  


Just comment that out ant Tomcat will not start it's own HTTP listner.
Likewaise, if you change the name="port" value="8080" - whatever you set
the 8080 value to will be the port that the HTTP listener runs on.
 

[EMAIL PROTECTED] wrote:
> 
> I successfully configured the Tomcat 3.2 with IIS, by using port:80, I can
> access servlets through IIS. The problem is how I can disable the port:8080
> which directly go to Tomcat, then every access must go through IIS. Please
> help!
> 

-- 
Geoff Lane <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Running Tomcat as non-root user

2001-01-15 Thread Geoff Lane

In the Tomcat UG under the heading 'Modify and Customize the Batch
Files' it says one of the reasons to do so (modify start up scripts)
would be: "To switch user from root to some other user using the "su"
UNIX command."

This is an excellent idea from a security standpoint. But to bind to
port 80 (instead of the default high port 8080) root is needed. How many
applications do this (Apache for example) is to initially run as root,
bind to port 80, and then drop root privileges. Is something like this
possible with Tomcat running standalone? Running concurrently with
Apache would accomplish this because the AJP connection could be run as
any user since it's on a high port.

Thanks.

-- 
Geoff Lane <[EMAIL PROTECTED]>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Blending webapps with HTML files

2001-01-12 Thread Geoff Lane

First time posting to the list. So good to meet you all. :)

> David Wall wrote:
> 
> I'm new to Tomcat 3.2.1 and Servlet 2.2 in particular, having just
> come from JRun before webapps made their debut.
> 
> I'm struggling with the "best practices" people are using for storing
> their JSPs and Java class files in the webapps directory, while
> storing images and html files in the web server directory root.
> 
> For example, in Apache 1.3.14, my document root is htdocs and I am
> putting some files there for serving by apache, like:
> 
> htdocs/images/a.gif
> htdocs/images/b.gif
> htdocs/index.jsp <-- empty dummy file workaround so that Apache
> will send a request for "/" to Tomcat's ROOT index.jsp
> htdocs/app.js
> htdocs/app.css
> etc...

I've noticed the same thing with mapping a servlet to an index file (in
my case I mapped it to index.html). I think you have to 'trick' the
webserver into loading a file - if it doesn't find a default file to
load it won't do anything.
 
> And in my webapps under Tomcat I have:
> 
> webapps/ROOT/index.jsp<-- the actual index.jsp served up when I
> enter "/" for apache
> webapps/ROOT/WEB-INF/classes/   (all of my class files needed just by
> the index.jsp file)
> webapps/pub/index.jsp
> webapps/pub/company.jsp
> webapps/pub/news.jsp
> webapps/pub/WEB-INF/classes/   (all the class files needed by 'pub'
> application, even though they are the same as those for ROOT).
> 
> My questions are:
> 
> 1) This separation of the JSP files from stuff like images,
> javascripts, stylesheets when deployed seems like a pain since they
> need to be in the same directory when I'm using my editing tools (like
> Dreamweaver).  Only when I deploy do I need to move the static files
> to the apache locations and the JSPs to the Tomcat webapps area.
> Don't others find this to be a pain, or I am just not doing it right?
> 
> 2) The ROOT and pub applications are really not distinct applications,
> only a separation of JSPs and such from the root to a public
> directory.  I had this subdirectory structure back before webapps, and
> they were done to organize the JSPs into logical groups like how all
> HTML sites are done.  They are not put into separate subdirectories
> because they are separate webapps.  Can a single webapp support
> multiple directories, or at least a directory and all subdirectories?
> Perhaps ROOT is just abnormal because everybody wants a page to be
> displayed when they enter your URL like http://myeastside.com/
> 
> 3) When Java classes are shared by several webapps, they have to
> appear in each of the webapps' WEB-INF/classes directories.  Is that
> what people are doing, or are they JARing them up and then putting
> them in a common location (like Tomcat's 'lib') to be shared by all?

What I found - and prefer - is to put shared JARs in the
$TOMCAT_HOME/lib directory. All of the applications will find them then
and share the same ones. They can also be found/loaded if they are set
in the CLASSPATH (on Unix I have a wrapper script that sets this before
starting Tomcat). One example of something you have to have in the
CLASSPATH and not the lib directory is the j2ee.jar if you access it -
Tomcat won't start with it in the lib directory (probably because it
declares the servlet stuff agina).

> Any thoughts will help.  The separation forced by the webapps concept
> seems broken to me since it seems unlikely that web servers and their
> standard document root processing is not going to go away anytime soon
> (we still have PHP, CGI, images, etc. besides JSPs).
> 
> David

My understanding of webapps is that it is for autoconfiguring things.
But it is completely optional. I'm exploring Tomcat at work and chose to
intentionaly not use webapps so that we would force ourselves to
explicitly control the configuration of the application. So, that being
said, one thing you could do: in your server.xml file create a context
or a virtual host and map it to the directory where the Apache docRoot
lives. E.g.:
(Forgive any errors, this is from memory)



 

Then under c:/htdocs you'll need your WEB-INF directory with it's
web.xml file mapping *.jsp to the JSP engine, etc. I've never done this
with JSPs, but it works with static files and servlets so I don't see
why it wouldn't with them.

Don't know if these are Best Practices, but they're working so far for
me. :)

-- 
---
Geoff Lane  <[EMAIL PROTECTED]>
'For a list of the ways which technology has 
failed to improve our quality of life, press 3.'

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]