You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Turner, John" <JT...@AAS.com> on 2002/12/12 20:20:37 UTC

RE: server.xml instead of httpd.conf - how do you configure Tomac at 4.x/PHP

Tomcat is a servlet container. It serves content mainly created via JSP and
Java servlets.  It doesn't have anything to do with PHP.  I think there are
some development efforts under way to give Tomcat PHP capability by creating
the PHP engine as a servlet, but I don't know any details.

Tomcat's configuration file is server.xml.  Apache's configuration file is
httpd.conf.  One cannot use the other for configuration information.

Right now, if you want to use PHP with Tomcat, I believe you're limited to
using PHP with Apache, and adding Tomcat support to Apache as well.

John

> -----Original Message-----
> From: Jude Joseph [mailto:j.joseph@qmul.ac.uk]
> Sent: Thursday, December 12, 2002 8:21 AM
> To: tomcat-user@jakarta.apache.org
> Cc: tomcat-user-owner@jakarta.apache.org
> Subject: server.xml instead of httpd.conf - how do you 
> configure Tomacat
> 4.x/PHP
> 
> 
> Hi,
> 
> Most installation instructions of PHP with Apache seem to 
> concentrate on older versions of apache and reference changes 
> in httpd.conf but the newer tomcat installation uses the 
> C:\Program Files\Apache Group\Tomcat 4.1\conf\server.xml file 
> instead of the httpd.conf.  I can not find any instructions 
> anywhere on how to configure this file for PHP to work with 
> Apache on a windows installation.  Any help would be most 
> appreciated. Thank you.
> 
> 
> 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: loading a properties file from a jar file in /WEB-INF/lib/

Posted by Jacob Kjome <ho...@visi.com>.
Hello Matt,

Where does class p exist?  Is it also in WEB-INF/lib or
WEB-INF/classes?

If so, the only one of your examples that will work is:
p.getClass().getResourceAsStream("/net/props/myProps.properties");

If your properties file is in the same package relative to class "p",
then you can do:
p.getClass().getResourceAsStream("myProps.properties");

You can also do this:

p.getClass().getClassLoader().getResourceAsStream("net/props/myProps.properties");


See this for more info...
http://marc.theaimsgroup.com/?l=tomcat-user&m=103904964313189&w=2

Jake

Thursday, December 12, 2002, 2:39:07 PM, you wrote:

MS> Hello,
MS> I'm trying to access a properties file that's located in a package within  a
MS> jar file in /WEB-INF/lib.

MS> net/props/myProps.properties



MS> Properties p = new Properties();
MS> InputStream is = ...

MS> I've tried a lot of methods to set the InputStream, i.e.,

MS> p.getClass().getResourceAsStream("/net/props/myProps.properties");
MS> p.getClass().getResourceAsStream("net/props/myProps.properties");
MS> p.getClass().getResourceAsStream("myProps.properties");
MS> getServletContext().getClass().getClassLoader().getResourceAsStream("/net/pr
MS> ops/myProps.properties");

MS>  but I always get null...

MS> Can someone offer a suggestion?

MS> Thanks alot,
MS> Matt


MS> --
MS> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
MS> For additional commands, e-mail: <ma...@jakarta.apache.org>



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


loading a properties file from a jar file in /WEB-INF/lib/

Posted by Matt Sales <sa...@motoworld.com>.
Hello,
I'm trying to access a properties file that's located in a package within  a
jar file in /WEB-INF/lib.

net/props/myProps.properties



Properties p = new Properties();
InputStream is = ...

I've tried a lot of methods to set the InputStream, i.e.,

p.getClass().getResourceAsStream("/net/props/myProps.properties");
p.getClass().getResourceAsStream("net/props/myProps.properties");
p.getClass().getResourceAsStream("myProps.properties");
getServletContext().getClass().getClassLoader().getResourceAsStream("/net/pr
ops/myProps.properties");

 but I always get null...

Can someone offer a suggestion?

Thanks alot,
Matt


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>