Apache 阿帕奇>;设置服务器端包括>;OSX雪豹>;仍然不起作用

Apache 阿帕奇>;设置服务器端包括>;OSX雪豹>;仍然不起作用,apache,osx-snow-leopard,server-side-includes,Apache,Osx Snow Leopard,Server Side Includes,我已经研究了大约2个多小时,包括准备这份报告的1个多小时(考虑到我已经24小时没睡了,我一定是个慢工:-p) 虚拟服务器端包括Dreamweaver中的工作(图像渲染除外),但在浏览网页时不工作 我意识到我覆盖了太多的配置设置(如果有更简单、更优雅的方法,也许只是使用~/Sites/mysite.com/中的.htaccess文件,那么请也发表评论);-) 从顶部开始(1)sudo nano/etc/apache2/httpd.conf # # Filters allow you to pro

我已经研究了大约2个多小时,包括准备这份报告的1个多小时(考虑到我已经24小时没睡了,我一定是个慢工:-p)

虚拟服务器端包括Dreamweaver中的工作(图像渲染除外),但在浏览网页时不工作

我意识到我覆盖了太多的配置设置(如果有更简单、更优雅的方法,也许只是使用
~/Sites/mysite.com/
中的
.htaccess
文件,那么请也发表评论);-)

从顶部开始(1)
sudo nano/etc/apache2/httpd.conf

#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
<VirtualHost *:80>
  <Directory /Users/tidy/Sites/mysite.com>
    Options +FollowSymlinks +SymLinksIfOwnerMatch +Includes
    DirectoryIndex index.htm
    AllowOverride All
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
  </Directory>
  DocumentRoot /Users/tidy/Sites/mysite.com
  ServerName mysite.local
  ErrorLog "/Users/tidy/Sites/mysite.com/log/error_log"
  CustomLog "/Users/tidy/Sites/mysite.com/log/access_log" common
</VirtualHost>
<Directory "/Users/tidy/Sites/">
  Options +Indexes +MultiViews +FollowSymlinks +SymLinksIfOwnerMatch +Includes
  AllowOverride All
  Order allow,deny
  Allow from all
  AddType text/html .shtml
  AddOutputFilter INCLUDES .shtml
</Directory>
(2)
sudo nano/etc/apache2/extra/httpd vhosts.conf

#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
<VirtualHost *:80>
  <Directory /Users/tidy/Sites/mysite.com>
    Options +FollowSymlinks +SymLinksIfOwnerMatch +Includes
    DirectoryIndex index.htm
    AllowOverride All
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
  </Directory>
  DocumentRoot /Users/tidy/Sites/mysite.com
  ServerName mysite.local
  ErrorLog "/Users/tidy/Sites/mysite.com/log/error_log"
  CustomLog "/Users/tidy/Sites/mysite.com/log/access_log" common
</VirtualHost>
<Directory "/Users/tidy/Sites/">
  Options +Indexes +MultiViews +FollowSymlinks +SymLinksIfOwnerMatch +Includes
  AllowOverride All
  Order allow,deny
  Allow from all
  AddType text/html .shtml
  AddOutputFilter INCLUDES .shtml
</Directory>
(4)
sudo nano~/Sites/mysite.com/.htaccess

AddType text/html .shtml
AddHandler server-parsed .shtml
DirectoryIndex index.html index.htm
Options +Includes
XBitHack on
我还尝试使用
XBitHack on
,方法是执行
chmod+x~/Sites/mysite.com/partialHtml/businessResult.html
,然后包括该文件(显然,如果您不想使用
.shtml
文件,它会使
.html
文件服务器端包括高效的文件)

显然,我正在做一个
sudoapachectl配置测试来确保一切正常

我得到了一个警告(我已经试着去掉了),但是语法还可以

httpd: Could not reliably determine the server's fully qualified domain name, using complexity.local for ServerName
Syntax OK
然后一个
sudo apachectl重启

这是我最近在
cat~/Sites/mysite.com/log/access\u log

