Re: running tomcat on port 443 as non-root

2003-09-24 Thread Eugene Lee
On Wed, Sep 24, 2003 at 08:33:32AM +0200, Damian Egli wrote:
: 
: I have to run Tomcat standalone as user e.g tomcat (non-root) on port 443.
: But the server doesn't start (not able to bind port 443).
: With 8443 everything works fine.
: 
: Why can't tomcat do that like apache ?

In order to bind to port 443 (or any port below 1024), you must be root.


-- 
Eugene Lee
http://www.coxar.pwp.blueyonder.co.uk/

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



Re: MIME Types

2003-09-24 Thread Eugene Lee
On Wed, Sep 24, 2003 at 09:19:34AM +0100, Matthew Oatham wrote:
: 
: Does anyone know the mime type for WAR files. I foud somewhere on the web 
: that JAR files have a mime type of application/java-archive but cant find 
: any info on WAR files.

AFAIK, there is no official MIME type for .war files.  The Java camp
claims it as a web archive, while the Konqueror camp claims it as an
archived HTML page.

-- 
Eugene Lee
http://www.coxar.pwp.blueyonder.co.uk/

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



where is JkWorkerFile

2003-09-08 Thread Eugene Lee
Trying to get mod_jk2 working, and Apache 2 complains in its error logs:

No worker file and no worker options in httpd.conf 
use JkWorkerFile to set workers

Now I do have a JkWorkersFile directive, but it's in an external file
that is Include'd inside a VirtualHost block.  Thoughts?


-- 
Eugene Lee
http://www.coxar.pwp.blueyonder.co.uk/

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



Re: JSP Document

2003-09-06 Thread Eugene Lee
On Sat, Sep 06, 2003 at 06:10:26PM +0100, Sam Hough wrote:
: 
: Tomcat 4.1.27 on Win32 given
: 
: ?xml version=1.0?
: jsp:root xmlns=http://java.sun.com/JSP/Page version=1.2
: h1Cat amp; Dog/h1
: /jsp:root
: 
: Generates
: 
: h1Cat  Dog/h1
: 
: Can anybody confirm that this is correct behaviour?

Why did the amp; entity get changed to a plain  character?  That's
not kosher with HTML-4.01 specs.


-- 
Eugene Lee
http://www.coxar.pwp.blueyonder.co.uk/

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



Re: mysql connection pooling problem

2003-08-27 Thread Eugene Lee
On Tue, Aug 26, 2003 at 08:25:31AM -0600, Steve Wilkinson wrote:
: 
: I followed the example at 
: 
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/printer/jndi-datasource-examples-howto.html#MySQL%20DBCP%20Example.
: 
: The only thing I see wrong is the following line of code:
: 
: DataSource ds = (DataSource)ctx.lookup(java:/comp/env/jdbc/testdev)
: 
: should be java:comp/env/jdbc/testdev as already mentioned earlier.

Thanks Steve.  An earlier response mentioned the same typo, and I've
already fixed it.  But I still get the same error message.

: Thus, I've attached my example for you to compare.  Note, DBCP 
: connection pool requires additional jars as indicated in the README.txt 
: file.  I assume you already know this, but I mention it just incase.

Yep, I've got all those JARs in $CATALINA_HOME/common/lib.


-- 
Eugene Lee
http://www.coxar.pwp.blueyonder.co.uk/

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



Re: mysql connection pooling problem

2003-08-26 Thread Eugene Lee
On Tue, Aug 26, 2003 at 05:43:02AM -0400, Christopher Garrett wrote:
: 
: This is an absolute shot in the dark, but I believe you might have to
: put a JAR with JDBC drivers into WEB-INF/lib.

Hi Christopher,

Thanks for the suggestion.  But as I mentioned in my original message,
I already tried this to no avail... :-/


-- 
Eugene Lee
http://www.coxar.pwp.blueyonder.co.uk/

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



Re: mysql connection pooling problem

2003-08-26 Thread Eugene Lee
On Tue, Aug 26, 2003 at 11:24:21AM +0100, Purvis, Robert wrote:
: 
: Or put it into tomcat4/common/lib - because then all web applications can
: access the JDBC driver.

Hi Rob,

Thanks for the suggestion.  But as I mentioned in my original message,
I already tried this to no avail.  I went through all the usual spots
($CATALINA_HOME/common/lib, $JAVA_HOME/jre/lib/ext, and even my webapp's
WEB-INF/lib) and got nada.


-- 
Eugene Lee
http://www.coxar.pwp.blueyonder.co.uk/

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



Re: mysql connection pooling problem

