Tomcat Server -- .JSP File Write Restrictions?

Discussion in 'Java' started by LB, Aug 12, 2008.

  1. LB

    LB Guest

    Is there a way to set up a tomcat server such that .jsp servlets
    canNOT write to a file other than in a /tmp folder?

    In the contrary, if I am on a shared server, can I override a setting
    that only allows my .jsp / javabeans / servlets to only successfully
    write to a simple text file in "/tmp" directory only. (Perhaps
    something in the .htaccess file?) I'm trying to fight the dreaded
    "access denied (java.io.FilePermission..." error in GoDaddy Shared
    Hostings.

    Note: I would normally posted this in
    comp.infosystems.www.servers.unix, except that I know the Apache
    server allows for file writes from both Perl and PHP... That makes me
    suspect a Tomcat setup, and that pushes me to post here instead...

    Anybody been here before? Many thanks in advance,
    LB
     
    LB, Aug 12, 2008
    #1
    1. Advertising

  2. LB

    Dave Miller Guest

    LB wrote:
    > Is there a way to set up a tomcat server such that .jsp servlets
    > canNOT write to a file other than in a /tmp folder?
    >
    > In the contrary, if I am on a shared server, can I override a setting
    > that only allows my .jsp / javabeans / servlets to only successfully
    > write to a simple text file in "/tmp" directory only. (Perhaps
    > something in the .htaccess file?) I'm trying to fight the dreaded
    > "access denied (java.io.FilePermission..." error in GoDaddy Shared
    > Hostings.
    >
    > Note: I would normally posted this in
    > comp.infosystems.www.servers.unix, except that I know the Apache
    > server allows for file writes from both Perl and PHP... That makes me
    > suspect a Tomcat setup, and that pushes me to post here instead...
    >
    > Anybody been here before? Many thanks in advance,
    > LB

    The permissions are per user. If Tomcat is running as tomcat and tomcat
    only has write permissions to tmp, any code executed by tomcat can only
    write to /tmp.

    If you don't have control over your space, you need to contact GoDaddy
    support to see if they'll change directory permissions for you. More
    important [shameless plug warning] if you're doing more than just
    development, you really should be in a private JVM environment like that
    offered by our company and others.

    --
    Dave Miller
    Java Web Hosting
    http://www.cheap-jsp-hosting.com/
     
    Dave Miller, Aug 12, 2008
    #2
    1. Advertising

  3. LB

    Arne Vajhøj Guest

    LB wrote:
    > Is there a way to set up a tomcat server such that .jsp servlets
    > canNOT write to a file other than in a /tmp folder?
    >
    > In the contrary, if I am on a shared server, can I override a setting
    > that only allows my .jsp / javabeans / servlets to only successfully
    > write to a simple text file in "/tmp" directory only. (Perhaps
    > something in the .htaccess file?) I'm trying to fight the dreaded
    > "access denied (java.io.FilePermission..." error in GoDaddy Shared
    > Hostings.


    ..htaccess is used by Apache HTTPD for access control. It has
    nothing to do with Tomcat.

    There are two things that limits file access:
    - the access that the account Tomcat is running under has
    - the limits enforces by the security manager and the security
    policy file if you start Tomcat with that

    On a shared server both are probably out of your control.

    Arne
     
    Arne Vajhøj, Aug 13, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    521
  2. Alan
    Replies:
    4
    Views:
    5,109
  3. Lukasz Indyk
    Replies:
    1
    Views:
    1,486
    Andrew Thompson
    Sep 22, 2004
  4. Replies:
    0
    Views:
    4,435
  5. tiewknvc9
    Replies:
    4
    Views:
    1,784
Loading...

Share This Page