Tomcat and Apache Basic Authentication
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]
Tomcat security?
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]
Re: [OT] how to pronounce Apache ?
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]
mysql connection pooling problem
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/ factory org.apache.catalina.users.MemoryUserDatabaseFactory pathname conf/tomcat-users.xml factory org.apache.commons.dbcp.BasicDataSourceFactory maxActive 500 maxIdle 500 maxWait 1 username password driverClassName com.mysql.jdbc.Driver url jdbc:mysql://localhost/testdev http://java.sun.com/dtd/web-app_2_3.dtd";> testdev action org.apache.struts.action.ActionServlet config WEB-INF/struts-config.xml application resource debug 2 detail 2 validate true 2 action *.do index.html index.htm index.jsp default.html default.htm default.jsp /WEB-INF/struts-bean.tld /WEB-INF/struts-bean.tld /WEB-INF/struts-html.tld /WEB-INF/struts-html.tld /WEB-INF/struts-logic.tld /WEB-INF/struts-logic.tld /WEB-INF/struts-template.tld /WEB-INF/struts-template.tld /WEB-INF/struts-nested.tld /WEB-INF/struts-nested.tld /WEB-INF/struts-tiles.tld /WEB-INF/struts-tiles.tld http://jakarta.apache.org/taglibs/application-1.0 /WEB-INF/lib/application.jar http://jakarta.apache.org/taglibs/page-1.0 /WEB-INF/lib/page.jar http://jakarta.apache.org/taglibs/request-1.0 /WEB-INF/lib/request.jar http://jakarta.apache.org/taglibs/response-1.0 /WEB-INF/lib/response.jar http://jakarta.apache.org/taglibs/session-1.0 /WEB-INF/lib/session.jar jspsql /WEB-INF/lib/jspsql.jar http://jakarta.apache.org/taglibs/i18n-1.0 /WEB-INF/lib/i18n.jar http://jakarta.apache.org/taglibs/datetime-1.0 /WEB-INF/lib/datetime.jar http://jakarta.apache.org/taglibs/string-1.0 /WEB-INF/lib/string.jar http://jakarta.apache.org/taglibs/utility /WEB-INF/lib/utility.jar http://jakarta.apache.org/taglibs/mailer-1.0 /WEB-INF/lib/mailer.jar DB Connection jdbc/testdev javax.sql.DataSource Container <%@ page import="javax.sql.DataSource" %> <%@ page import="javax.naming.Context" %> <%@ page import="javax.naming.InitialContext" %> <%@ page import="java.sql.*" %> my test <% try { Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection con1 = java.sql.DriverManager.getConnection("jdbc:mysql://localhost/testdev?user=&password="); con1.close(); out.println("con1 works!"); } catch(Exception e) { System.out.println(e); } try { Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup("java:/comp/env/jdbc/testdev"); out.println("\n
Re: mysql connection pooling problem
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 : : : : javax.servlet.jsp.jstl.sql.dataSource : : :jdbc/testdev : : : : This comes right after the 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 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: mysql connection pooling problem
Hi James, I tried inserting the into , 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 : >: : >: : >: : >: javax.servlet.jsp.jstl.sql.dataSource : >: : >: : >:jdbc/testdev : >: : >: : >: : >: This comes right after the 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]
Re: mysql connection pooling problem
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
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
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
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: JSP Document
On Sat, Sep 06, 2003 at 06:10:26PM +0100, Sam Hough wrote: : : Tomcat 4.1.27 on Win32 given : : : http://java.sun.com/JSP/Page version="1.2"> : Cat & Dog : : : Generates : : Cat & Dog : : Can anybody confirm that this is correct behaviour? Why did the "&" 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]
where is JkWorkerFile
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 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: running tomcat on port 443 as non-root
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
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]