1

我想编写一个简单的 mod_perl 处理程序,它返回本地时间,如本页所述(http://perl.apache.org/docs/2.0/user/handlers/intro.html),但是我在哪里可以找到这个文件访问它。

我使用的是 Ubuntu,但没有名为 MyApache2 的目录。那么在哪里可以找到这个文件来尝试这个功能呢?

4

1 回答 1

2

这只是一个例子。您需要自己创建文件。(您会看到您的示例是指“file:MyApache2/CurrentTime.pm”)。

mkdir -p example-lib/MyApache2
touch example-lib/MyApache2/CurrentTime.pm

然后将示例中的内容粘贴到您刚刚创建的文件中。

为了让它在 mod_perl 下运行,您还必须让服务器知道您的 MyApache2 所在的位置。您应该能够将类似这样的内容添加到您的 Apache 配置中:

PerlSwitches -I/path/to/example-lib

在测试之前不要忘记重新启动 Apache。

于 2013-07-31T19:05:38.910 回答