我已经在 ubuntu 中安装了 apache webserver 并example.pl
在 中创建了/usr/lib/cgi-bin
。
我还将以下代码添加到/etc/apache2/sites-enabled/000-default.conf
文件中
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
从/usr/lib/cgi-bin
我执行时./example.pl
我得到输出,但是当我尝试使用从浏览器加载 perl 脚本时localhost/cgi-bin/example.pl
,我收到此错误:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80
请帮助我解决这个问题,我知道这很简单,但我不知道该怎么做才能解决它