这是我的程序:
[root@localhost cgi-bin]# locate first.pl
/home/Ram/Desktop/work/first.pl
/usr/local/apache2/cgi-bin/first.pl
[root@localhost cgi-bin]# cd /usr/local/apache2/cgi-bin/
[root@localhost cgi-bin]# vi first.pl
#!/usr/bin/perl -w
use warnings;
use warnings;
use CGI;
print "content-type: text/html\n\n";
print "<h2>Hello, World!</h2>\n";
我是这样从浏览器中调用脚本的:
http:// localhost / usr / local / apache2 / cgi-bin / first.pl
我没有得到输出,但是我遇到了一个错误:
没有找到
在此服务器上未找到请求的URL“/usr/local/apache2/cgi-bin/first.pl”。
Apache/2.2.15(CentOS)服务器位于localhost端口80
我通过以下方式在Web浏览器中检查Apache Web服务器是否工作:
它显示了欢迎页面。
我该如何解决此错误?
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /www/docs/dummy-host.example.com
ServerName dummy-host.example.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost> ` - Ram