Hi fellow monks,

I have a question about the best strategy for a problem I'm trying to solve. I am working on a rather large web-based database/content management project. Part of the goal is to make it as easy to install and use as possible - as well as make it useable in virtual hosting setups. What I'd like to do is have a script that is in the cgi-bin (or similar) directory be able to update itself as well as other .cgi scripts in that directory.

My initial thought is to use Net::FTP to grab the files from a pre-determined location (after determining whether an upgrade is available), create a backup directory to copy all existing files into, then grab the group of files from the server, and copy to the present location using Net::FTP. The primary issue I am dealing with here is permissions. I (or anyone with root access) can deal with it by changing ownership of the directory to the apache user. Also, obviously, making the directories world writeable is one other avenue (although I think not at all a good one.) But folks who have virtual host setups often cannot change the permissions on their files, or certainly not change the owner.

So, first, so I don't re-invent the wheel, any great Perl modules I should know about to do this sort of thing? And second, what would be the best strategy to deal with this?

Thanks!

Michelle

edited: Tue Jul 9 04:53:50 2002 by jeffa - title change


In reply to CGI script permissions for self-update (was: Strategy Question) by michellem

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.