Re: Garbage collector

2009-08-17 Thread Rusty Wright

In my /etc/init.d/tomcat shell startup script for linux I have

JAVA_OPTS=-server
JAVA_OPTS=${JAVA_OPTS} -Xmx512m
JAVA_OPTS=${JAVA_OPTS} -XX:MaxPermSize=256m
JAVA_OPTS=${JAVA_OPTS} -XX:+PrintGCDetails
JAVA_OPTS=${JAVA_OPTS} -XX:+PrintGCTimeStamps
JAVA_OPTS=${JAVA_OPTS} -XX:+UseConcMarkSweepGC
JAVA_OPTS=${JAVA_OPTS} -XX:+CMSIncrementalMode
JAVA_OPTS=${JAVA_OPTS} -XX:-TraceClassUnloading
JAVA_OPTS=${JAVA_OPTS} -verbose:gc
export JAVA_OPTS

The export line is necessary.  The following 3 lines are what I think 
turn on garbage collecting logging:


JAVA_OPTS=${JAVA_OPTS} -XX:+PrintGCDetails
JAVA_OPTS=${JAVA_OPTS} -XX:+PrintGCTimeStamps
JAVA_OPTS=${JAVA_OPTS} -verbose:gc

Then, in my catalina.out I have lines (the CMS- lines are from 
UseConcMarkSweepGC):


48124.665: [GC [1 CMS-initial-mark: 39226K(67176K)] 40336K(71656K), 
0.0090660 secs]

48124.674: [CMS-concurrent-mark-start]
48125.090: [CMS-concurrent-mark: 0.416/0.416 secs]
48125.091: [CMS-concurrent-preclean-start]
48125.091: [CMS-concurrent-preclean: 0.000/0.000 secs]
48125.097: [GC[YG occupancy: 1135 K (4480 K)]48125.097: [Rescan 
(parallel) , 0.0093270 secs]48125.106: [weak refs processing, 0.0003890 
secs] [1 CMS-remark: 39226K(67176K)] 40362K(71656K), 0.0101020 secs]

48125.107: [CMS-concurrent-sweep-start]
48125.158: [CMS-concurrent-sweep: 0.050/0.050 secs]
48125.158: [CMS-concurrent-reset-start]
48125.189: [CMS-concurrent-reset: 0.031/0.031 secs]
48402.052: [GC 48402.052: [ParNew: 4415K-0K(4480K), 0.0178790 secs] 
43420K-39329K(71656K), 0.0181320 secs]




hruesga wrote:

i'fe tried to export CATALINA_OPTS setting as:

execute:

export CATALINA_OPTS=-Xloggc:/logs/gc.log
result: gc.log file doesn't create

java -verbose:gc
result: nothing happpens.





Caldarale, Charles R wrote:

From: hruesga [mailto:lord_dyna...@hotmail.com]
Subject: Re: Garbage collector

-Xmx3072m -Xms3072m

Unless you're in a 64-bit environment, that doesn't stand a chance of
working.


Maz Threads= 500

Is that supposed to be Max?  Where do you have that set?


minSpareThreads=25
maxSpareThreads=75

The threads settings are not really relevant to getting GC logs.

For the third time, tell us *exactly* what you're doing - step by step.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org







-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat service public key

2009-08-17 Thread Rusty Wright
I'd try the hudson mailing list; us...@hudson.dev.java.net and you'll 
need to sign up first I'll bet.



Gagan Malik wrote:

Hi, I'm a newbie to both tomcat and ssh and here's my problem:

I have a web-app (Hudson) running on tomcat (ver 5). This Tomcat runs as a
service on RHEL box. Hudson triggers a custom 'ant' script to do a build
which uses ssh to login to another server (svn server).

The ant script runs perfectly fine when triggered manually, since the user
that runs it shares his public key with the svn server. But when the same is
done via Hudson, it fails since hudson is run by the user: tomcat.

How can I generate and share the public key of user 'tomcat' (the service)
with the svn server so that the ant script does not fail.


I get this error:
Could not create directory '/usr/share/tomcat5/.ssh'.
Host key verification failed.
svn: Connection closed unexpectedly

Any help is appreciated.

Thanks


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Database pooling prob

2009-05-03 Thread Rusty Wright

What did you specify for the ip address that tomcat uses for connecting to the 
database?  If, for example, tomcat is using the host name of your machine, or 
its ip address that you'd use to connect to it from the outside, and psql is 
using localhost (127.0.0.1) which is a special ip address that always goes to 
the machine you're on, so that you don't have to know its ip address, that 
would be a difference in the configuration.  Or psql could be using a unix 
filesystem socket and not using tcp/ip.

Postgres uses some config file with hba in its name to configure its network 
security; fiddle with that and make it wide open so that tomcat can connect, 
then go back and figure out how to tighten its security so that only localhost 
can connect.


S Arvind wrote:

from this stack trace i can find that there is no problem in Tomcat or dbcp.
But when i try my postgre from outside application its working fine but when
i connect from local tomcat application it not working fine. I disable the
firewall and all ... but i keep on getting this stack 

AbandonedObjectPool is used
(org.apache.tomcat.dbcp.dbcp.abandonedobjectp...@d5eb7)
   LogAbandoned: true
   RemoveAbandoned: true
   RemoveAbandonedTimeout: 300
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (Connection refused. Check that the hostname and
port are correct and that the postmaster is accepting TCP/IP connections.)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)


When i tried the netstat to check my vista ports , at that time i found one
wierd line...

TCP[::1]:80   Michael:50522  ESTABLISHED
TCP[::1]:50522Michael:http   ESTABLISHED

As my tomcat is listening to 80, i dont know why i dont  get the ip address
in the netstat result for port 80 alone..
It is surely my tomcat request since only when i make the request its
showing...

I think the problem in ip only... please any one help.. postgres and tomcat
in same system and postgres is watchin to port 5432 only.

Arvind


*
Many of lifes failure are people who did not realize how close they were to
success when they gave up.
-Thomas Edison*



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat startup

2009-03-26 Thread Rusty Wright

As a workaround/kludge, could you have your tomcat startup scripts use the 
database command line tool to query the database and if it fails or doesn't 
return something reasonable, have it in a loop that sleeps for 5 or so seconds 
and then tries again?


Nathan Aaron wrote:
I am using Tomcat 6.0.18 and jdk1.6.0_12. I apologize for not posting 
that in the beginning.


I deploy several applications using one instance of Tomcat. The 
Application uses a database that resides on a separate server. When 
these servers are rebooted I would prefer that Tomcat start on server A. 
Then on server B, the database startup script can just make a call to 
start the context. If I don't do it this way Tomcat will start and start 
all the contexts. If the database is not available they will fail to start.


Thanks,
Nathan

Caldarale, Charles R wrote:

From: Nathan Aaron [mailto:naa...@glenraven.com]
Subject: Re: tomcat startup

Host name=localhost appBase=webapps
unpackWARs=true autoDeploy=true deployXML=true
xmlValidation=false xmlNamespaceAware=false
deployOnStartup=false

This had no effect. All the contexts started when Tomcat started.



I don't think they did - at least they didn't in my testing with 
6.0.18.  However, ten seconds *after* Tomcat started, the autoDeploy 
monitor kicked in, and that did deploy all the webapps.  I tried 
setting autoDeploy to false as well, restarted Tomcat, and then 
nothing deployed - ever.  Nor could I figure out a way to deploy 
anything manually, since the manager webapp wasn't deployed (catch-22).


One way around this is to keep your webapps in some directory other 
than the one pointed to by the Host appBase and deploy them by 
placing a Context element with the appropriate docBase setting in 
conf/Catalina/[host]/[appName].xml when you want the associated webapp 
to start.  Your Tomcat shutdown script would then remove all such 
files to prevent their automatic redeployment on the next Tomcat startup.


But let's back up one step from the original question: why do you not 
want the webapps to deploy when Tomcat starts?


 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE 
PROPRIETARY MATERIAL and is thus for use only by the intended 
recipient. If you received this in error, please contact the sender 
and delete the e-mail and its attachments from all computers.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



  




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Parameterizing log4j.properties/xml files

2009-03-20 Thread Rusty Wright

