File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

configure JBoss to use static document hierarchy

 
Per Jorgen Walstrom
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
I have several applications running under jBoss4.0.1sp1/Tomcat 5.0 under
/usr/local/java/jboss-4.0.1sp1/server/default/deploy

At the same machine, I have a bunch of static documents, located under
/users/sid/docs

I would like to be able to access those static documents directly, e.g.
http://localhost:8080/users/sid/docs/index.html

Does anyone know how to configure jBoss to be able to access those documents from the given directory, independent of the web-application context? Alternatively, make them available from within a web-application without moving the documents?

best regards,
pj
 
Per Jorgen Walstrom
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to answer my own question:
this is possible by using the allowLinking-attribute of Tomcat. Add the following to server.xml in the Tomcat sar-directory.

< DefaultContext allowLinking="true" / >

Then it will be possible to add symbolic links to anywhere you like

/pj
 
Sanju Thomas
Ranch Hand
Posts: 243
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to add symbolic link ?, can you give some examples ?
 
Per Jorgen Walstrom
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
on unix-based systems, cd to the Tomcat-sar directory (on my system, this is
/usr/local/java/jboss-4.0.1sp1/server/default/deploy/jbossweb-tomcat50.sar/ROOT.war)

use the following command to make a symbolic link:

$ ln -s /usr/local/docs myDocs

then you can list the current directory:

$ ls -la myDocs
lrwxrwxrwx 1 jboss users 4 mai 3 09:42 myDocs -> /usr/local/docs

here you will see that myDocs has been made a symbolic link to /usr/local/docs. Then you can access e.g. http://localhost:8080/myDocs/example.html

where example.html can be found under /usr/local/docs/example.html

This works on unix-based systems. On Windows, I do not know how to do it. I do not even know if it is possible. As can be read from http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html, regarding allowLinking:

"NOTE: This flag MUST NOT be set to true on the Windows platform (or any other OS which does not have a case sensitive filesystem), as it will disable case sensitivity checks, allowing JSP source code disclosure, among other security problems."

hope this helps,
pj
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic