Mod_Perl configuration for multiple domains

Posted by daliaessam on Server Fault See other posts from Server Fault or by daliaessam
Published on 2012-10-06T09:41:36Z Indexed on 2012/10/13 3:39 UTC
Read the original article Hit count: 475

Filed under:
|
|

Reading the Mod_Perl module documentation, can we configure it on per domain basis, what I mean can we configure it to run on every domain or specific domain only.

What I see in the docs is:

Registry Scripts

To enable registry scripts add to httpd.conf:

Alias /perl/ /home/httpd/2.0/perl/
<Location /perl/>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
</Location>

and now assuming that we have the following script:

#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "mod_perl 2.0 rocks!\n";

saved in /home/httpd/httpd-2.0/perl/rock.pl. Make the script executable and readable by everybody:

% chmod a+rx /home/httpd/httpd-2.0/perl/rock.pl

Of course the path to the script should be readable by the server too. In the real world you probably want to have a tighter permissions, but for the purpose of testing, that things are working, this is just fine.

From what I understand above, we can run Perl scripts only from one specific folder that we put the directive above. So the question again, can we make this directive per domain for all domains or for specific number of domains?

© Server Fault or respective owner

Related posts about perl

Related posts about apache2