I was doing something like this with LogBack (successor to log4j more or less), 
but I'm no longer using it and don't remember how I set it up.  The class 
starts as follows:

 public final class InitLogback extends HttpServlet {
   @Override
   public void init() {
   final String pathPrefix = getServletContext().getRealPath(/);

And I think pathPrefix then contains the name of the directory in the tomcat 
webapps folder.

I don't remember how I was configuring this servlet in the web.xml file; 
possibly as a regular servlet with a load-on-startup value that was lower than 
the main (Spring) servlet.

I don't claim that this is the best way to accomplish this.

If you're using Spring you may want to look at its

org.springframework.web.util.Log4jWebConfigurer

and

org.springframework.web.util.Log4jConfigListener


Ken Bowen wrote:

All,

Apologies if I've missed the answer to this in the Logging HowTo, the 
FAQ, or Andre's collection of the logging discussion.


Env:  TC 6.0.18 + Java 1.5

The issue: I want to have several instances of the same webapp running 
on the same Tomcat as myapp1, myapp2, etc.

That's easy.

I'm going to be using log4j, probably with properties files, but xml 
would be ok too.
I'd like to have log files named mylog.log appear in 
${catalina.home}/logs looking like


myapp1-mylog.logmyapp2-mylog.log... etc.

I could hardwire this in separte log4j.properties files for each myapp 
instance, something like this:


log4j.appender.myLogFile.File=${catalina.home}/logs/myapp1-mylog.log
log4j.appender.myLogFile.File=${catalina.home}/logs/myapp2-mylog.log

And using ant to build my war files, I could hide this ugliness, just 
copying such hardwired files into the war being built.
But is there any parameter syntax that would allow me to grab the 
context name and write one log4j.properties with something like this:


log4j.appender.myLogFile.File=${catalina.home}/logs/${context-name}-mylog.log  
??


Thanks,
Ken


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: configuration about tomcat for work with mysql/J connector

2009-03-19 Thread Rusty Wright

http://lmgtfy.com/?q=tomcat+mysql+tutorial

E.g.,

http://www.roseindia.net/mysql/mysqldatabase.shtml


Tomas Rodriguez wrote:

Hi all
I'm new in Tomcat and java, I installed already Tomcat 6.0 for windows 
2000, I have to mysql server and the connector/j for work together mysql 
and Tomcat.
I declare a variable for connector mysql/j in panel 
control/system/advance(enviroment variable) , this variable have the 
mysql connector path,
I test the tomcat doing http://localhost:8080 and every is ok, but my 
problem is.


How Can I know that my connector java work with mysql without any 
problem?, what file I'll need change in the directory tomcat .
please somebody can help me, I wanna learn tomcat for developer a 
project very important to me.


thanks
have  a great day.
sincerely
TOMAS

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Unix daemon fails to compile

2009-03-04 Thread Rusty Wright

jsvc is part of Apache Commons isn't it?  Have you tried their mailing list?

http://commons.apache.org/daemon/mail-lists.html


Jeffrey Trimble wrote:
I'm running an IBM POWER server, AIX 5.3 and having the following error 
appear when configuring

jsvc.

checking for gcc option to accept ISO C89... none needed
checking for ranlib... ranlib
*** Host support ***
checking C flags dependant on host system type... failed
configure: error: Unsupported operating system aix5.3.0.0

So, is there a  switch that I need to enter to make it configure 
correctly?  I've never had

to set CFLAGS before, so any assistance would be nice.

TIA,


Jeffrey Trimble
System LIbrarian
William F.  Maag Library
Youngstown State University
330.941.2483 (Office)
jtrim...@cc.ysu.edu
http://www.maag.ysu.edu
http://digital.maag.ysu.edu




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: remember me authentication?

2009-02-26 Thread Rusty Wright

Plan C: go for the gusto and use Spring Security (aka Acegi).  Learning Spring 
and Spring Security should keep you busy for the next year or so.  Definitely 
looks good on the resume though.


Charl Gerber wrote:

Hi everyone,

Does Tomcat provide default support in some way to implement a 'remember me' 
feature for form based authentication? This should not be dependent on a user's 
browser remembering the username/password, but by a checkbox you can 
check/clear on the logon jsp.

If so, where do I find it? If not, how can I implement it? My guess is that I 
store the user credentials in a cookie, but how do I get every jsp/servlet in 
my application that requires authentication to automatically retrieve this and 
skip authentication? Sounds like a lot of overhead, unless Tomcat can take care 
of it.

Plan B, less desired, could be for the cookie to be read only in the logon (via 
javascript) jsp and automatically fill the credentials. So the user only have 
to type 'Submit' to logon. Not auto logon, but at least saves some typing. 
Pretty much the same as the browser would have done it, except your app now has 
control.

Thanks!

Charl


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: not using the port number in the address???

2009-02-25 Thread Rusty Wright

Sometimes people people without any swimming lessons get thrown into the deep 
end of the pool.  Given the economy and layoffs, we'll probably see it more 
often.


Mihamina Rakotomandimby (R12y) wrote:

David Smith wrote:

Since you haven't let us know anything about your server setup, we can
only suggest very general things.  Port 80 is the well known port for
HTTP protocol and the one your browser assumes when you don't type it in
the address bar. 


By the way, someone playing with Tomcat should know that... that's the 
basis.
Dont misunderstand me, I dont say he's dumb: I just wonder how could 
someone be in that situation (messing with web server setup and not 
knowing such basical theory).




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Getting the tomcat server IP

2009-02-21 Thread Rusty Wright

Yuval, wouldn't that give you the client's address?  I thought she wanted the 
server's ip address, with the added wrinkle that her server has multiple 
network interfaces.


Yuval Perlov wrote:

request.getRemoteAddr();

You can only get your actual IP after opening a connection. Of course it 
can change depending on where the connection is coming from.


Alternatively you can open a connection to a known public server, and 
figure out your IP using the resulting socket. If you are going through 
a NAT this might not be your actual IP but the IP on your side of the NAT.


Yuval Perov


On Feb 20, 2009, at 2:21 AM, Natalie Forood wrote:


Hello,

Can you tell me how I can get the IP address of the interface that is 
running Tomcat?  I can't use localhost, I need the IP of the physical 
interface.


Thanks,
Natalie



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Getting the tomcat server IP

2009-02-20 Thread Rusty Wright

Look at the servlet api docs; it appears that you can get the ip address; have 
look at javax.servlet.ServletRequest.getLocalAddr().

 http://java.sun.com/j2ee/1.4/docs/api/index.html


Natalie Forood wrote:

Thanka, but if I have multiple interfaces on the server, how do I know which 
interface to you from the ifconfig output?

 Natalie 







From: Steve ste...@up-south.com
To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, February 19, 2009 4:36:43 PM
Subject: Re: Getting the tomcat server IP

Natalie Forood wrote:

Hello,

Can you tell me how I can get the IP address of the interface that is running 
Tomcat?  I can't use localhost, I need the IP of the physical interface.

Thanks,
Natalie

ifconfig (linux/unix/mac osx)
ipconfig (windows cmd line)




-- eats the blues for breakfast,
does unix for rent,
plays harp for food,
will play the flute for kicks
rides for the freedom
scrapes for the challenge

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: starting and stoppping tomcat

2009-02-14 Thread Rusty Wright

Instead of trying to stop and start tomcat, would it help if your app used a 
more functional scheduling system?  For example, Quartz?

http://www.opensymphony.com/quartz/wikidocs/FAQ.html


paybackorfail wrote:

Hi, thanks for replying, my application will take some data from a website
and insert this data into a database and i schedule the application to do
this every hour using contextlistener and timertask as a java servlet. At
the moment it starts updating the database as soon as i upload the
application to the server, I need a way to shutdown the server so it will
stop updating the database


Alan Chaney wrote:

I think you need to rethink your use cases here...

Exactly WHY do you need to start and stop tomcat from a button on a web 
page?

Or do you really need to enable/disable some kind of function?

Generally speaking servers don't expect to be started or stopped by 
their clients - well, ok, sometimes you can stop a service by a client 
but almost by definition you can't start a service from a client...


Typically tomcat provides a way of processing requests received from 
remote web clients and arranges for the requests to be processed by a 
web application. Your application may have state which can be controlled 
by the request. This shouldn't normally affect tomcat's normal operation.


HTH

Alan Chaney


paybackorfail wrote:

That's a good point, what if it was just an html page?


Mark Thomas-18 wrote:
  

paybackorfail wrote:


Hi, I have written a web application in netbeans using java and jsp,
and
i am
hosting it on a server using tomcat, i need help on finding a way to
start
and stop the server by the user clicking a button on a jsp page, do i
have
to use the org.apache.catalina.ant.StartTask of the tomcat api? can
anyone
help?
  

If Tomcat is stopped, how is it going to handle a user clicking on a
button on a JSP page to start it?

Mark


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




  


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org







-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Can Tomcat accomplish this?

2009-02-06 Thread Rusty Wright

Apache Tuscany, perhaps.


Christopher Long wrote:

Hello:

I was just wondering if Tomcat is able to do something similar to what I've
described below.  If not, does anyone have any recommendations on a Web
Server that can?

I'm attempting to find a web server that can basically act as a hub.  Say if
someone attempts to send a SOAP request to http://1.1.1.1/message1 it will
redirect the message to the appropriate tool to handle it, whether it be a
Java program or maybe even another web server.  This next part is optional,
but ideal.  After the message is passed off to the appropriate handler, the
web server then waits for the response and will then forward it to the
original sender.

So does anyone know if Tomcat is able to handle this, or of any other web
server (open source) that can?

Thanks,

Chris Long



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: WEB-INF/classes vs WEB-INF/lib/classes.jar file

2009-02-05 Thread Rusty Wright
Of course it will; no doubts about it!  Any self-respecting maven fanatic can assure you of that!! 
;-)



epicwin...@hotmail.com wrote:

Thanks for all the replies.  Nice to know i can do this without any side 
effects.
I think I will have to look into maven and see if that fits my deployment needs.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: WEB-INF/classes vs WEB-INF/lib/classes.jar file

2009-02-04 Thread Rusty Wright

If you build your war files with maven you can use maven's profiles and have it 
build war files that contain settings tailored for each server.

http://www.sonatype.com/books/maven-book/
http://www.exist.com/better-build-maven


epicwin...@hotmail.com wrote:

Is there any advantage why I should not just jar all my class files and put 
them in WEB-INF/lib rather than exploding the jar file to the classes directory?


I like developing with the classes and I understand it is nice to let tomcat 
deploy a .war file but it also creates some problems for me because i deploy to 
multiple production servers with different settings that get overwritten every 
time my war file is expanded.




_
Windows Live™: Keep your life in sync. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_022009


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: running tomcat with root user.....umask in jsvc?

2009-02-02 Thread Rusty Wright

If you have control of the mode of the directory where the files are placed you 
may find the sticky bit helpful for propagating stuff down the treee:

 http://www.dartmouth.edu/~rc/help/faq/permissions.html


epicwin...@hotmail.com wrote:




Date: Mon, 2 Feb 2009 22:00:24 +0100
From: a...@ice-sa.com
To: users@tomcat.apache.org
Subject: Re: running tomcat with root user.umask in jsvc?

epicwin...@hotmail.com wrote:
That is a possible solution.  There is a fairly heavy amount of files uploaded from many different users so it would mean a lot of configuration and a lot of maintenance to that config as i add new users.  So I am trying to avoid the operating system chmod commands in my code.  
I don't really like that either, and it does break if you ever (yuk) 
would decide to run your code on some other platform.



If i add umask 002 in my ./etc/init.d/tomcat start up script it seems to fix 
the problem but i think this is setting that umask for more than just tomcat so 
i am not sure how safe that is.
As far as I can tell, it would only change the umask for the current 
process (the shell executing your startup script) and all its offsprings 
(jsvc, tomcat).  But it will do it for *everything* that these processes 
do (such as creating temporary files, logfiles, etc..).  That may indeed 
not be very secure. For instance, one thing which Tomcat to my knowledge 
does (if you have not disabled it) is to rewrite the conf/users.xml 
file each time it starts up (or stops ?).  That particular file is not 
essential, and maybe Tomcat does not do that anymore in recent versions, 
but there might be other such things lurking around unexpectedly.



That was my concern, I think it is a very mild security concern but still an 
issue nonetheless.  Since the tomcat user doesn't have shell access or root 
access I can't see it being a big issue, it would be nice if you could set the 
umask for just the class loader or running java process.

I'm still a bit curious about how you did organise the upload 
directories and their rights and groups etc.. finally, because you want 
this one Tomcat user to be able to write into upload directories owned 
originally by other users, right ? Or at least, you want these other 
users afterward to have access to these files somehow.
So you must have established some common group or groups between the 
Tomcat user, and these other users, right ?
I am just wondering if by doing this, you have not weakened the 
general protection of all that stuff.



You got it.  Here is how i have it set up  let me know what you think:
I created a shared group :
groupadd sharedgroup
Then i changed it so all my users were members of this group:
usermod -g sharedgroup tomcat
usermod -g sharedgroup jaileduser1

usermod -g sharedgroup jaileduser2 ...etc

Then I found some settings in the jailkit ( http://olivier.sessink.nl/jailkit/ 
) that allow for the jailed users to have group read/write permissions:
in /etc/jailkist/jk_chrootsh.ini
relax_home_group=1
relax_home_group_permissions=1
relax_home_other_permissions=1

Then in the jail jk_lsh.ini i set up the umask for the shared group:

[group sharedgroup]
paths= /usr/bin, /usr/lib/
executables= /usr/bin/scp, /usr/libexec/openssh/sftp-server
umask= 002

Finally I added the umask 002 line to my tomcat startup script

The external jailed users only have sftp access and aren't able to move outside 
their home directories.  Since the jailed user shares a group with tomcat they 
can all incestially read and write files to these home directories and since 
the umask is set the permissions are retained as new directories are created 
and so forth.

What do you think?
 
I had a quite similar case to resolve not so long ago (with Apache, not 
Tomcat), and only ended up with ACLs after being forced to use them, 
because no other solution would really provide the security I wanted.



Yeah the ACLs look very effective but like yourself i am trying to avoid extra 
complications


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



_
Windows Live™ Hotmail®…more than just e-mail. 
http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t2_hm_justgotbetter_howitworks_012009


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: running tomcat with root user

2009-02-01 Thread Rusty Wright

Are you sure about the group write permissions?  I glanced at the jailkit web 
page and it looks like it's sugar coating and chrome around a chroot.  So I 
would think that using unix groups would work.  And on the flip side, if unix 
groups don't work, it seems to me that ACLs wouldn't either.


epicwin...@hotmail.com wrote:

I have the latest tomcat 6 installed under centos 5.2.  The problem I am having 
is that it appears that I have to run tomcat as root user, because the spring 
app that tomcat starts needs to write files to other users' home directories.  
The tomcat user doesn't have access to these directories.

I tried making these users part of a shared group, but to complicate the 
problem the users are jailed using jailkit.  So it doesn't appear that jailkit 
lets me add group write privileges to the home directories and maintain a 
working jail.

Can anyone suggest another alternative?  I am not linux user expert so maybe 
there is an obvious solution i am missing?
thanks




_
Windows Live™ Hotmail®…more than just e-mail. 
http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t2_hm_justgotbetter_howitworks_012009


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: commons-logging problem

2009-01-30 Thread Rusty Wright

John Holman wrote:
Also is it a supported configuration to use commons-logging and log4j in 
WEB-INF/lib?


Where else would you put them?

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: commons-logging problem

2009-01-30 Thread Rusty Wright

Does that work reliably now?  I was under the impression that it caused problems, but 
that may have been with a previous version of tomcat.  That's why I asked my where 
else question; I was wondering if that's what he was thinking of.


Gregor Schneider wrote:

On Fri, Jan 30, 2009 at 7:45 PM, Rusty Wright rusty.wri...@gmail.com wrote:

John Holman wrote:

Also is it a supported configuration to use commons-logging and log4j in
WEB-INF/lib?

Where else would you put them?



i.e. ${CATALINA_HOME}/common/lib

Saves the hazzle to put them into each webapp.

Rgds

Gregor


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [OT] run tomcat as tomcat user

2009-01-25 Thread Rusty Wright

When you put a backslash in front of them they become part of the matching 
machinery's special characters, like . [ and so on.  Without the backslash 
they're normal characters and matched as-is.  So if you had the sed command 
s/(a)+/z/ and you fed it the string aaa, you would not get back z.  You'd only 
get back z if you fed it the string (a)+.  These old regexps of the ed lineage 
also didn't use the newfangled + notation; you had to list how many you wanted 
to match, or zero or more; a* would match zero or more, aa* would match one or 
more, etc.

André Warnier wrote:

Rusty Wright wrote:
[...]
The \( \) is the grouping thing where what matches in it is then 
substituted for as the \1 on the right hand side.  


Yes, but if you escape them with \ , do they still get seen as (meta) 
grouping indicators, or as plain ( and ) ?
(I don't remember what sed wants precisely, but in a perl regex, 
escaping the () would not work as you intend; it would look for real (), 
and not group.




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [OT] run tomcat as tomcat user

2009-01-24 Thread Rusty Wright

Thanks; good point about the speedup by not using .* (although since this is in 
a boot script, in this case it shouldn't really matter much).  The \( \) is the 
grouping thing where what matches in it is then substituted for as the \1 on 
the right hand side.  Cut is one of those commands I never remember to use, 
same with xargs.


André Warnier wrote:

Rusty Wright wrote:


I love shell script hacks so my /etc/init.d/tomcat script has the 
following in the upper part where it's setting variables:


TOMCAT_HOME=`grep ^tomcat /etc/passwd | sed -e 
's/.*:.*:.*:.*:.*:\(.*\):.*/\1/'`


You love shell scripts, but don't seem to love regexp's.



export CATALINA_BASE=${TOMCAT_HOME}

Perhaps instead of .* I could have used [^:]*



Yes.  That alone will probably make you regexp about 10,000 times 
faster.  As first written, the first .* will match everything to the 
end of the string, but then fail to find the next :.  So it will 
backtrack one character and try again.
When it has found the last :, it will fail to match with the next 
.*, so it will backtrack.

And so on...
I don't think 10,000 does it justice. ;-)
I also don't think you want to escape the ().

On the other hand, I think cut might be your friend here.
grep ^tomcat /etc/passwd | cut -d: -f 6


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: run tomcat as tomcat user

2009-01-23 Thread Rusty Wright

Thanks, I like that suggestion.

So, to use your method, using the su below, would I do

 export CATALINA_BASE=/home/tomcat
 su - tomcat -c /path/to/tomcat/bin/startup.sh

Do I need to copy anything from the original tomcat directory to /home/tomcat, 
or do I need to make any directories in it?  Or is it simply a replacement for 
the tomcat/webapps directory?


Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rusty,

Rusty Wright wrote:

It's set up so that tomcat runs as the user tomcat.  In order to do that
you'll need to tweak the ownership of the files in the tomcat
directory.


I would recommend that, instead of modifying the ownership of the Tomcat
installation directory, you instead use CATALINA_BASE set to somewhere
that has appropriate permissions for the user in question. Something
like /home/tomcat.

This also allows you to upgrade Tomcat much more easily just by
adjusting the path to startup.bat and bouncing Tomcat.

If the OP is using this script as part of the system startup (that is,
it is running as root), then you'll need to adjust the startup command
to be:

su - tomcat -c /path/to/tomcat/bin/startup.sh

This will switch to the tomcat user before launching Tomcat.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl6EF8ACgkQ9CaO5/Lv0PDolACgwG/Rx+cpzb8GuX4BOzjEhakU
Yq8An05jNk9mz17qCMpo44i1NfrIUDX2
=1D1X
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: run tomcat as tomcat user

2009-01-23 Thread Rusty Wright

To answer my own question; I did some google searching and figured out that you 
need to copy the tomcat conf directory to ~tomcat and also create the 
directories ~/tomcat/logs, ~/tomcat/temp, and ~/tomcat/work; all owned by 
tomcat.  Then copy over the webapps directory, or make a new one in ~tomcat and 
copy over the wars.

So my ~tomcat looks like the following:

r...@test1:/home/tomcat# ls -l
total 20
drwxr-xr-x 2 tomcat tomcat 4096 2009-01-23 11:41 conf/
drwxr-xr-x 2 tomcat tomcat 4096 2009-01-23 11:41 logs/
drwxr-xr-x 2 tomcat tomcat 4096 2009-01-23 11:42 temp/
drwxrwxr-x 8 rusty  tomcat 4096 2009-01-23 11:42 webapps/
drwxr-xr-x 3 tomcat tomcat 4096 2009-01-23 11:41 work/

r...@wss-test1:/home/tomcat# ls -l conf
total 92
-rw-r--r-- 1 tomcat tomcat  8690 2008-07-21 17:01 catalina.policy
-rw-r--r-- 1 tomcat tomcat  3665 2008-07-21 17:01 catalina.properties
-rw-r--r-- 1 tomcat tomcat  1395 2008-11-19 14:22 context.xml
-rw-r--r-- 1 tomcat tomcat  3664 2008-07-21 17:01 logging.properties
-rw-r--r-- 1 tomcat tomcat  6460 2008-07-21 17:01 server.xml
-rw-r--r-- 1 tomcat tomcat   165 2009-01-23 11:41 tomcat-users.xml
-rw-r--r-- 1 tomcat tomcat 50105 2008-11-19 14:23 web.xml

I love shell script hacks so my /etc/init.d/tomcat script has the following in 
the upper part where it's setting variables:

TOMCAT_HOME=`grep ^tomcat /etc/passwd | sed -e 's/.*:.*:.*:.*:.*:\(.*\):.*/\1/'`

export CATALINA_BASE=${TOMCAT_HOME}

Perhaps instead of .* I could have used [^:]* 



Rusty Wright wrote:

Thanks, I like that suggestion.

So, to use your method, using the su below, would I do

 export CATALINA_BASE=/home/tomcat
 su - tomcat -c /path/to/tomcat/bin/startup.sh

Do I need to copy anything from the original tomcat directory to 
/home/tomcat, or do I need to make any directories in it?  Or is it 
simply a replacement for the tomcat/webapps directory?



Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rusty,

Rusty Wright wrote:

It's set up so that tomcat runs as the user tomcat.  In order to do that
you'll need to tweak the ownership of the files in the tomcat
directory.


I would recommend that, instead of modifying the ownership of the Tomcat
installation directory, you instead use CATALINA_BASE set to somewhere
that has appropriate permissions for the user in question. Something
like /home/tomcat.

This also allows you to upgrade Tomcat much more easily just by
adjusting the path to startup.bat and bouncing Tomcat.

If the OP is using this script as part of the system startup (that is,
it is running as root), then you'll need to adjust the startup command
to be:

su - tomcat -c /path/to/tomcat/bin/startup.sh

This will switch to the tomcat user before launching Tomcat.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl6EF8ACgkQ9CaO5/Lv0PDolACgwG/Rx+cpzb8GuX4BOzjEhakU
Yq8An05jNk9mz17qCMpo44i1NfrIUDX2
=1D1X
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Regarding SVN

2009-01-23 Thread Rusty Wright

Try here:

http://subversion.tigris.org/
http://subversion.tigris.org/mailing-lists.html


Sneha Manohar wrote:

Hello ,
 
I wish to install SVN on my laptop .  Do I need to install SVN server  client both ? . I have windows vista operating system which version do I need to install ?
 
sneha



  Add more friends to your messenger and enjoy! Go to 
http://messenger.yahoo.com/invite/


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: run tomcat as tomcat user

2009-01-21 Thread Rusty Wright

(Repeating a reply I sent a week or so ago.)

I made this by modifying one for a different service.

It's set up so that tomcat runs as the user tomcat.  In order to do that you'll 
need to tweak the ownership of the files in the tomcat directory.  I just made 
everything owned by tomcat except webapps, which I own, but which is group 
owned and writable by tomcat so it can explode the wars.

I'm on ubuntu (notice the two flavors of the functions file it sources).

You may not need the HUDSON_HOME stuff and I'm sure you won't need the 
Dwaitlistd.host=${HOST} so delete stuff as necessary.

If you want it to run as root I'm guessing that you'd need to delete the 
--chuid and --user lines.


#!/bin/sh

PATH=/bin:/usr/bin:/sbin:/usr/sbin
export PATH

export JAVA_OPTS=-server
export JAVA_HOME=/usr/java
export TOMCAT_DIR=/usr/local/tomcat

export HUDSON_HOME=/usr/local/hudson

TOMCAT_START=${TOMCAT_DIR}/bin/startup.sh
TOMCAT_STOP=${TOMCAT_DIR}/bin/shutdown.sh
TOMCAT_USER=tomcat

HOST=`/bin/hostname | sed -e 's/\..*//'`

export JAVA_OPTS=-server -Dwaitlistd.host=${HOST}

test -f ${TOMCAT_START} || exit 0

# redhat
# . /etc/init.d/functions

# debian
. /lib/lsb/init-functions

case $1 in
  'start')
  log_daemon_msg Starting tomcat tomcat

  cd /var/log

  # ${TOMCAT_START}
  eval /sbin/start-stop-daemon \
  --start \
  --quiet \
  --chuid ${TOMCAT_USER} \
  --user ${TOMCAT_USER} \
  --startas ${TOMCAT_START}


  log_end_msg $?
  ;;

  'stop')
  log_daemon_msg Stopping tomcat tomcat

  # ${TOMCAT_STOP}
  eval /sbin/start-stop-daemon \
  --stop \
  --quiet \
  --user ${TOMCAT_USER} \
  --startas ${TOMCAT_STOP}

  log_end_msg $?
  ;;

  'restart')
  ${0} stop

  log_action_msg sleeping for several seconds ...
  sleep 13

  ${0} start
  ;;

  *)
  log_action_msg Usage: ${0} {start|stop|restart}
  ;;
