Tomcat security during runtime

2005-08-10 Thread Matt Anderson
Hello all

I have a question, if you setup your own security in Tomcat by using your own 
policy, is there anyway to modify this policy during runtime, without 
restarting 
tomcat itself? Is there any Java API you can use to modify the security manager 
during run time?

Thanking you in advance.

Matt

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



PHP to run under Tomcat

2004-11-28 Thread Matt Anderson
Hi All,

I was wondering if any of you could help me with some Tomcat administration.
I am trying to configure Tomcat (and according to the specs on apache.org it
can be done) to use PHP and I don't want to have Apache handling PHP and
Tomcat handling JSP I would like the Tomcat to handle both. I have done the
following

I installed PHP4
I set the environment variable PHP_HOME to c:\php as this was where I
installed it
I moved phpsrvlt.jar from c:\php\sapi\ to the common\lib directory
I added in the following lines in web.xml

servlet
  servlet-namephp/servlet-name
  servlet-classnet.php.servlet/servlet-class
/servlet

servlet
  servlet-namephp-formatter/servlet-name
  servlet-classnet.php.formatter/servlet-class
/servlet

servlet-mapping
  servlet-namephp/servlet-name
  url-pattern*.php/url-pattern
/servlet-mapping

servlet-mapping
  servlet-namephp-formatter/servlet-name
  url-pattern*.phps/url-pattern
/servlet-mapping

I renamed the php.ini-dist to php.ini in c:\php
I then modified the following lines
extension_dir = .\  -  extension_dir = C:\php\extensions
;extension=php_java.dll -  extension=php_java.dll

[Java]
java.class.path = C:\php\extensions\php_java.jar
java.home = C:\j2sdk1.4.0-rc\
java.library = C:\j2sdk1.4.0-rc\jre\bin\client\jvm.dll
java.library.path = .\

Now my I am using
Windows 2000 Server for the OS
Jakarta Tomcat 5.0.27
php-4.3.9-Win32


The error message I seem to get is
java.lang.UnsatisfiedLinkError: no php5servlet in java.library.path
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1410)
java.lang.Runtime.loadLibrary0(Runtime.java:772)
java.lang.System.loadLibrary(System.java:832)
net.php.reflect.loadLibrary(reflect.java:34)
net.php.reflect.clinit(reflect.java:29)
net.php.servlet.init(servlet.java:157)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117
)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:702)

org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:644)

and if I hit refresh on the same page I get the following different error
java.lang.UnsatisfiedLinkError: send
net.php.servlet.send(Native Method)
net.php.servlet.service(servlet.java:190)
net.php.servlet.service(servlet.java:214)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

Why I get two different errors is beyond me. I have done ALOT of research
into finding the solution to this and I find there are many people who have
come across the same problem but noone has a solution. Has anyone managed to
get PHP to work under Jakarta Tomcat and can anyone see what I am doing
wrong? Thank you all so much for your time and I thank you in advance.

Kindest Regards,
Matt Anderson


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



Linux Virtual Hosting - weird file not found exception

2004-07-19 Thread Matt Anderson
Hi everyone,

I have this problem on my Linux server with tomcat. I recently put in some
virtual hosts and these have worked on a windows 2000 server machine but
doesn't seem to work with linux (Debian).

For some reason it goes to compile the jsp files in a wierd directory
/usr/apps/jakarta-tomcat-5.0.25/work\Catalina\www.extremescrapping.com\_/org
/apache/jsp/index_jsp.class
I believe it should be
/usr/apps/jakarta-tomcat-5.0.25/work/Catalina/www.extremescrapping.com/_/org
/apache/jsp/index_jsp.class

Does anyone know how to make it so it compiles using the correct linux file
path separator and not the windows one. Keep in mind I installed this from
the tar file found Jakarta's website and didn't just copy the files from
windows across. I also manually entered in the virtual hosting ensuring that
the file path separator was a '/'. However I have now run out of ideas. Can
anyone help me please? Below is an example of a failed compile when
index.jsp was requested.

Kindest Regards,
Matt Anderson

java.io.FileNotFoundException: no such file:
/usr/apps/jakarta-tomcat-5.0.25/work\Catalina\www.extremescrapping.com\_/org
/apache/jsp/index_jsp.class
at
org.apache.jasper.compiler.SmapUtil$SDEInstaller.init(SmapUtil.java:248)
at
org.apache.jasper.compiler.SmapUtil$SDEInstaller.install(SmapUtil.java:236)
at
org.apache.jasper.compiler.SmapUtil.installSmap(SmapUtil.java:163)
at
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:420)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:463)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:442)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:430)
at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:5
11)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
74)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:214)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:198)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:152)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137
)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117
)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:102)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:702)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:644)
at java.lang.Thread.run(Thread.java:534)


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



RE: Sybase and Tomcat 5, Possible Problem

2004-06-24 Thread Matt Anderson
I use Sybase ASE12.5 along with Tomcat 5.0.24

I place the JConnect (jconn2d.jar) file in the %tomcathome%/common/lib
directory. Sybase and Tomcat 5.0.24 can work together. I don't have my
web.xml or root.xml (I use virtual hosting) here however I can provide them
tomorrow once I am at work.

Matt Anderson


