如何配置 MAMP 来提供 perl CGI 脚本(不是本地主机!)
我正在使用 MAMP-pro 向外界提供我的域服务。
我不是一个非常有经验的系统管理员,尽管我已经努力完成了一些基本的事情。我知道 apache 是什么,并且我可以读取大部分但不能生成无指南相关的 .conf 文件。
我有一个 perl 脚本,我已经从命令行对其进行了测试,并且它可以工作(根据需要输出。)
当我尝试从浏览器访问所述脚本时,我得到 404。
我尝试将脚本放置在:
- /用户/me/Sites/mydomain.com/htdocs/mycgi.pl
- /Users/me/Sites/mydomain.com/cgi-bin/mycgi.pl
- /Users/me/Sites/mydomain.com/htdocs/cgi-bin/ mycgi.pl
并访问它:
和所有各种组合,都无济于事(404。)
脚本及其容器目录的权限为 755。
那么,我还缺少哪些其他步骤?有没有好的设置指南?我尝试了MAMP-Pro手册,但它充满了诸如“取消按钮取消当前操作”之类的信息,并且没有任何有用的信息。谷歌找到了一些热门内容,似乎都在讨论如何在本地主机上进行这项工作,但我正在尝试将其提供给外界。
有什么提示吗?
谢谢!
I'm using MAMP-pro to serve my domain to the outside world.
I'm not a very experienced sys-admin, though I've slogged my way through a few basic things. I know what apache is, and I can read-most-of but not generate-without-guide related .conf files.
I've got a perl script which I've tested from the command line and it works (outputs as desired.)
When I try to access said script from the browser, I get 404.
I've tried placing the script at:
- /Users/me/Sites/mydomain.com/htdocs/mycgi.pl
- /Users/me/Sites/mydomain.com/cgi-bin/mycgi.pl
- /Users/me/Sites/mydomain.com/htdocs/cgi-bin/mycgi.pl
and accessing it as:
and all the various combinations, all to no avail (404.)
The script and its container directory have permissions 755.
So, what other steps am I missing? Are there any good set-up guides? I tried the MAMP-Pro manual, but it is filled with such information as "the cancel button cancels the current operation" and not really anything useful. Google turned up several hits that all seem to talk about how to make this work on localhost, but I'm trying to serve this to the outside world.
Any hints?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
官方在线文档中有一个关于虚拟主机的部分。为
www.mydomain.com
创建主机时,您可以选择 MAMP PRO 中称为“磁盘位置”的 DocumentRoot。如果您仍然收到 404 错误,请查看error_log
以了解更具体的原因(即 Apache 尝试 查找有问题的文件的位置)。The official online documentation has a section on virtual hosts. When creating a host for
www.mydomain.com
you can choose the DocumentRoot which is called "Disk location" within MAMP PRO. If you still get a 404 error, take a look into theerror_log
for a more specific reason (i.e., where Apache tries to find the file in question).