******************************************************************************
I had been messing around with some encryption routines using Crypt::GPG under perl...and needed it all to run under apache2
I'd do something like:
# decrypt.pl
my @encrypted =;
my $decrypted = $gpg->decrypt( \@encrypted );
print $decrypted;
Running it from the command line was all good.. I got my decrypted text... But I really needed the code to run in the context of apache..
The solution on ubuntu, ended up being to create a new user, call it 'decrypter'... Set SuexecUserGroup decrypter decrypter, in my apache conf.. chown /var/www to be owned by decrypted..(/var/www seems to be the location that is compiled in by default for suexec.. it's alot easier to move my webdocs, not owned by decrypter elsewhere and change a line of config or two.. )
using a simple shell script helped me alot...
#!/bin/sh
echo "Content-type: text/plain"
echo ""
echo `whoami`
You will see a user like www-data or nobody if you are not using suexec, or the or you suexec user if you are...
Oh..and it also is important that you symlink (I prefer the shorthand using a2enmod ) the suexec module if running under apache2..