Hi Alon,

Thanks for reply.

I am new to tomcat development. but I'll try my best to be more
specific.

it seems that there are a couple of ways to 'deploy' web applications.
the deploy task has a localWar attribute that points to the local build
directory. Or you can use the war attribute that points to a single war
file containing the application.

my web application presents results that are at the moment computed by a
number of stand-alone programs on the server. for maximum reliability I
decided to keep copies of these executables in the application
distribution directory structure, at this point WEB-INF/bin. 

to create the war file for distribution I use the ant dist command. the
dist target includes the task:

    <jar jarfile="${dist.home}/${app.name}-${app.version}.war"
         basedir="${build.home}"/>

the jar task is able to create a single war file from the contents of
the build.home directory hierarchy (that includes WEB-INF/bin). but in
the process it changes the permissions of the executable files to
read-only (i.e. strips the execute bit). as a result my application is
unable to run these executables after installation.

if I manually make these programs executable at the installation
directory (webapp) the application runs fine. so apparently the
SecurityManager has no problem with that (I can obtain a Runtime, and
run a process from within the web application with no problem). I
suppose that's something to look a bit more into to make sure the
application is secure.

At this point I do the installation like this

  <target name="install" depends="compile"
   description="Install application to servlet container">
    <delete dir="${catalina.home}/webapps/${app.name}"/>
    <mkdir    dir="${catalina.home}/webapps/${app.name}"/>
    <copy  todir="${catalina.home}/webapps/${app.name}">
      <fileset dir="${build.home}"/>
    </copy>
    <chmod perm="oug+x">
      <fileset dir="${catalina.home}/webapps/${app.name}/WEB-INF/bin">
      </fileset>
    </chmod>
  </target>

I run 
ant stop
ant install
ant start

but this does not seem to be terribly reliable. I get messages at
catalina.out saying things like " application has not been started" and
"application has already been started" and sometimes I need to do start
and stop a couple of times before the application is actually running.

using the localWar deploy method runs into similar problems in terms of
stripping the execute bit off the executables when installed.

any ideas / comments / suggestions ?

thanks
Murad Nayal


Alon Belman wrote:
> 
> Murad,
> 
> I'm not 100% sure what you're asking -- like what do you mean by "jar
> strips the execute file permissions from my programs"? -- but i'm
> assuming you cant do it.   In fact, I will be more than a little
> alarmed if a packaged web app can include and run arbitrary
> executables unless specifically allowed to so by its server's
> SecurityManager, or if the server is running without a
> SecurityManager.  That is, you cannot do it unless you configure it
> OUTSIDE your web application.
> 
> Hope this helps,
> Alon
> 
> On 7/17/05, Murad Nayal <[EMAIL PROTECTED]> wrote:
> >
> >
> > Hi Everybody,
> >
> > I need to include executable programs as part of my web application. in
> > development I created a directory WEB-INF/bin where I kept copies of the
> > programs I need. problem is when I create a war file for my application,
> > jar strips the execute file permissions from my programs. is there any
> > way around this at all where I would still have my application packaged
> > as a single war file with the necessary executables (with the correct
> > permissions).
> >
> > many thanks
> > Murad Nayal
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to