esac


Kaushal Shriyan wrote:

Hi

I am not able to start tomcat as tomcat user on ubutu 8.04 Linux,
Below is my start/stop script
Any ideas as what is going wrong ?


Thanks and Regards

Kaushal

###
#!/bin/sh
#
# Startup script for Tomcat

JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
export JAVA_HOME
CATALINA_OPTS=-Xms512m -Xmx1m
export CATALINA_OPTS
start_tomcat=/usr/local/apache-tomcat-5.5.27/bin/startup.sh
stop_tomcat=/usr/local/apache-tomcat-5.5.27/bin/shutdown.sh

start() {
echo -n Starting tomcat: 
su -c ${start_tomcat} tomcat
echo done.
}
stop() {
echo -n Shutting down tomcat: 
${stop_tomcat}
echo done.
}

# See how we were called
case $1 in
  start)
start
;;
  stop)
stop
;;
  restart)
stop
sleep 10
start
;;
  *)
echo Usage: $0 {start|stop|restart}
esac

###



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: GWT Sessions with Tomcat Session Replication?

2009-01-19 Thread Rusty Wright

Since this is com.google.gwt.user.server.rpc.RemoteServiceServlet, my first 
guess would be that that's where the problem is.  Have you tried the gwt mailing 
list/forum?


bikkel bikkel wrote:

Good morning,

I'm using GWT in a web application running on Tomcat 6. This is running fine
for months.

Today i was told to get the GWT application running in a Tomcat Cluster.
Configuring Tomcat wasn't a problem, normal HttpSession are replicated
between servers without problems when using normal HttpSessions in
jsp/servlet pages.

But Tomcat doesn't seem to duplicate GWT Sessions. My server code uses the
following method for GWT Sessions:
===
HttpSession session=this.getThreadLocalRequest().getSession();
session.setAttribute(loggedin, true);
===
And to check if someone is logged in:
===
HttpSession ses=this.getThreadLocalRequest().getSession(false);
if(ses.getAttribute(monitor_loggedin)!=null){
//loggedin
}
===

I suspect that getThreadLocalRequest().getSession() is not compatible with
the Tomcat Session Replication.

Is there a way to get this working or is there another way to around this
problem?

Thanks!



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: which JSP web hosting

2009-01-17 Thread Rusty Wright

I haven't tried any of these but they're in my bookmarks:

http://www.godaddy.com/
http://www.dailyrazor.com/java/private_tomcat.php
http://www.javaservlethosting.com/index.jsh
http://rimuhosting.com/
http://www.slicehost.com/


Sneha Manohar wrote:

Hello,
 
I am developing web application using JSP,HTML,Java script with MS SQL as back end (using JDBC mechanism for connecing to data base)

Can you please suggest me some web hosting ?
 
Regards

