anyway to keep static content of deployed web-apps in between web-app updates?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Application Server > anyway to keep static content of deployed web-apps in between web-app updates?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    anyway to keep static content of deployed web-apps in between web-app updates?  
Paul Allen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-23-04 10: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.







[ Post a follow-up to this message ]



    Re: anyway to keep static content of deployed web-apps in between web-app updates?  
Kirti Dua


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-23-04 10: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.
>
>







[ Post a follow-up to this message ]



    Re: anyway to keep static content of deployed web-apps in between web-app updates?  
Dexthor


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-24-04 01:23 PM

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/st
atic

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.
>
>







[ Post a follow-up to this message ]



    Re: anyway to keep static content of deployed web-apps in between web-app updates?  
Paul Allen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-25-04 11: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







[ Post a follow-up to this message ]



    Re: anyway to keep static content of deployed web-apps in between web-app updates?  
Paul Allen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-25-04 11: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] 
>
>







[ Post a follow-up to this message ]



    Re: anyway to keep static content of deployed web-apps in between web-app updates?  
Paul Allen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-25-04 11: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] 
>
>







[ Post a follow-up to this message ]



    Re: anyway to keep static content of deployed web-apps in between web-app updates?  
Dexthor


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-27-04 11: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/stati
c 
> few 
> matter 
> the 
have[vbcol=seagreen] 
> directory. 
> so 
> adding 
>
>







[ Post a follow-up to this message ]



    Re: anyway to keep static content of deployed web-apps in between web-app updates?  
Dexthor


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-02-04 11: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 
>
>







[ Post a follow-up to this message ]



    Re: anyway to keep static content of deployed web-apps in between web-app updates?  
Ran Kornfeld


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-30-05 12:59 PM

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.x
mi file. What you should do is enable file serving and then set some attribu
tes that will control the f
ile serving.
Here is an example:
<webappext:WebAppExtension xmi:version="2.0" xmlns:xmi="http://www.omg.org/X
MI" 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" fileS
ervingEnabled="true" directoryBrowsingEnabled="false" serveServletsByClassna
meEnabled="false" preCompileJSPs="false" autoRequestEncoding="false" autoRes
ponseEncoding="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" val
ue="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 resourc
es 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 [url]http://publib.boulder.ibm.com/infocenter/wasinf
o/v6r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/cweb_flserv.html[/u
rl]

Ran






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:29 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register