Feb 042014

We got a requirement for not using any frontend webservers but we needed to enable content caching, compression and create alias as in apache webservers. So if you are also looking for some kind of workaround to make it happen then please do follow below steps for alias creation and jboss compression and caching.

Do remember Jboss is now coming with its own webserver but we are not using it so below are only applies to jboss without any webservers.

Settings for alias:

Old Jboss versions:

Put your images in some external folder like c:\images

edit <JBOSS_HOME>/server/<config-name>/deploy/jboss-web.deployer/server.xml

Add below entry to create alias /images

<Host name="localhost" ...>
<!-- ADD static images DIRECTORY -->
<Context path="/images" docBase="c:/images" reloadable="true">
<!-- The rest of your Host entity -->

Newer Jboss versions:

edit <JBOSS_HOME>\jboss-as\server\production\deploy\jbossweb.sar\context.xml

Add something like below removing the default one.

<Context cookies="true" crossContext="true" path="/images" appBase="" docBase="D:/jboss-eap-5.1/jboss-as/server/default/deploy/ROOT.war/images" debug="99" reloadable="true" allowLinking="true">



Open command prompt as administrator and run below command to create a link or shortcut to the external folder(c:\images) where you have stored your images.

C:\Windows\system32>mklink /D <JBOSS_HOME>\jboss-as\server\default\deploy\ROOT.war\images C:\images

The output of above command should look like below.

symbolic link created for D:\jboss-eap-5.1\jboss-as\server\default\deploy\ROOT.war\images <<===>> C:\images


Now you can access any image in the images folder by typeing some url like http://localhost:8080/images/mylogo.jpg

Caching and compression:

Below are the details needs to be done for caching and compression once you are done with the alias.Enabling gzip compression at server level, improves performance with minimal load at server level.

<Connector port="443" address="${jboss.bind.address}" protocol="HTTP/1.1" SSLEnabled="true"

maxThreads="150" scheme="https" secure="true"

clientAuth="false" sslProtocol="TLS"

emptySessionPath="true" compression="on"



Or else you can also do it via web.xml . See details here


For caching you can use this cache filter

© Incase of any copyright infringements please check copyrights page for faster resolutions.

Leave a Reply

Show Buttons
Hide Buttons