in reply to Re: Can a Perl script modify .htaccess
in thread Can a Perl script modify .htaccess

So after a lot of testing, and playing I finally got the correct code. However in the end the changes I make only get saved if someone other than root owns .htaccess

Not sure whether this follow up question belongs here in the replies or in a new question, but what would be the safest ownership of .htaccess so that I can change it from Perl scripts run via CGI?

  • Comment on Re^2: Can a Perl script modify .htaccess

Replies are listed 'Best First'.
Re^3: Can a Perl script modify .htaccess [OT] and perms
by hippo (Archbishop) on Jul 23, 2019 at 08:14 UTC

    Assuming that you have exhausted all the other, safer means of achieving the same goal then in your place I might:

    • Ensure AllowOverride is set to the smallest list feasible
    • Create a user and group specifically for this task
    • Ensure that only the files to be modified are owned by this user with tight perms (0644 should be easily lax enough)
    • Set up suEXEC for just the one script to be run by this user/group
    • Have an already-written contingency plan for when this system is broken into.