2003-08-26 Thread Eugene Lee
On Tue, Aug 26, 2003 at 09:28:14AM -0400, Paul wrote:
: Eugene Lee responded:
:  On Tue, Aug 26, 2003 at 11:24:21AM +0100, Purvis, Robert wrote:
:  :
:  : Or put it into tomcat4/common/lib - because then all web
:  : applications can access the JDBC driver.
: 
:  Thanks for the suggestion.  But as I mentioned in my original message,
:  I already tried this to no avail.  I went through all the usual spots
:  ($CATALINA_HOME/common/lib, $JAVA_HOME/jre/lib/ext, and even my webapp's
:  WEB-INF/lib) and got nada.
: 
: Did you try this directory (to place jdbc jar files)?
: 
: %CATALINA_HOME%\shared\lib\ojdbc14.jar

Hi Paul,

As I mentioned in my original message, I have already tried installing
the driver, MySQL Connector/J 3.0.8, in all of the directories mentioned
above (note that %CATALINA_HOME%\shared\lib\ is the same thing as
$CATALINA_HOME/common/lib on a Unix platform).


-- 
Eugene Lee
http://www.coxar.pwp.blueyonder.co.uk/

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



Re: mysql connection pooling problem

2003-08-25 Thread Eugene Lee
Hi James,

I tried inserting the context-param into web-app, no effect.

But thanks for catching the typo in my JSP code in the lookup() line.
Unfortunately, this had no effect either.  I still get the infamous
Cannot load JDBC driver class 'null' error... hurmmm...

Any suggestions from others are appreciated too!  Anyone?


On Sat, Aug 23, 2003 at 11:09:36AM -0600, James Harman wrote:
: Eugene Lee wrote:
: On Sat, Aug 23, 2003 at 08:59:05AM -0600, James Harman wrote:
: : 
: : I noticed that in the web.xml you have the jbdc resource in a 
: : resource-ref.  In my stuff I have it as a context-param like this
: : 
: : context-param
: :param-name
: :  javax.servlet.jsp.jstl.sql.dataSource
: :/param-name
: :param-value
: :jdbc/testdev
: :/param-value
: :  /context-param
: : 
: : This comes right after the web-app element in the web.xml file. 
: : 
: : I am not experienced enough to know the difference between context-param 
: : and resource-ref, but this seems to work for me.
:
: Another thing you might look at is your jsp code.  You have
: 
: DataSource ds = (DataSource)ctx.lookup(java:/comp/env/jdbc/testdev);
: 
: you probably want
: 
: DataSource ds = (DataSource)ctx.lookup(java:comp/env/jdbc/testdev);
: 
: notice that there is no / before comp.


-- 
Eugene Lee
http://www.coxar.pwp.blueyonder.co.uk/

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



mysql connection pooling problem

2003-08-23 Thread Eugene Lee
I'm having a really odd problem connecting to a local MySQL server.  If
I use java.sql.DriverManager.getConnection(), it works perfectly fine.
But when I try to use a connection pool:

http://www.mysql.com/articles/connection_pooling_with_connectorj.html

it errors out:

java.sql.SQLException: Cannot load JDBC driver class 'null'

I've tried moving the MySQL driver to $CATALINA_HOME/common/lib,
$JAVA_HOME/jre/lib/ext, and even my webapp's WEB-INF/lib.  The results
are still the same.

I've followed the often-recommended Tomcat 4.1 documentation to no avail.
Here's what my box is running:

FreeBSD 4.8-RELEASE-p3   
Java 2 SDK 1.3.1_09
Jakarta-Tomcat 4.1.27
MySQL Connector/J 3.0.8

I've attached my server.xml, my webapp's web.xml, and a test page
test.jsp to demonstrate the error.  BTW, before it throws the exception
on the getconnection(), the page output is:

con1 works!
DS lookup OK!

I appreciate any suggestions.  Much thanks in advance.


-- 
Eugene Lee
http://www.coxar.pwp.blueyonder.co.uk/
Server port=8005 shutdown=SHUTDOWN debug=0

  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener
debug=0/
  Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
debug=0/

  !-- Global JNDI resources --
  GlobalNamingResources

!-- Editable user database that can also be used by
 UserDatabaseRealm to authenticate users --
Resource name=UserDatabase auth=Container
  type=org.apache.catalina.UserDatabase
  description=User database that can be updated and saved
/Resource
ResourceParams name=UserDatabase
  parameter
namefactory/name
valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value
  /parameter
  parameter
namepathname/name
valueconf/tomcat-users.xml/value
  /parameter
/ResourceParams

  /GlobalNamingResources

  Service name=Tomcat-Apache

Connector className=org.apache.catalina.connector.warp.WarpConnector
   port=8008 minProcessors=5 maxProcessors=75
   enableLookups=true appBase=webapps acceptCount=10
   debug=0/

Engine className=org.apache.catalina.connector.warp.WarpEngine
name=Apache debug=0

Logger className=org.apache.catalina.logger.FileLogger
prefix=catalina_log. suffix=.txt timestamp=true/

