*
The moose likes JBoss/WildFly and the fly likes configure JBoss to use static document hierarchy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "configure JBoss to use static document hierarchy" Watch "configure JBoss to use static document hierarchy" New topic
Author

configure JBoss to use static document hierarchy

Per Jorgen Walstrom
Greenhorn

Joined: Apr 28, 2005
Posts: 6
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

Joined: Apr 28, 2005
Posts: 6
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

Joined: Dec 29, 2004
Posts: 243
How to add symbolic link ?, can you give some examples ?
Per Jorgen Walstrom
Greenhorn

Joined: Apr 28, 2005
Posts: 6
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
 
jQuery in Action, 2nd edition
 
subject: configure JBoss to use static document hierarchy