::1 - - [08/Jan/2013:12:11:05 +0000] "OPTIONS * HTTP/1.0" 200 -
::1 - - [08/Jan/2013:12:11:07 +0000] "OPTIONS * HTTP/1.0" 200 -
::1 - - [08/Jan/2013:12:11:08 +0000] "OPTIONS * HTTP/1.0" 200 -
::1 - - [08/Jan/2013:12:11:15 +0000] "OPTIONS * HTTP/1.0" 200 -
::1 - - [08/Jan/2013:12:11:16 +0000] "OPTIONS * HTTP/1.0" 200 -
::1 - - [08/Jan/2013:12:11:17 +0000] "OPTIONS * HTTP/1.0" 200 -
127.0.0.1 - - [08/Jan/2013:12:12:03 +0000] "GET / HTTP/1.1" 200 3924
127.0.0.1 - - [08/Jan/2013:12:12:03 +0000] "GET /css/site.css HTTP/1.1" 200 3077
127.0.0.1 - - [08/Jan/2013:12:12:03 +0000] "GET /css/bootstrap.css HTTP/1.1" 200 124223
127.0.0.1 - - [08/Jan/2013:12:12:03 +0000] "GET /img/logo.png HTTP/1.1" 200 19217
127.0.0.1 - - [08/Jan/2013:12:12:04 +0000] "GET /img/searchFormGradient.gif HTTP/1.1" 200 501
127.0.0.1 - - [08/Jan/2013:12:12:04 +0000] "GET /img/glyphicons-halflings-white.png HTTP/1.1" 200 8777
127.0.0.1 - - [08/Jan/2013:12:12:04 +0000] "GET /img/headerGradient.png HTTP/1.1" 200 216
127.0.0.1 - - [08/Jan/2013:12:12:04 +0000] "GET /js/bootstrap.min.js HTTP/1.1" 200 31596
::1 - - [08/Jan/2013:12:12:14 +0000] "OPTIONS * HTTP/1.0" 200 -
127.0.0.1 - - [08/Jan/2013:12:12:18 +0000] "GET / HTTP/1.1" 304 -
127.0.0.1 - - [08/Jan/2013:12:12:18 +0000] "GET /css/bootstrap.css HTTP/1.1" 304 -
127.0.0.1 - - [08/Jan/2013:12:12:18 +0000] "GET /js/bootstrap.min.js HTTP/1.1" 304 -
127.0.0.1 - - [08/Jan/2013:12:12:18 +0000] "GET /img/logo.png HTTP/1.1" 304 -
127.0.0.1 - - [08/Jan/2013:12:12:18 +0000] "GET /css/site.css HTTP/1.1" 304 -
127.0.0.1 - - [08/Jan/2013:12:12:18 +0000] "GET /img/headerGradient.png HTTP/1.1" 304 -
127.0.0.1 - - [08/Jan/2013:12:12:18 +0000] "GET /img/glyphicons-halflings-white.png HTTP/1.1" 304 -
127.0.0.1 - - [08/Jan/2013:12:12:18 +0000] "GET /img/searchFormGradient.gif HTTP/1.1" 304 -
[Tue Jan 08 11:24:49 2013] [error] [client 127.0.0.1] File does not exist: /Users/tidy/Sites/mysite.com/favicon.ico
HTTP/1.1 304
代码是
HTTP错误304-未修改
,这不是一个错误,它是从服务器到浏览器的一个信号,表明自上次请求以来当前内容没有更改

GET
请求中可以看到,没有
/partialHtml/businessResult.shtml

这是我最近在
cat~/Sites/mysite.com/log/error\u log

::1 - - [08/Jan/2013:12:11:05 +0000] "OPTIONS * HTTP/1.0" 200 -
::1 - - [08/Jan/2013:12:11:07 +0000] "OPTIONS * HTTP/1.0" 200 -
::1 - - [08/Jan/2013:12:11:08 +0000] "OPTIONS * HTTP/1.0" 200 -
::1 - - [08/Jan/2013:12:11:15 +0000] "OPTIONS * HTTP/1.0" 200 -
::1 - - [08/Jan/2013:12:11:16 +0000] "OPTIONS * HTTP/1.0" 200 -
::1 - - [08/Jan/2013:12:11:17 +0000] "OPTIONS * HTTP/1.0" 200 -
127.0.0.1 - - [08/Jan/2013:12:12:03 +0000] "GET / HTTP/1.1" 200 3924
127.0.0.1 - - [08/Jan/2013:12:12:03 +0000] "GET /css/site.css HTTP/1.1" 200 3077
127.0.0.1 - - [08/Jan/2013:12:12:03 +0000] "GET /css/bootstrap.css HTTP/1.1" 200 124223
127.0.0.1 - - [08/Jan/2013:12:12:03 +0000] "GET /img/logo.png HTTP/1.1" 200 19217
127.0.0.1 - - [08/Jan/2013:12:12:04 +0000] "GET /img/searchFormGradient.gif HTTP/1.1" 200 501
127.0.0.1 - - [08/Jan/2013:12:12:04 +0000] "GET /img/glyphicons-halflings-white.png HTTP/1.1" 200 8777
127.0.0.1 - - [08/Jan/2013:12:12:04 +0000] "GET /img/headerGradient.png HTTP/1.1" 200 216
127.0.0.1 - - [08/Jan/2013:12:12:04 +0000] "GET /js/bootstrap.min.js HTTP/1.1" 200 31596
::1 - - [08/Jan/2013:12:12:14 +0000] "OPTIONS * HTTP/1.0" 200 -
127.0.0.1 - - [08/Jan/2013:12:12:18 +0000] "GET / HTTP/1.1" 304 -
127.0.0.1 - - [08/Jan/2013:12:12:18 +0000] "GET /css/bootstrap.css HTTP/1.1" 304 -
127.0.0.1 - - [08/Jan/2013:12:12:18 +0000] "GET /js/bootstrap.min.js HTTP/1.1" 304 -
127.0.0.1 - - [08/Jan/2013:12:12:18 +0000] "GET /img/logo.png HTTP/1.1" 304 -
127.0.0.1 - - [08/Jan/2013:12:12:18 +0000] "GET /css/site.css HTTP/1.1" 304 -
127.0.0.1 - - [08/Jan/2013:12:12:18 +0000] "GET /img/headerGradient.png HTTP/1.1" 304 -
127.0.0.1 - - [08/Jan/2013:12:12:18 +0000] "GET /img/glyphicons-halflings-white.png HTTP/1.1" 304 -
127.0.0.1 - - [08/Jan/2013:12:12:18 +0000] "GET /img/searchFormGradient.gif HTTP/1.1" 304 -
[Tue Jan 08 11:24:49 2013] [error] [client 127.0.0.1] File does not exist: /Users/tidy/Sites/mysite.com/favicon.ico
在这一切之后。。。服务器端包含机制不工作:-(

非常感谢您的帮助


整洁。

我想我有办法解决我的问题

Windows 7上的服务器端包含也有同样的问题,因为我错误地认为只有包含的文件必须有
.shtml
扩展名

因为这一行:

在一个名为:
index.html

服务器端包含模块未预处理该文件

在我将
index.html
更改为
index.shtml
之后,服务器端正确地包含了模块 预处理一切

TL;DR-包含服务器端包含的文件必须具有.shtml扩展名