Host name=localhost debug=0 appBase=webapps
  unpackWARs=true autoDeploy=true

  Logger className=org.apache.catalina.logger.FileLogger
  directory=logs  prefix=localhost_log. suffix=.txt
  timestamp=true/

  Context path=/testdev docBase=testdev debug=0 reloadable=true
   crossContext=true
Logger className=org.apache.catalina.logger.FileLogger
prefix=testdev_log. suffix=.txt
timestamp=true/
Resource name=jdbc/testdev auth=Container
  type=javax.sql.DataSource/
ResourceParams name=jdbc/testdev
  parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
  parameter
namemaxActive/name
value500/value
  /parameter
  parameter
namemaxIdle/name
value500/value
  /parameter
  parameter
namemaxWait/name
value1/value
  /parameter
  parameter
nameusername/name
value/value
  /parameter
  parameter
namepassword/name
value/value
  /parameter
  parameter
namedriverClassName/name
valuecom.mysql.jdbc.Driver/value
  /parameter
  parameter
nameurl/name
valuejdbc:mysql://localhost/testdev/value
  /parameter
/ResourceParams
  /Context

/Host

Realm className=org.apache.catalina.realm.MemoryRealm /

/Engine

  /Service

/Server
?xml version=1.0 encoding=UTF-8?
!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN 
http://java.sun.com/dtd/web-app_2_3.dtd;
web-app id=TESTDEV
display-nametestdev/display-name
servlet
servlet-nameaction/servlet-name
servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
param-nameconfig/param-name
param-valueWEB-INF/struts-config.xml/param-value
/init-param
init-param
param-nameapplication/param-name
param-valueresource/param-value
/init-param
init-param
param-namedebug/param-name
param-value2/param-value
/init-param
init-param
param-namedetail/param-name
param-value2/param-value
/init-param
init-param

Re: mysql connection pooling problem

2003-08-23 Thread Eugene Lee
On Sat, Aug 23, 2003 at 08:59:05AM -0600, James Harman wrote:
: 
: Eugene,
: 
: I noticed that in the web.xml you have the jbdc resource in a 
: resource-ref.  In my stuff I have it as a context-param like this
: 
: context-param
:param-name
:  javax.servlet.jsp.jstl.sql.dataSource
:/param-name
:param-value
:jdbc/testdev
:/param-value
:  /context-param
: 
: This comes right after the web-app element in the web.xml file. 
: 
: I am not experienced enough to know the difference between context-param 
: and resource-ref, but this seems to work for me.

I'm using resource-ref because that's what the Tomcat docs say.  :-)


http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html#MySQL%20DBCP%20Example

I'll try it out later today and report back with the results.


-- 
Eugene Lee
http://www.coxar.pwp.blueyonder.co.uk/

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



Re: [OT] how to pronounce Apache ?

2003-08-11 Thread Eugene Lee
On Mon, Aug 11, 2003 at 02:49:52PM +0530, Antony paul wrote:
: 
: I would like to know how to pronoune Apache in US English. I found two
: pronounciations at http://dictionary.reference.com/search?q=apache which one
: is right ?. Or any other forms ?

If we're talking about the web server, look at the pronunciation given
for the definition of A Native American people.


-- 
Eugene Lee
http://www.coxar.pwp.blueyonder.co.uk/

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



Tomcat security?

2003-07-03 Thread Eugene Lee
Anyone want to discuss hardening Tomcat servers?

Hacking Contest Threatens Web Sites

By George V. Hulme, InformationWeek
Updated Wednesday, July 2, 2003, 3:00 PM EDT

A hacking contest slated for this weekend could produce a rash
of Web-site defacements worldwide, according to a warning issued
Wednesday by security companies and government Internet security
groups.  The hacker defacement contest is expected to kick off
on Sunday. The contest supposedly will award free hosting
services, Web mail, unlimited E-mail forwarding, and a domain
name of choice for the triumphant hackers, according to a Web
site promoting the contest.

...

More details at:

http://www.internetweek.com/story/showArticle.jhtml?articleID=10818014


-- 
Eugene Lee
http://www.coxar.pwp.blueyonder.co.uk/

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



Tomcat and Apache Basic Authentication

2003-06-23 Thread Eugene Lee
I have a box where Apache's basic authentication is working fine, via
directives in httpd.conf or an .htaccess file in the selected directory.
However, when the selected directory is located under the webapp context
directory, Apache serves it up without any prompting for any username
and password, no 401 response header, nada.  It's as if the URL to any
webapp bypasses Apache's authentication modules and sends the request
straight to the connector.  I'm using Webapp (I know, I know).  Is there
a special setting to make Webapp obey Apache's authentication system?
Any suggestions or pointers are appreciated.


-- 
Eugene Lee
http://www.coxar.pwp.blueyonder.co.uk/

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