让 Apache::ASP 在 OSX Lion Server 中运行 - 针对 Mountain Lion 进行了更新

发布于 2024-12-19 11:49:24 字数 1616 浏览 1 评论 0原文

我正在尝试让 Apache::ASP 在 OSX Lion Server 上运行。我在 Fusion 4 中全新安装了 OSX Lion VM,安装了 Xcode 应用程序(使用命令行工具),并运行以下 shell 命令:

sudo perl -MCPAN -e shell

cpan> install CPAN

cpan> install Bundle::Apache::ASP

我已添加到 httpd.confg 文件的末尾 (/Library/Server/ Web/Config/apache2/httpd_server_app.conf /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>

但是添加 set handler 或 perlhandler 都会导致 Apache 无法重新启动。将它们都取出来,Apache 就会启动,但会提供一个 .asp 文件作为文本文件......

更新 #1:

哎呀,二十或三十:

 sudo apachectl restart

我什至没有运行 mod perl。将以下内容添加到 httpd.conf 文件使 Apache 启动:

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} 现在将返回一个值,但是...

   %test = $Request->ServerVariables(); #or $Request->ServerVariables(URL);
   %><%= $test %><%

输出:Apache::ASP::Collection=HASH(0x7f84114c58d8)

UPDATE #2 :

Apache::ASP 与 IIS 上的一些 ServerVariables 未定义。语法与预期略有不同。下面将列出所有可用的服务器变量...

my $variables = $Request->{ServerVariables};
print join '<br>', sort keys %$variables;

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;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

屋檐 2024-12-26 11:49:24

解决方案已添加到问题中,但简短的答案是 mod perl 必须正在运行(并且默认情况下不会在 OS X Lion 上启动...

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...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文