Running Perl Script as Root
I am trying to create a flat text file above the web document root directory and save a few lines of text. Given my web user ("nobody") does not have directory permissions to this location, I am looking to run a basic script that can create a file and add a few lines of text.
Is it possible to do this in a Perl script? I have had no success with PHP (see http://www.webdeveloper.com/forum/sh...d.php?t=224375).
Has anyone ever done this? Do you have a sample of the perl script?
This is not the best way to go, methinks. If you actually can get root permissions, then rather give your www user proper permissions.
For example, you could create a new group "powerusers", assign the directory to that group, give it the group-write permission and add your web user to this group.
chgrp powerusers /var/www/.../
usermod -G powerusers nobody
chmod g+w /var/www/.../
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)