我试图做一个网站与index.cgi,如果可用,作为内容服务。 在/ etc / apache2 / sites-enabled / 000-default中,我有:
DirectoryIndex index.cgi index.html DocumentRoot /home/jonathan/mirror
DocumentRoot被赋予+ ExecCGI:
Options +ExecCGI Indexes FollowSymLinks MultiViews
当我访问本地主机时,它显示了index.cgi的来源:
#!/usr/bin/perl if ($ENV{"HTTP_HOST"} =~ /^www\./) { print "Status: 301 Moved Permanently\n"; print "Location: http://" . substr($ENV{"HTTP_HOST"}, 4) . "\n\n"; } if ($ENV{"HTTP_HOST"} =~ /^fan/ or $ENV{"HTTP_HOST"} =~ /jonathanscommunity/) { print "Status: 301 Moved Permanently\n"; print "Location: http://www.facebook.com/pages/CJS-Hayward/9506801167\n\n"; ...
我该怎么做才能执行/index.cgi并给出结果?