java - Jetty 7.4.2 + Quercus 4.0.18: How can I read PHP files from outside the webapp directory -
using code...
import org.eclipse.jetty.server.server; import org.eclipse.jetty.webapp.webappcontext; public class onewebapp { public static void main(string[] args) throws exception { string jetty_home = "c:/software/jetty"; server server = new server(8080); webappcontext webapp = new webappcontext(); webapp.setcontextpath("/"); webapp.setwar(jetty_home+"/quercus-4.0.18.war"); server.sethandler(webapp); server.start(); server.join(); } }
... can read php files webapp directory: c:\documents , settings\mydir\local settings\temp\jetty-0.0.0.0-8080-quercus-4.0.18.war-_-any-\webapp
how can configure jetty php files in directory? example: c:\projects\phpfiles
with apache, in config:
alias /phpfiles "c:\projects\phpfiles" <directory c:\projects\phpfiles> order allow,deny allow allowoverride </directory>
you can change war path to:
[...] webapp.setcontextpath("/"); webapp.setwar("c:/projects/phpfiles"); [...]
the directory phpfiles need contains structure of web application (minimally include web-inf/web.xml). you'll need either include quercus dependencies in web-inf/lib or add dependencies in classpath (since it's embedded). dependencies , web.xml can found in quercus-*.war.
if need have multiple source directories of php files, don't think support. need extends quercusservletimpl , implement/override getpath(httpservletrequest req).
Comments
Post a Comment