Sneha Manohar
Anoigma software services
London


  Add more friends to your messenger and enjoy! Go to 
http://messenger.yahoo.com/invite/


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: PostgreSQL vs MySQL with Tomcat

2009-01-17 Thread Rusty Wright

It's a rewrite of an app I did awhile ago in php.

I think the biggest gripe I've had with mysql is the problem where I was 
violating a unique constraint and it was giving me some generic (completely 
useless) error; HY001 I think.

In various ways, which I can't articulate, MySQL just feels to me more 
amateurish compared to PostgreSQL.  With MySQL things are changed on an 
apparently ad-hoc basis and I've heard that they've broken backwards 
compatibility more than once.

I realize that SQL isn't exactly the most widely adhered to standard, but MySQL 
seems to be more divergent than [most of] the others.  When I had that 
HYwhatever error, I was completely stumped, so in order to troubleshoot it I 
copied the database to an MS SQL Server that I'd been using for something else. 
I remember having read somewhere that SQL Server is reasonably close to the SQL 
standard and I was amazed at how much work it took to translate my ddl and sql 
from MySQL to SQL Server.  (Apache DdlUtils and Hibernate could have helped 
with the ddl.)

I can't remember all of the various problems I've had with MySQL but here's one 
that seems typical; I started using it back when it was (or at least it seemed 
to me) more typical to edit user permissions by updating the mysql.users table, 
rather than using the GRANT command.  So I have these various sql files that 
insert stuff in the  mysql.users, mysql.db, and mysql.hosts tables and they 
have lots of 'y' and 'n' entries.  At some point they changed things and they 
had to be uppercase.  Previously I think they converted them to Y and N, but 
suddenly a newer version  accepted the lower case with no complaints but didn't 
convert them, and they didn't work (it was as if the ys were Ns); I could have 
been inserting any random letter or digit apparently.  That took some head 
scratching to figure out.

I had forgotten that Sun bought MySQL so it should be interesting to see how 
that plays out.  I heard that they're doing a major rewrite, starting from 
scratch, but going to keep it backwards compatible.


Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rusty,

Rusty Wright wrote:

I'm in the process of migrating a MySQL database to PostgrSQL.


Is this to cool-off your DBA's ears? ;)

Seriously, if you could explain why you've decided to switch, I think it
would help a lot of readers understand some of the differences between
these two RDBMSs.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAklyBnIACgkQ9CaO5/Lv0PCuvgCfdZ9j+2Z5cGuk3aQsYFg7VaAO
msIAnR8r+ZmyYeJz2T3Sbzbk9hCEDGlU
=26DN
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: PostgreSQL vs MySQL with Tomcat

2009-01-16 Thread Rusty Wright

That may be true about the public schema being used when one isn't specified.  
But when I use their pgAdmin gui tool and open the query window and try to run 
the tiger sample from the Jailer tutorial it blows up on the table creates, 
saying:

 ERROR:  no schema has been selected to create in

 ** Error **

 ERROR: no schema has been selected to create in
 SQL state: 3F000

I wonder if iBatis is adding the public schema automatically for you?  Or maybe 
when I set up my db account I didn't do something I should have?  Or I changed 
something and don't remember.

And you've prompted me to remember another reason why I thought schemas are 
required.

When our DBA set up PostgreSQL he didn't do much tweaking and the public schema 
had odd permissions; if I remember correctly it allowed me to create tables in 
the databases of other users in their public schema.  I didn't try dropping 
their tables in their public schema but it may have allowed that as well.

On my test db the sql for the public schema is

CREATE SCHEMA public
 AUTHORIZATION postgres;
GRANT ALL ON SCHEMA public TO postgres;
COMMENT ON SCHEMA public IS 'Standard public schema';

