# If you want to use server side includes, or CGI outside # ScriptAliased directories, uncomment the following lines. #AddType text/x-server-parsed-html .shtml #AddType application/x-httpd-CGI .CGI 注意, 高版本的Apache可能是这几行: # # To use server-parsed HTML files # #AddType text/html .shtml #AddHandler server-parsed .shtml |
# This should be changed to whatever you set DocumentRoot to. <Directory /usr/local/etc/httpd/htdocs> # This may also be "None", "All", or any combination of "Indexes", # "Includes", or "FollowSymLinks" Options Indexes FollowSymLinks </Directory> 将其中的Options Indexes FollowSymLinks改为: Options Indexes FollowSymLinks Includes |
Options Indexes FollowSymLinks Includes AddType application/x-httpd-CGI .CGI AddType text/x-server-parsed-html .shtml |
AddType text/x-server-parsed-html .html |
<!--#directive parameter="value"--> |
指令名称
|
参数列表
|
Config | errmsg, timefmt, sizefmt |
include | virtual, file |
echo | var |
fsize | file |
flastmod | file |
exec | cmd, cgi |
<!--#config errmsg="Error! Please email webmaster@mydomain.com --> |
<!--#config timefmt="%A, %B %d, %Y"--> <!--#echo var="LAST_MODIFIED" --> |
Wednesday, April 12, 2000 |
<!--#config sizefmt="bytes" --> <!--#fsize file="index.html" --> |
<!--#include virtual="/includes/header.html" --> |
<!--#include file="header.html" --> |
<!--#echo var="DOCUMENT_NAME" --> |
<!--#echo var="DOCUMENT_URI" --> |
/YourDirectory/YourFilename.html |
http://YourDomain<!--#echo var="DOCUMENT_URI" --> |
<!--#echo var="QUERY_STRING_UNESCAPED" --> |
<!--#config timefmt="%A, the %d of %B, in the year %Y" --> <!--#echo var="DATE_LOCAL" --> |
Saturday, the 15 of April, in the year 2000 |
<!--#echo var="DATE_GMT" --> |
<!--#echo var="LAST_MODIFIED" --> |
SERVER_SOFTWARE:显示服务器软件的名称和版本。例如: <!--#echo var="SERVER_SOFTWARE" --> SERVER_NAME: 显示服务器的主机名称,DNS别名或IP地址。例如: <!--#echo var="SERVER_NAME" --> SERVER_PROTOCOL:显示客户端请求所使用的协议名称和版本,如HTTP/1.0。例如: <!--#echo var="SERVER_PROTOCOL" --> SERVER_PORT:显示服务器的响应端口。例如: <!--#echo var="SERVER_PORT" --> REQUEST_METHOD:显示客户端的文档请求方法,包括GET, HEAD, 和POST。例如: <!--#echo var="REQUEST_METHOD" --> REMOTE_HOST:显示发出请求信息的客户端主机名称。 <!--#echo var="REMOTE_HOST" --> REMOTE_ADDR:显示发出请求信息的客户端IP地址。 <!--#echo var="REMOTE_ADDR" --> AUTH_TYPE:显示用户身份的验证方法。 <!--#echo var="AUTH_TYPE" --> REMOTE_USER:显示访问受保护页面的用户所使用的帐号名称。 <!--#echo var="REMOTE_USER" --> |
<!--#fsize file="index_working.html" --> |
<!--#config timefmt="%A, the %d of %B, in the year %Y" --> <!--#flastmod file="file.html" --> |
<!--#config timefmt=" %B %d, %Y" --> <A HREF="/directory/file.html">File</A> <!--#flastmod virtual="/directory/file.html" --> <A HREF="/another_directory/another_file.html">Another File</A> <!--#flastmod virtual="/another_directory/another_file.html" --> 显示结果为: File April 19, 2000 Another File January 08, 2000 |
<!--#exec cgi="/cgi-bin/counter.pl" --> |