I am trying to get Apache::ASP running on OSX Lion Server. I have made a fresh install of OSX Lion VM in Fusion 4, installed the Xcode app (with command line tools), and run the following shell commands:
sudo perl -MCPAN -e shell
cpan> install CPAN
cpan> install Bundle::Apache::ASP
I’ve add to end of the httpd.confg files (/Library/Server/Web/Config/apache2/httpd_server_app.conf and
/Library/Server/Web/Config/apache2/httpd_server_app.conf.default):
<Files ~ (\.asp)>
SetHandler perl-script
PerlHandler Apache::ASP
PerlSetVar Global .
PerlSetVar StateDir /tmp/asp
</Files>
But either adding the set handler or perlhandler causes Apache not to restart. Take them both out and Apache starts, but serves an .asp file as a text file….
UPDATE #1:
Oops, twenty or thirty:
sudo apachectl restart
and I didn’t even have mod perl running. Adding the below to the httpd.conf file got Apache to start:
LoadModule perl_module libexec/apache2/mod_perl.so
Alias /perl/ /Library/WebServer/Documents/perl/
<Location /perl/>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
Order allow,deny
Allow from all
</Location>
$Request->{Method} will now return a value, but….
%test = $Request->ServerVariables(); #or $Request->ServerVariables(URL);
%><%= $test %><%
Outputs: Apache::ASP::Collection=HASH(0x7f84114c58d8)
UPDATE #2:
Several of the ServerVariables are undefined on Apache::ASP vs. IIS. The syntax is slightly different than expected. Below will list all available server variables…
my $variables = $Request->{ServerVariables};
print join '<br>', sort keys %$variables;
Solution has been added to question, but the short answer is that mod perl must be running (and does not start by default on OS X Lion…