禁止:在Mac OS X上使用Apache和Perl进行CGI编程 [英] Forbidden: CGI Programming With Apache and Perl on Mac OS X

查看:55
本文介绍了禁止:在Mac OS X上使用Apache和Perl进行CGI编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Max OS X 10.8.5中使用Apache和Perl进行CGI编程.我遵循了指南:在Mac OS X上使用Apache和Perl进行CGI编程.这些步骤是:

I'd like to do the CGI programming with Apache and Perl in Max OS X 10.8.5. I followed the guide : CGI Programming With Apache and Perl on Mac OS X. The steps are:

  1. 编辑/etc/apache2/httpd.conf,取消注释以下内容:


    AddHandler cgi-script .cgi  .pl

    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml

  1. 编辑/etc/apache2/userName.conf:



Options MultiViews Indexes SymLinksIfOwnerMatch Includes ExecCGI
DirectoryIndex index.html index.cgi
AllowOverride None
Order allow,deny
Allow from all

  1. 启动apache:


sudo apachectl restart

  1. 将cgi文件放入文件夹:〜/Sites.我已经更新了test.cgi的特权:


sudo chmod 755 test.cgi

这就是我所做的.但是,当我访问时: ht tp://localhost/~userName/test.cgi ,结果:

That's all I have done. However, when I visit : ht tp://localhost/~userName/test.cgi, the result:


Forbidden

You don't have permission to access /~username/test.cgi on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

我尝试将html放入〜/Sites,它可以正确显示.似乎cgi配置有问题,但是我找不到它.谁能提供一些指南?

I try to put a html into the ~/Sites, and it can be shown correctly. It seems there is something wrong with the cgi configurations, but I can't find it. Could anyone give some guides?

谢谢!

推荐答案

CGI中的步骤在Mac OS X上使用Apache和Perl编程是正确的.如果重新启动apache不起作用,请重新启动mac!现在我可以使用cgi了!

The steps in CGI Programming With Apache and Perl on Mac OS X are correct. If restarting apache does not work, restart the mac! And Now I can use the cgi!

这篇关于禁止:在Mac OS X上使用Apache和Perl进行CGI编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