Just after I installed postgres it had another grant line which I think was (or similar 
to) GRANT ALL ON SCHEMA public TO public; which I deleted (and in my usual 
boneheaded fashion, forgot to document my change, but it's my personal test database).



Ingmar Lötzsch wrote:

Some comments (and answers to Christopher and Rusty) on PostgreSQL:

...

This isn't true. You can (and perhaps should) always omit the schema.
The default schema public is used in this case. You can execute


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: PostgreSQL vs MySQL with Tomcat

2009-01-16 Thread Rusty Wright

Regarding MySQL's autoincrement type, it looks like PostgreSQL has something 
similar:

http://www.postgresql.org/docs/8.3/interactive/datatype-numeric.html#DATATYPE-SERIAL

I'm in the process of migrating a MySQL database to PostgrSQL.


Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ken,

Ken Bowen wrote:

Unfortunately, MySQL isn't really that tunable. On the other hand, MySQL
requires very little in the way of tuning!


This was my comment, and that's the gist I got from reading Zawodny's
and Balling's High Performance MySQL from O'Reilly. There are /some/
things you can tune, but not much. It's like an auto-adjusting clutch.
Sure, you can adjust it, but it's going to do a pretty good job on its own.


I created a couple of proof-of-concept projects with PostgreSQL for
someone about six months ago, and the only really puzzling thing what
how to set up sequences corresponding to MySQL's AUTOINCREMENT (I'm
not sure I've really wrapped head around it completely anyway).  For
those small projects, it worked well, but there was no stress involved.


I have no experience with PostgreSQL, but I was always irritated by lack
of support (in previous JDBC specifications) for the AUTOINCREMENT
fields (fixed, of course, in JDBC 1.4 when Statement.getGeneratedKeys
was added). Oracle-style SEQUENCES always made more sense to me --
although they require an additional query to be issued every time you
want a new id, you can use them for anything; not just record PKs.

I think PostgreSQL has Oracle-style sequences. There are no
auto-incrementing PKs or anything like that: you first SELECT the next
value from the sequence, then use that as the PK for your INSERT that
you issue immediately afterward. If you don't need to capture the new id
from the code, you could probably even do this:

INSERT INTO my_table (id, ...)
VALUES ((SELECT next FROM my_sequence), ...)

I have no idea if that would even work. Give it a try!


I'd like to hear about people's experiences and what they think are the
strengths and weaknesses of each DBMS for use behind Tomcat.


MySQL has always had super good performance for me, especially using
MyISAM tables. The addition of InnoDB tables was great because you got
the relatively fast speed of MySQL (compared to, say, Oracle) with the
integrity you really expect from a production-quality RDBMS.

Since I'm not a DBA, I'm appreciated the fact that MySQL can often be a
fire-and-forget kind of service. It just doesn't need much care and
feeding. I remember my first job out of college required new engineering
hires to go through their one-box-wonder runbooks to make sure we
understood how installs went and how the pieces fit together.
Installing Apache Jserv (yeah!), httpd, and most everything else took
about one or two printed pages of documentation. The rest of the runbook
was Oracle install and configuration. Install. Run the command-line
tool. Quit the command-line tool. Edit a config file. Re-run the
command-line tool. Create the database. Quit the command-line tool.
Change the rollback segment size. Etc. etc. etc. I never even understood
anything I was doing, and neither did the folks that were supervising
our execution of these tasks. These were just instructions that probably
worked for someone in the past, so they wrote them down and nobody ever
bothered to figure out if there were any better options. I was one of
the first engineers who used MySQL in a project that went to production
(and I had to implement my own pre-innodb manual rollback logic -- yikes!).

MySQL supports a lot of functions that are, of course, outside the SQL
standard, but are nonetheless useful. Here is what my MySQL driver
(Connector/J 5.0.8) reports for the functions available to the client
(server version is 5.0.70):

Supported functions:
Numeric:
ABS,ACOS,ASIN,ATAN,ATAN2,BIT_COUNT,CEILING,COS,COT,DEGREES,EXP,FLOOR,LOG,LOG10,MAX,MIN,MOD,PI,POW,POWER,RADIANS,RAND,ROUND,SIN,SQRT,TAN,TRUNCATE
String:
ASCII,BIN,BIT_LENGTH,CHAR,CHARACTER_LENGTH,CHAR_LENGTH,CONCAT,CONCAT_WS,CONV,ELT,EXPORT_SET,FIELD,FIND_IN_SET,HEX,INSERT,INSTR,LCASE,LEFT,LENGTH,LOAD_FILE,LOCATE,LOCATE,LOWER,LPAD,LTRIM,MAKE_SET,MATCH,MID,OCT,OCTET_LENGTH,ORD,POSITION,QUOTE,REPEAT,REPLACE,REVERSE,RIGHT,RPAD,RTRIM,SOUNDEX,SPACE,STRCMP,SUBSTRING,SUBSTRING,SUBSTRING,SUBSTRING,SUBSTRING_INDEX,TRIM,UCASE,UPPER
System:
DATABASE,USER,SYSTEM_USER,SESSION_USER,PASSWORD,ENCRYPT,LAST_INSERT_ID,VERSION
Time/Date:
DAYOFWEEK,WEEKDAY,DAYOFMONTH,DAYOFYEAR,MONTH,DAYNAME,MONTHNAME,QUARTER,WEEK,YEAR,HOUR,MINUTE,SECOND,PERIOD_ADD,PERIOD_DIFF,TO_DAYS,FROM_DAYS,DATE_FORMAT,TIME_FORMAT,CURDATE,CURRENT_DATE,CURTIME,CURRENT_TIME,NOW,SYSDATE,CURRENT_TIMESTAMP,UNIX_TIMESTAMP,FROM_UNIXTIME,SEC_TO_TIME,TIME_TO_SEC

Some stuff is a bit far-fetched (SOUNDEX? come on...) but others are
very useful (like the statistical functions, regular expressions, etc.).

I definitely make use of these functions in my apps, even though they
are MySQL-specific (I just make 

Re: Linux Runtime Script

2009-01-15 Thread Rusty Wright

I never did that.  What scripts?


Mark Thomas wrote:

-Original Message-
From: Martin Gainty [mailto:mgai...@hotmail.com]
Sent: 13 January 2009 14:18
To: Tomcat Users List
Subject: RE: Linux Runtime Script


Feris-

remember to edit $CATALINA_HOME/conf/catalina.policy and specify at
minimum 'execute' permissions for the folder containing the scripts

Martin


Feris,

Ignore this. The change Martin is suggesting is completely unnecessary.

Mark



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: PostgreSQL vs MySQL with Tomcat

2009-01-15 Thread Rusty Wright

I've found MySQL's error messages particularly worthless in some situations; I 
had a foreign constraint and it was giving me some generic error when I was 
violating that foreign constraint.  Say MySQL around our DBA and steam starts 
coming out of his ears.

The one warning I can think of with PostgreSQL is that you have to use schemas; you 
either have to set the schema after you connect, and I think I couldn't figure out how to 
do that with jdbc, or you specify it as part of every table name; create table 
schema_name.table_name ...; select whatever from schema_name.table_name;.  Schemas 
are quite cool, so don't take this as a criticism.


Ken Bowen wrote:
Hi all (especially Chris -- very informative long post today on 
Tomcat/MySQL):


For a several reasons (including the apparent infinite default for 
connection timeout), I'm contemplating switching one or two projects 
from MySQL to PostgreSQL.  I'd like to gather opinions on the tradeoffs, 
including:


Unfortunately, MySQL isn't really that tunable. On the other hand, MySQL
requires very little in the way of tuning!

I created a couple of proof-of-concept projects with PostgreSQL for 
someone about six months ago, and the only really puzzling thing what 
how to set up sequences corresponding to MySQL's AUTOINCREMENT (I'm 
not sure I've really wrapped head around it completely anyway).  For 
those small projects, it worked well, but there was no stress involved.


I'd like to hear about people's experiences and what they think are the 
strengths and weaknesses of each DBMS for use behind Tomcat.


Thanks much in advance,
Ken Bowen

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: single instance of background job?

2009-01-11 Thread Rusty Wright

Ok, thanks; I'll look into terracotta.

Lucas Galfaso wrote:

Hi,
  This should be strait forward if you use terracotta. If you have a
NFS that all Tomcat instances share, using FileChannel::lock is way
cheaper than any other solution.

-lg

On Sun, Jan 11, 2009 at 2:30 AM, Rusty Wright rusty.wri...@gmail.com wrote:
  

This isn't really a Tomcat question I'm guessing but I don't know where else
to ask.

In our setup we have multiple Tomcats behind a load balancer.  I have a
background task that will run once a day, via Quartz.  All Tomcats will be
using the same war so they will all run the job, but I need it so only one
of them runs the job.

I'm looking for ideas for how to implement this.  At the moment all I can
think of is to use a table in a database with a unique constraint on a
column, and each background process tries to insert today's date
(-mm-dd) and the one that succeeds runs the job, and the ones that
don't, do nothing.

Thanks


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org






-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: single instance of background job?

2009-01-11 Thread Rusty Wright
That's exactly how it is now; it's on what's called our app server which 
is a single machine.


The problem with our app server is that the developers aren't allowed 
access to it; the software is updated and installed by our production 
control/release management team.


So, for example, if I need to look at the log files, I have to ask them 
to send me a zip file of the logs directory.  If I need to tweak its 
configuration then I make a new release and schedule a deployment with 
them; so something as trivial as changing its crontab requires a new 
deployment.


And the app server is forbidden to run tomcat or a web server.

The reason making it a web app appeals to me is that then I can have it 
log to a database, and I can tweak its configuration via a web page.  
And I can have a checkbox, disable/enable so I can turn it off if needed.


What adds to the difficulty of it is that the cron job is interacting 
with an IBM mainframe, uploading file with ftp and there's no real test 
instance of the mainframe side so testing is really scary (it's a legacy 
billing system so money is involved).


And we have three layers; dev, qa, and prod.  I can deploy to dev, but I 
need to go through our release management to deploy to qa, and then to prod.


So I'm trying make something that gives me (and the end user) more 
direct and timely access to it.



Leon Rosenberg wrote:

it would probably be much easier to make this job a separate cron
process on one machine, or if it _must_ be in tomcat (why?) tie it to
an ip adress or server name, so the task just checks that it can only
run on tomcat1 or tomcat 10, or whatever...
Otherwise you'll need to check logs on all machines to find out which
run the task today.

Leon

On Sun, Jan 11, 2009 at 5:30 AM, Rusty Wright rusty.wri...@gmail.com wrote:
  

This isn't really a Tomcat question I'm guessing but I don't know where else
to ask.

In our setup we have multiple Tomcats behind a load balancer.  I have a
background task that will run once a day, via Quartz.  All Tomcats will be
using the same war so they will all run the job, but I need it so only one
of them runs the job.

I'm looking for ideas for how to implement this.  At the moment all I can
think of is to use a table in a database with a unique constraint on a
column, and each background process tries to insert today's date
(-mm-dd) and the one that succeeds runs the job, and the ones that
don't, do nothing.

Thanks


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org






-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Linux Runtime Script

2009-01-11 Thread Rusty Wright

I made this by modifying one for a different service.

It's set up so that tomcat runs as the user tomcat.  In order to do that you'll 
need to tweak the ownership of the files in the tomcat directory.  I just made 
everything owned by tomcat except webapps, which I own, but which is group 
owned and writable by tomcat so it can explode the wars.

I'm on ubuntu (notice the two flavors of the functions file it sources).

You may not need the HUDSON_HOME stuff and I'm sure you won't need the 
Dwaitlistd.host=${HOST} so delete stuff as necessary.

If you want it to run as root I'm guessing that you'd need to delete the 
--chuid and --user lines.


#!/bin/sh

PATH=/bin:/usr/bin:/sbin:/usr/sbin
export PATH

export JAVA_OPTS=-server
export JAVA_HOME=/usr/java
export TOMCAT_DIR=/usr/local/tomcat

export HUDSON_HOME=/usr/local/hudson

TOMCAT_START=${TOMCAT_DIR}/bin/startup.sh
TOMCAT_STOP=${TOMCAT_DIR}/bin/shutdown.sh
TOMCAT_USER=tomcat

HOST=`/bin/hostname | sed -e 's/\..*//'`

export JAVA_OPTS=-server -Dwaitlistd.host=${HOST}

test -f ${TOMCAT_START} || exit 0

# redhat
# . /etc/init.d/functions

# debian
. /lib/lsb/init-functions

case $1 in
   'start')
   log_daemon_msg Starting tomcat tomcat

   cd /var/log

   # ${TOMCAT_START}
   eval /sbin/start-stop-daemon \
   --start \
   --quiet \
   --chuid ${TOMCAT_USER} \
   --user ${TOMCAT_USER} \
   --startas ${TOMCAT_START}


   log_end_msg $?
   ;;

   'stop')
   log_daemon_msg Stopping tomcat tomcat

   # ${TOMCAT_STOP}
   eval /sbin/start-stop-daemon \
   --stop \
   --quiet \
   --user ${TOMCAT_USER} \
   --startas ${TOMCAT_STOP}

   log_end_msg $?
   ;;

   'restart')
   ${0} stop

   log_action_msg sleeping for several seconds ...
   sleep 13

   ${0} start
   ;;

   *)
   log_action_msg Usage: ${0} {start|stop|restart}
   ;;
esac



Java PHI wrote:

Hi,

Does anyone has a Linux script to run Tomcat as Linux services, i.e. the
runlevel scripts ? I have tried to make one, but in case there is a proven
script that has been deployed somewhere... can someone please share ?

Thanks,

Feris



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Logging configuration in Tomcat

2009-01-11 Thread Rusty Wright

If you're looking for a way to have a central log4j file for all apps, that may 
not be easily done.  I don't know how it is now, but I remember that in 
previous versions of tomcat sharing tomcat's logging was problematic, which I 
think may have been due to Commons Logging.

But that's just my hot air; I'm no tomcat expert like the others here.

No matter how much you may think it's a good idea now, I'll bet you that in the 
future you'll regret it when you're problem solving and need to tweak one app's 
logging.  Having all of your apps joined at the hips with respect to logging 
just sounds like something that will cause unforseen problems later on.


Jay wrote:
OS : RedHat Linux 
 
Tomcat version : 5.5.20
 
Am able to configure the logging level at individual war files, by referring to log4j.properties in web.xml.
 
Could someone let me know, how to configure the logging level  also the file appender type at global level, please ?
 
Thanks
 
 



  


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Implementing service chaining with Tomcat6

2009-01-11 Thread Rusty Wright

Too many bins; I meant /tmp/zzz (as it is in the script).

