Options Indexes FollowSymLinks MultiViews Includes
这是要求Apache在htdocs子目录里执行 server-side includes 程序。为了让这些修改生效,我们必须重新启动服务器。在 Unix 下重新激活,执行"kill -HUP `cat /usr/local/apache/logs/httpd.pid`"。在 Windows 下,执行"Apache-k restart"。现在我们来试试刚才的设定结果。在/usr/local/apache/htdocs 目录里新增一个文件 test.shtml。这个文件必须要包含以下程序代码:
<!--#include virtual="hello.txt" -->; The file hello.txt is <!--#fsize virtual="hello.txt"-->; long and it was last modified on <!--#flastmod virtual="hello.txt" -->;
这行指令是告诉Apache如果要求的网页路径是以cgi-bin为起始,这些文件可在/usr/local/apache/cgi-bin/ 目录下找得到。这行指令同时也告诉Apache要在这个目录下执行文件。在下面我准备了一个会输出"How are you!"的简单CGI程序。我将它命名为 how.sh。
#!/bin/sh
echo "Content-type: text/html"
echo
echo "How are you!"