Can I Give the Default User That Runs Perl Scripts from Cgi-Bin Different Permisions?

The default user that Perl scripts run from browsers is www-data. My scripts need permission to read/write/delete files in other directories. All these directories are created within the /home directory (all recursive, i.e. /home/Daniel/ftp/files) and these directories and files are created at run time by different users.

Is there a way to give www-data broader authority? Should I change the default user that runs Perl scripts (again from browsers) even though that sounds dangerous?

Thanks

1 Answer

Should anyone come across this I found my answer.

The default user (for Perl/CGI commands) is located in /etc/apache2/envvars

I commented the line out

#export APACHE_RUN_USER=www-data

Replaced it with the user I wanted

export APACHE_RUN_USER=franklin

then after saving the file I restarted the service

sudo service apache2 restart

I should note that even though I am sure it would have been the wrong thing to do, trying to make the default user 'root' produced an error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest