1. I logged in as root and installed Apache with yum install httpd
2. Still as root, and inside /var/www/cgi-bin/ I wrote a simple test cgi script
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello World!";
3.tested it with 'lynx http://localhost/cgi-bin/1.cgi' and it was ok
First question: The script is owned by root.Should I change the owner to what (i.e apache?), and what should the correct permissions be?
The problem started when I needed to use an other version of perl, more up to date than system perl, installed in another users home directory:
so '#!/usr/bin/perl' of the script should point to '#!/home/mytestuser/bin/perl'
4.Again as root I make the change and try 'lynx http://localhost/cgi-bin/1.cgi' once again but I get an interal server error,'permission denied'
I've played around with the permissions, even changing the perl's executable ones to chmod a+x+w+r but the nothing changed.
Second question:
When calling the script from the web, what user does it run under given it is owned by root with permissions 755?
does it run as root or apache?
Third question:
If I could picture it then it goes like this :
Web-->request-->Apache user-->perl bin of 'mytest' user-->/var/www/cgi-bin/1.cgi-->permission denied
Who does not have permission and to what?
thanks