Mod_Perl configuration for multiple domains
- by daliaessam
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?