| Author |
anyway to keep static content of deployed web-apps in between web-app updates?
|
|
| Paul Allen 2004-08-23, 5:56 pm |
| I have a TON of static content in a web app (BOB) whose main job is to
provide access control to that content. When I redeploy (i.e. update) the
web-app, all the files in the "bob.WAR" directory are deleted and I have to
populate the static content again by copying it to the bob.WAR directory.
Anybody know of a way to prevent WebSphere from cleaning the .WAR
directories when updating? When I say TONs I mean like 100K HTML files so it
takes a while to copy and I don't even want to think about actually adding
the content to the WAR.
Any thoughts appreciated. I'm using WebSphere v5.1.
| |
| Kirti Dua 2004-08-23, 5:56 pm |
| You can use "Hot Deployment and Dynamic Reloading" to a running server
without redeploying the WAR file each time.
http://publib.boulder.ibm.com/infoc...hotupgrade.html
HTH!
Kirti
"Paul Allen" <pea1@cornell.edu> wrote in message
news:cgdbir$77s6$1@news.boulder.ibm.com...
> I have a TON of static content in a web app (BOB) whose main job is to
> provide access control to that content. When I redeploy (i.e. update) the
> web-app, all the files in the "bob.WAR" directory are deleted and I have
to
> populate the static content again by copying it to the bob.WAR directory.
> Anybody know of a way to prevent WebSphere from cleaning the .WAR
> directories when updating? When I say TONs I mean like 100K HTML files so
it
> takes a while to copy and I don't even want to think about actually adding
> the content to the WAR.
>
> Any thoughts appreciated. I'm using WebSphere v5.1.
>
>
| |
| Dexthor 2004-08-24, 8:23 am |
| If you have organized your static content to he under a directory tree (
for example: /static ) at the root of .war, and if all static content is
contained in a seperate dir tree, then you can move the static content out
of WebApp and defined WebServer Virtual Directories so that your static
content is served up by the webserver.
For example:
if /static is the folder at the root of WAR archive.
if /myApp is your context root.
then:
define a virtual directory /myApp/static in your webserver and point it to
your $WAS_HOME/installedApps/{node|cell}/EnterpriseApp.ear/myApp.war/static
For this to effectively work, you have to make sure that fileserving is
disabled in your WAR (you may have to play with this a bit, in the first few
attempts).
With this scheme, you dont have to worry about your static content no matter
how you deploy/redeploy your App, as long as you dont change the context
root !
HTH
Dexthor.
"Paul Allen" <pea1@cornell.edu> wrote in message
news:cgdbir$77s6$1@news.boulder.ibm.com...
> I have a TON of static content in a web app (BOB) whose main job is to
> provide access control to that content. When I redeploy (i.e. update) the
> web-app, all the files in the "bob.WAR" directory are deleted and I have
to
> populate the static content again by copying it to the bob.WAR directory.
> Anybody know of a way to prevent WebSphere from cleaning the .WAR
> directories when updating? When I say TONs I mean like 100K HTML files so
it
> takes a while to copy and I don't even want to think about actually adding
> the content to the WAR.
>
> Any thoughts appreciated. I'm using WebSphere v5.1.
>
>
| |
| Paul Allen 2004-08-25, 6:03 pm |
| Umm, sorry but what's a soft link? I'm in Win2K world so I can't use Linux
symbolic links.
"Ken Hygh" <kenhygh@nc.rr.com> wrote in message
news:cgdold$3vsc$1@news.boulder.ibm.com...
> Paul Allen wrote:
>
to[vbcol=seagreen]
it[vbcol=seagreen]
adding[vbcol=seagreen]
> can you do a soft link?
> Ken
| |
| Paul Allen 2004-08-25, 6:03 pm |
| Thanks. This looks promising. Basically I read it as just manually unpacking
the EAR/WAR into the deployment directory instead of using the web admin
interface to do it. Restarting the application may of may not be necessary,
depending on the changes I've made.
"Kirti Dua" <kirti.dua@ci.longmont.co.us> wrote in message
news:cgdphc$5qdi$1@news.boulder.ibm.com...
> You can use "Hot Deployment and Dynamic Reloading" to a running server
> without redeploying the WAR file each time.
>
http://publib.boulder.ibm.com/infoc...hotupgrade.html
>
> HTH!
> Kirti
>
>
> "Paul Allen" <pea1@cornell.edu> wrote in message
> news:cgdbir$77s6$1@news.boulder.ibm.com...
the[vbcol=seagreen]
> to
directory.[vbcol=seagreen]
so[vbcol=seagreen]
> it
adding[vbcol=seagreen]
>
>
| |
| Paul Allen 2004-08-25, 6:03 pm |
| I guess I don't quite understand this approach. It still seems like I'll end
up with an actual directory in the WAR deployment directory, which will get
deleted when I do a web app update from the admin web UI. The other thing is
that I really need the app to filter requests to the static files so that I
can reject requests from unauthorized people.
"Dexthor" <gopalaratnam_forgetit@hotemail.com> wrote in message
news:cgfbui$1qs2$1@news.boulder.ibm.com...
> If you have organized your static content to he under a directory tree (
> for example: /static ) at the root of .war, and if all static content is
> contained in a seperate dir tree, then you can move the static content out
> of WebApp and defined WebServer Virtual Directories so that your static
> content is served up by the webserver.
>
> For example:
> if /static is the folder at the root of WAR archive.
> if /myApp is your context root.
> then:
> define a virtual directory /myApp/static in your webserver and point it to
> your
$WAS_HOME/installedApps/{node|cell}/EnterpriseApp.ear/myApp.war/static
>
> For this to effectively work, you have to make sure that fileserving is
> disabled in your WAR (you may have to play with this a bit, in the first
few
> attempts).
>
> With this scheme, you dont have to worry about your static content no
matter
> how you deploy/redeploy your App, as long as you dont change the context
> root !
>
> HTH
> Dexthor.
>
> "Paul Allen" <pea1@cornell.edu> wrote in message
> news:cgdbir$77s6$1@news.boulder.ibm.com...
the[vbcol=seagreen]
> to
directory.[vbcol=seagreen]
so[vbcol=seagreen]
> it
adding[vbcol=seagreen]
>
>
| |
| Dexthor 2004-08-27, 6:29 pm |
| (Avoiding loosing static content during App Updates)
If you are willing to define a Virtual Directory on the webserver
(/appcontext/static ->{whereever the static content is}), then you can copy
the static content once when you know that there is change in the content.
This way, you dont have to worry about losing the content when you redeploy.
(Securing access to the static content)
On the webserver you can configure the security in such a away (depends on
your webserver) that only access/requests with a specific parttern or header
or cookie will be allowed to access static content. You may as well write a
CGI that would enforce this if you cannot make your webserver to do it.
HTH
Dexthor.
"Paul Allen" <pea1@cornell.edu> wrote in message
news:cgidrb$6qqs$1@news.boulder.ibm.com...
> I guess I don't quite understand this approach. It still seems like I'll
end
> up with an actual directory in the WAR deployment directory, which will
get
> deleted when I do a web app update from the admin web UI. The other thing
is
> that I really need the app to filter requests to the static files so that
I
> can reject requests from unauthorized people.
>
> "Dexthor" <gopalaratnam_forgetit@hotemail.com> wrote in message
> news:cgfbui$1qs2$1@news.boulder.ibm.com...
([vbcol=seagreen]
out[vbcol=seagreen]
to[vbcol=seagreen]
> $WAS_HOME/installedApps/{node|cell}/EnterpriseApp.ear/myApp.war/static
> few
> matter
> the
have[vbcol=seagreen]
> directory.
> so
> adding
>
>
| |
| Dexthor 2004-09-02, 6:59 pm |
| You got it.
In one of the tools I wrote for our developers, operations groups, I've
added this feature and called it 'Stealth Deployment'. Which wont cause
wider outages. Lots of site specifics play into justification of 'outages'
and 'impacts' when deployments are done this way for sure.
HTH
Dexthor.
"Paul Allen" <pea1@cornell.edu> wrote in message
news:cgidjo$5q36$1@news.boulder.ibm.com...
> Thanks. This looks promising. Basically I read it as just manually
unpacking
> the EAR/WAR into the deployment directory instead of using the web admin
> interface to do it. Restarting the application may of may not be
necessary,
> depending on the changes I've made.
>
> "Kirti Dua" <kirti.dua@ci.longmont.co.us> wrote in message
> news:cgdphc$5qdi$1@news.boulder.ibm.com...
>
http://publib.boulder.ibm.com/infoc...hotupgrade.html
> the
have[vbcol=seagreen]
> directory.
> so
> adding
>
>
| |
| Ran Kornfeld 2005-11-30, 7:59 am |
| The solution is to use something like a virtual directory, where the static content is outside of the WAR file (anywhere you want actually...), and you have a reference from the web app.
To do that with WebSphere, we have to go into almost undocumented territory (don't you love when WebSphere people do that..) and check the ibm-web-ext.xmi file. What you should do is enable file serving and then set some attributes that will control the f
ile serving.
Here is an example:
<webappext:WebAppExtension xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:webappext="webappext.xmi" xmlns:webapplication="webapplication.xmi" xmlns:commonext.localtran="commonext.localtran.xmi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-insta
nce" xmi:id="WebApp_ID_Ext" reloadInterval="3" reloadingEnabled="true" fileServingEnabled="true" directoryBrowsingEnabled="false" serveServletsByClassnameEnabled="false" preCompileJSPs="false" autoRequestEncoding="false" autoResponseEncoding="false">
<webApp href="WEB-INF/web.xml#WebApp_ID"/>
<fileServingAttributes xmi:id="FSA_1" name="extendedDocumentRoot" value="C:/static_content"/>
<fileServingAttributes xmi:id="FSA_2" name="file.serving.patterns.allow" value="images/*"/>
</webappext:WebAppExtension>
as you can see, I have added the 'extendedDocumentRoot' attribute - this one allows you to put a comma delimited list of locations or jar files to look in, and the 'file.serving.patterns.allow' attribute to control which resources should be served.
Now you can access your static resources with the following URL:
http://yourserver:9080/yourContextR...ges/myimage.gif
Other available attributes - check http://publib.boulder.ibm.com/infoc...web_flserv.html
Ran
|
|
|
|