Rusty Wright wrote:
What options are available to you to determine if the daemon is ready?  
For example, does it create a lock file?  If so, you could modify your 
tomcat startup script in /etc/init.d, the one that calls 
/usr/local/tomcat/bin/startup.sh, and have it check if the daemon is 
ready and wait until it is, then when it is proceed and start tomcat.


For example, here's a little /bin/sh script that waits for the file 
/bin/zzz to be created and sleeps 5 seconds and keeps checking:


while test ! -f /tmp/zzz
do
   echo sleeping for 5 seconds
   /bin/sleep 5
done

echo here we go


uma...@comcast.net wrote:

I am using Tomcat6.0.14 with Jdk1.6 on Linux RH4.

My application comprises a daemon and Tomcat6. The daemon is slow in 
starting up. I need Tomcat6 to be started after the daemon is 
operational. While the daemon is a Java application, its a third-party 
tool whose src I do not control.

Is there any mechanism within Tomcat configuration by which I could
implement this chaining or synchronization such that catalina.sh starts
Tomcat VM after the daemon is somehow determined to be active?

Tx, - U

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

From - Sat
  




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: single instance of background job?

2009-01-11 Thread Rusty Wright

Hmm, I see your point.  I'll discuss it with others here and see what they 
think.

Leon Rosenberg wrote:

Hello Rusty,

On Sun, Jan 11, 2009 at 6:10 PM, Rusty Wright rusty.wri...@gmail.com wrote:

The reason making it a web app appeals to me is that then I can have it log
to a database, and I can tweak its configuration via a web page.  And I can
have a checkbox, disable/enable so I can turn it off if needed.


Well it seems like you are trying to bypass your companies security
guidelines. Which means, either you are doing the wrong thing, or the
guidelines are wrong. However, if you would follow the guidelines you
will have to protect your configuration page from the outworld, and
also from the developers, allowing only admins to change it (otherwise
you are creating a backdoor into your own application) and you win
nothing.


So I'm trying make something that gives me (and the end user) more direct
and timely access to it.



I understand that there are companies, where you have to actually act
against the policies to achieve a positive result (for the company),
but maybe you should try to talk people first and try to change things
a bit. If you use the word agile often, your chances to actually get
limited access to the production system will increase dramatically :-)

regards
Leon

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



single instance of background job?

2009-01-10 Thread Rusty Wright
This isn't really a Tomcat question I'm guessing but I don't know where 
else to ask.


In our setup we have multiple Tomcats behind a load balancer.  I have a 
background task that will run once a day, via Quartz.  All Tomcats will 
be using the same war so they will all run the job, but I need it so 
only one of them runs the job.


I'm looking for ideas for how to implement this.  At the moment all I 
can think of is to use a table in a database with a unique constraint on 
a column, and each background process tries to insert today's date 
(-mm-dd) and the one that succeeds runs the job, and the ones that 
don't, do nothing.


Thanks


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Implementing service chaining with Tomcat6

2009-01-10 Thread Rusty Wright
What options are available to you to determine if the daemon is ready?  
For example, does it create a lock file?  If so, you could modify your 
tomcat startup script in /etc/init.d, the one that calls 
/usr/local/tomcat/bin/startup.sh, and have it check if the daemon is 
ready and wait until it is, then when it is proceed and start tomcat.


For example, here's a little /bin/sh script that waits for the file 
/bin/zzz to be created and sleeps 5 seconds and keeps checking:


while test ! -f /tmp/zzz
do
   echo sleeping for 5 seconds
   /bin/sleep 5
done

echo here we go


uma...@comcast.net wrote:

I am using Tomcat6.0.14 with Jdk1.6 on Linux RH4.

My application comprises a daemon and Tomcat6. The daemon is slow in 
starting up. I need Tomcat6 to be started after the daemon is operational. 
While the daemon is a Java application, its a third-party tool whose src I 
do not control. 


Is there any mechanism within Tomcat configuration by which I could
implement this chaining or synchronization such that catalina.sh starts
Tomcat VM after the daemon is somehow determined to be active?

Tx, - U

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

From - Sat
  



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Setting /WebContent as ROOT for an application

2008-12-14 Thread Rusty Wright

To add to what Alan said:

If I create a new Eclipse Dynamic Web Project, and name it MyWebApp during the 
project setup, in the first window it has a drop down for Target Runtime.  That 
should be your installed Tomcat on your desktop development machine; Windows in my 
case.  It starts out with None so click the New button next to it and select, 
for example, Apache Tomcat v6.0, and then in the next window use the Browse button to 
navigate to where Tomcat is installed (C:\Program Files\Apache Software 
Foundation\apache-tomcat-v.0.18 for me).  You can leave the rest alone and click 
Finish.

Next in Eclipse, do Window - Show View - Servers.  That creates a Servers view 
window (tab) somewhere.  Click on its tab to bring it forward, then right click in the 
Servers window and select New - Server (strange that we have to do this again, but 
at least it's abbreviated this time), and select Tomcat v6.0 Server (or whatever you 
selected when you created the project).  Then you get the Add and Remove Projects 
window; double click on MyWebApp to move it to the right into Configured projects, and 
click Finish.

As per the DOS tree command my Eclipse project folder/file structure is then

   |   .classpath
   |   .project
   |
   +---.settings
   |   .jsdtscope
   |   org.eclipse.jdt.core.prefs
   |   org.eclipse.jst.common.project.facet.core.prefs
   |   org.eclipse.wst.common.component
   |   org.eclipse.wst.common.project.facet.core.xml
   |   org.eclipse.wst.jsdt.ui.superType.container
   |   org.eclipse.wst.jsdt.ui.superType.name
   |
   +---build
   |   \---classes
   +---src
   \---WebContent
   +---META-INF
   |   MANIFEST.MF
   |
   \---WEB-INF
   |   web.xml
   |
   \---lib

You can ignore .classpath, .project, and .settings.  If you check your project 
into Subversion, I recommend telling it to ignore those files; some people 
prefer checking them in.

I completely ignore the contents of the build folder; whenever you do a clean 
in Eclipse it wipes and removes that folder.  The folder of interest for me is 
the WebContent folder; its layout and contents is what will ultimately be in 
Tomcat as /usr/local/tomcat/webapps/MyWebApp (sorry, switching to Unix parlance 
there).

This means that any jar files your project needs go in WebContent/WEB-INF/lib.

Also, you should create the folder WebContent/WEB-INF/classes and put in it those things 
that need to be on the classpath, for example, your logging config file 
(e.g., logback.xml or log4j.xml, or log4j.properties if you prefer that confusing 
format), and any other properties files and whatnot.

It's instructive to do as Alan says and do the Eclipse export to war and then 
list the war file with a zip program to see what it's going to look like when 
Tomcat explodes it.

Static jsp files will go directly in the WebContent folder (e.g., index.jsp).  Dynamic 
jsp files will probably go in some subdirectory of WEB-INF; for example, I use Spring and 
I've configured it to look for the views in WEB-INF/views/jsp, with even more 
folders in that if I'm using something like Tiles.

Back in Eclipse, in the Servers tab/window, is an entry for Tomcat, and the 
controls for that are at the top of the tab; the green circle arrow starts 
Tomcat and when it's started the red square stops it.  In theory, and perhaps 
in practice, you can edit your .java files and do a compile/build in Eclipse 
and Tomcat will automatically reload them.  I'm superstitious from back in the 
day when that didn't always work and try to remember to stop Tomcat before I do 
a build.  This implies that I have Eclipse configured to not automatically 
build when I do a Save on a file.  If Tomcat does get wedged in Eclipse; for 
example, changes stop showing, you can simply delete the Tomcat instance from 
Eclipse by right clicking on it in the Servers window/tab and selecting Delete, 
then re-add it and add your project to it.

Note that when you start and run Tomcat from within Eclipse it's not deploying 
your project to your installed Tomcat; it's using the installed Tomcat's jar 
files and copying/creating its own Tomcat configuration files into your project 
space and running it all in there.  It's all rather magical and, surprisingly, 
given all the apparent black magic, works quite nicely.

It gets even more black magical if you use Maven and use the m2eclipse Maven 
plugin for Eclipse, but I think it's really worth it to climb that mountain 
because it gives you a great base for a consistent and maintainable project 
structure.


Alan Chaney wrote:
In Eclipse, assuming you have the WTP tools installed, you create a 
'Dynamic Web Project.'

This has a folder structure of which the essence is:

MyApp
   src
  com
   mypackage
   Abc.java
   build
  com
 mypackage
Abc.class
WebContent
  index.html (or jsp or whatever)
  WEB-INF
 web.xml
  

Re: File system resource for static content

2008-12-14 Thread Rusty Wright

That seems like the usual race condition problem to me.  Hopefully one of them 
will get an error, at worst, and it won't silently overwrite the file with the 
one from whoever won the race.


André Warnier wrote:

André Warnier wrote:

Hi.
What if user-a uploads a file called abc.jpg and then user-b uploads 
a file called abc.jpeg ? Who wins ?

Worse, they do it at the same time..
;-)


Ooops, I meant abc.jpg both times of course.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat ROOT

2008-10-08 Thread Rusty Wright

Excellent; thanks!


Johnny Kewl wrote:


- Original Message - From: Rusty Wright 
[EMAIL PROTECTED]
To: Markus Lord [EMAIL PROTECTED]; Tomcat Users List 
users@tomcat.apache.org