-Original Message-
From: Jeff Sexton [mailto:[EMAIL PROTECTED]
Sent: Friday, June 18, 2004 1:40 AM
To: [EMAIL PROTECTED]
Subject: Sybase and Tomcat 5, Possible Problem


After a lot of effort, I feel there may be some reason that the Sybase
JConnect JDBC driver doesn't work in Tomcat 5.0.24 (I use Tomcat 4 for my
Sybase driven apps quite a bit).

The exception is:

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
class '' for connect URL 'null', cause: null

META-INF/context.xml is:

   Context path=/forteCommon docBase=forteCommon reloadable=true
   ResourceLink name=jdbc/odsdb03 global=jdbc/odsdb03
 type=javax.sql.DataSource/
   /Context

 From conf/server.xml contains:

   GlobalNamingResources
 Resource name=jdbc/odsdb03
   auth=Container
   type=javax.sql.DataSource/
 ResourceParams name=jdbc/odsdb03
   parameter
 namefactory/name
 valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
   /parameter
   parameter
 nameusername/name
 valueexcalibur/value
   /parameter
   parameter
 namepassword/name
 valuemypassword/value
   /parameter
   parameter
 namedriverClassName/name
 valuecom.sybase.jdbc2.jdbc.SybDriver/value
   /parameter
parameter
  namedriverName/name
  valuejdbc:sybase:Tds:pdxax12:4100/value
/parameter
   parameter
 nameurl/name
 valuejdbc:sybase:Tds:pdxax12:4100/value
   /parameter
   parameter
 namemaxActive/name
 value5/value
   /parameter
 /ResourceParams 
   /GlobalNamingResources

web.xml contains:

web-app
 servlet
 servlet-name
 ProvCICS
 /servlet-name
 servlet-class
 com.ods.forte.cics.servlet.ProvCICS
 /servlet-class
 load-on-startup1/load-on-startup
 /servlet

 servlet-mapping
   servlet-nameProvCICS/servlet-name
   url-pattern/ProvCICS/url-pattern
 /servlet-mapping

 resource-ref
   descriptionodsdb03 Connection Pool/description
   res-ref-namejdbc/odsdb03/res-ref-name
   res-typejavax.sql.DataSource/res-type
   res-authContainer/res-auth
 /resource-ref
/web-app


I have also tried working with the context placed in server.xml
and with the Resource defined in the context, all combinations
yield the same behavior.

*Tomcat does actually log into the database server when it starts*

I can see it from the database side.  Therefore I know the jdbc
jar file is loaded and the connection specification correct and working.
In addition, the stack trace in catalina.out includes a point
in Sybase code:

Cannot create JDBC driver of class '' for connect URL 'null'
java.lang.NullPointerException
 at com.sybase.jdbc2.jdbc.SybDriver.acceptsURL(SybDriver.java:197)
 at java.sql.DriverManager.getDriver(DriverManager.java:249)
 at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav
a:743)
 ...

So can I conclude that the app is actually linked to the resource?  If
so then the problem seems to be that the information required somehow
does not reach down the driver?

Ideas?

Should I rollback to TC 4x for awhile?

--
The ODS Companies
Jeff Sexton
Information Services
(503) 228-6554   x1026
http://www.odscompanies.com

This message is intended for the sole use of the individual and entity
to whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose
or distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message.


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



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



RE: question about user name and password to use

2004-06-24 Thread Matt Anderson
You should be able to login into the admin web app by using the following
details
Goto http://localhost/admin (assuming the server is on your machine) - this
is for the admin web application
Goto http://localhost/manager/html (assuming the server is on your
machine) - this is for the manager web application
Username: admin
Password: admin

Keep bother your username and password all lower case as this is how they
are defined in the tomcat_users.xml file.
 user name=admin  password=admin  roles=tomcat,role1,admin,manager/

Matt

-Original Message-
From: Selmar [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 24, 2004 9:21 PM
To: [EMAIL PROTECTED]
Subject: question about user name and password to use


Hi,

I have an very simple and maybe stupid question. What are the user names
and passwords for the status tomcat administration and manager
that i should use on the http://localhost:8080 page. Admin as user name
and admin as password do not work.

My tomcat_users.xml is on /usr/tomcat/jakarta-tomcat-5.0.25/conf and i
use mandrake version 10.0

Thanks in advance,

Selmar.

!--
 NOTE:  By default, no user is included in the manager role required
 to operate the /manager web application.  If you wish to use this app,
 you must define such a user - the username and password are arbitrary.
--
tomcat-users
 user name=tomcat password=tomcat roles=tomcat /
 user name=role1  password=tomcat roles=role1  /
 user name=both   password=tomcat roles=tomcat,role1 /
 user name=admin  password=admin  roles=tomcat,role1,admin,manager/
/tomcat-usersssword=admin roles=tomcat,role1,admin,manager/

/tomcat-users

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



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



Security

2004-03-20 Thread Matt Anderson
Hi All,
This is the first time I have used this list so this question may have
been asked many times before, however I tried to download previous message
but were unsucessful. My question is, how do you configure the security
manager to disable things like System.exit() and Runtime.exec() and even
some of the java.io.* package functions. I have read the how-to and I am
still a little confused. I would appreciate any guidance on this and any
examples too. Thank you all for taking the time to read this and I look
forward to your response.

Kindest Regards,
Matt Anderson


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