Sent: Tuesday, October 07, 2008 11:31 PM
Subject: Re: tomcat ROOT


Hi Markus, did you ever figure this out?  I was looking in the 
archives of the tomcat mailing list and saw your query but it didn't 
seem to me that anyone answered it fully, at least not for me.


I figured out that I could remove/rename the webapps/ROOT directory 
and deploy my war file as ROOT.war and then it would replace tomcat's 
web page at http://www.myhost.edu/ but I also have apache in front of 
tomcat and I don't understand how to set up the jkmount in my 
httpd.conf file to map apache's root to tomcat's root.


Yes renaming a webapp to ROOT with a empty context path, makes it run 
as the root...


Then...

JkMount /  worker1

Should make apache send it to your tomcat root

--- 


HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
--- 



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat ROOT

2008-10-08 Thread Rusty Wright

Not naive at all; I think it's an entirely relevant and obvious question.

In my situation we have a system that's administered by a different 
group than mine (we're merely application programmers) and the system 
administrators have settled on doing things this way.  They're 
understaffed and overworked so having a common setup for everyone on 
this shared system seems reasonable to me.



André Warnier wrote:

Johnny Kewl wrote:


- Original Message - From: Rusty Wright 
[EMAIL PROTECTED]
To: Markus Lord [EMAIL PROTECTED]; Tomcat Users List 
users@tomcat.apache.org

Sent: Tuesday, October 07, 2008 11:31 PM
Subject: Re: tomcat ROOT


Hi Markus, did you ever figure this out?  I was looking in the 
archives of the tomcat mailing list and saw your query but it didn't 
seem to me that anyone answered it fully, at least not for me.


I figured out that I could remove/rename the webapps/ROOT directory 
and deploy my war file as ROOT.war and then it would replace 
tomcat's web page at http://www.myhost.edu/ but I also have apache 
in front of tomcat and I don't understand how to set up the jkmount 
in my httpd.conf file to map apache's root to tomcat's root.


Yes renaming a webapp to ROOT with a empty context path, makes it run 
as the root...


Then...

JkMount /  worker1

Should make apache send it to your tomcat root


My naive question then would be : why keep Apache in front of Tomcat, 
if you are redirecting/proxying everything anyway ?


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat ROOT

2008-10-07 Thread Rusty Wright

Hi Markus, did you ever figure this out?  I was looking in the archives of the 
tomcat mailing list and saw your query but it didn't seem to me that anyone 
answered it fully, at least not for me.

I figured out that I could remove/rename the webapps/ROOT directory and deploy 
my war file as ROOT.war and then it would replace tomcat's web page at 
http://www.myhost.edu/ but I also have apache in front of tomcat and I don't 
understand how to set up the jkmount in my httpd.conf file to map apache's root 
to tomcat's root.


Markus Lord wrote:

I have apache acting as a proxy for my tomcat and I'm wondering how I can get 
this one application 'myapp' to show up without having the directory name in 
the url.
So what I'm looking to do is have it as www.mysite.com instead of 
www.mysite.com/myapp.
 
Thanks in advance.
 
 
 
Markus




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using tabbed browsers causes session sharing

2008-08-15 Thread Rusty Wright
Sessions are tied to the whole browser, not tabs within the browser. In 
other words, it's a browser issue, not a tomcat issue.


murthy gandikota wrote:

Hello All
While using tabbed browsers (e.g. IE 7) I am facing a login problem. Say on 
Tab#1 I login with a username A, on Tab#2 I login with username B, I still see 
A's session. Apparently the browser/Tomcat doesn't create a new session. Has 
anyone faced this problem? Are there any fixes?
Thanks
Murthy


  
  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using tabbed browsers causes session sharing

2008-08-15 Thread Rusty Wright
Sorry, I thought I did.  It has nothing to do with tomcat; it's up to 
the browser whether or not it assigns different sessions to the tabs or 
not.  Apparently IE, or some versions of IE, do.  In my experience 
Firefox doesn't.  I think if you have multiple Firefoxes opened, i.e., 
separate windows, not just separate tabs, they still share the session.



André Warnier wrote:

Hi guys,
shouldn't someone *explain* to the OP why this is happening ?
I mean, the different bits and pieces are there in different answers, 
but maybe the big picture is missing to understand what and why it 
is happening ?
Not knowing myself the hows and whys of Tomcat's session management, I 
don't feel confident enough to attempt such an explanation on my own.

Or is it mentioned clearly somewhere in a doc that I missed ?
I just went through items 1 to 26 of the list in
http://tomcat.apache.org/tomcat-6.0-doc/index.html
and, at first sight, I don't see anything that obviously points to 
session management.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cant Find servlets-cgi.jar

2008-04-09 Thread Rusty Wright

Try doing a google search with

servlets-cgi jar site:apache.org

I don't see anything for Tomcat 6 in the results, only previous versions.


Troy Bull wrote:

Greetings

I am trying to enable cgi on my tomcat 6 installation.  I followed the
instructions but it says to find and rename a jar called
servlets-cgi.jar.

  !-- IMPORTANT: To use the CGI servlet, you also need to rename the   --
  !--$CATALINA_HOME/server/lib/servlets-cgi.renametojar file   --
  !--to $CATALINA_HOME/server/lib/servlets-cgi.jar --


I cant find this jar anywhere, can someone give me a hint??

Thanks
troy

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Securing Tomcat

2008-03-25 Thread Rusty Wright

I have no personal experience with this but it might be a useful resource:

 http://www.owasp.org/index.php/Securing_tomcat


abhay srivastava wrote:

Hello Folks,
   How do I secure Tomcat version 6 ? Can anyone point me to right documentation ?  


I am in a process of hosting a website on Tomcat 6. it will be very helpful fi 
people can give advice on securing my server from their past experiences.

Thanks in advance


---
Winners don't Quit,Quitters don't Win
   
-

Looking for last minute shopping deals?  Find them fast with Yahoo! Search.
  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



using deferredValue in a simple tag file

2007-12-31 Thread Rusty Wright
Tomcat is version 6.0.14, java is jdk1.6.0_03, eclipse is 3.3.1.1.  
Tomcat is running under/in eclipse.


In a nutshell, I'm trying to use deferredValue with an attribute in a 
simple jsp tag file, the kind of tag file that contains jsp, no java 
code.  When I added deferred value to my attribute tag I get the an 
error from tomcat, JasperException: Invalid JSP version defined for tag 
file.  I can't figure out how to specify a jsp version for my tag file.


I tried adding and using a tld instead of a tag dir but I can't get that 
to work.  Here are the relevant files.


I either need to know how to specify the jsp version, or how to 
construct and set up the tld file.


Thanks for your help.



Top of web.xml file:


?xml version=1.0 encoding=UTF-8?

web-app
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns=http://java.sun.com/xml/ns/javaee;
   xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
   xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
   http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
   id=spring_app version=2.5
   display-namespring_app/display-name

   context-param
   param-namewebAppRootKey/param-name
   param-valuespring_app/param-value
   /context-param


Top of jsp, get1.jsp, using a tag dir:


?xml version=1.0 encoding=ISO-8859-1 ?

jsp:root xmlns:jsp=http://java.sun.com/JSP/Page; version=2.1
   jsp:directive.page language=java
   contentType=text/html; charset=ISO-8859-1 
pageEncoding=ISO-8859-1 /

   jsp:text
   ![CDATA[ ?xml version=1.0 encoding=ISO-8859-1 ? ]]
   /jsp:text
   jsp:text
   ![CDATA[ !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 
Transitional//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; ]]

   /jsp:text

html
   xmlns=http://www.w3.org/1999/xhtml;
   xmlns:c=http://java.sun.com/jsp/jstl/core;
   xmlns:fn=http://java.sun.com/jsp/jstl/functions;
   xmlns:tag=urn:jsptagdir:/WEB-INF/tags/

head
meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 /
titleget1/title
/head

body

tag:example3 pageStringVar=${string1} /



The tag file, example3.tag, using deferredValue:


%@ tag
   body-content=scriptless
%

%@ taglib
   prefix=c
   uri=http://java.sun.com/jsp/jstl/core;
%

%@ attribute
   name=pageStringVar
   required=true
   rtexprvalue=true
   deferredValue=true
%

divpageStringVar (in tag file): c:out value=${pageStringVar} //div



The tld file, example3.tld:


?xml version=1.0 encoding=UTF-8?

taglib version=2.1
   xmlns=http://java.sun.com/xml/ns/javaee;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation=http://java.sun.com/xml/ns/javaee 
web-jsptaglibrary_2_1.xsd

   tlib-version1.0/tlib-version

   jspversion2.1/jspversion

   short-nameexample3/short-name

   tag-file
   nameexample3/name
   path/WEB-INF/tags/example3.tag/path
   /tag-file
/taglib



Tomcat stack trace from using a tag dir:

org.apache.jasper.JasperException: org.apache.jasper.JasperException: 
Invalid JSP version defined for tag file at /WEB-INF/tags/example3.tag
   
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
   
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
   
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:265)
   
org.apache.jasper.compiler.JspDocumentParser.parse(JspDocumentParser.java:219)
   
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:200)
   
org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)

   org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:167)
   org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
   org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
   org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
   
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
   
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)

   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:167)
   
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:239)
   
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1158)
   
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
   
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
   
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)