我已經研究了約2個小時以上,包括1個小時的準備這份報告(我必須是一個慢速的工人,考慮到我沒有睡過24小時:-P)Apache>設置服務器端包括> OSX Snow Leopard>仍然不工作
虛擬服務器端包含Dreamweaver中的作品(圖像呈現除外),但在瀏覽到網頁時不起作用。
<!--#include virtual="/partialHtml/businessResult.shtml" -->
我意識到,我已經覆蓋了太多的配置設置(如果有一個更簡單,更優雅的方式,或許只是使用.htaccess
文件~/Sites/mysite.com/
那麼也請您評論);-)
從頂部(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
(2)sudo nano /etc/apache2/extra/httpd-vhosts.conf
<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>
(3)sudo nano /private/etc/apache2/users/tidy.conf
<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
我還試圖通過執行chmod +x ~/Sites/mysite.com/partialHtml/businessResult.html
然後包括文件以使用XBitHack on
(顯然它使.html
文件服務器側包括高效的,如果你不想使用.shtml
文件)
顯然,我在做一個sudo apachectl configtest
以確保一切正常。
我得到一個警告(我試圖擺脫),但語法是確定的。
httpd: Could not reliably determine the server's fully qualified domain name, using complexity.local for ServerName
Syntax OK
然後,sudo apachectl restart
這是我最近在cat ~/Sites/mysite.com/log/access_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 -
活動的HTTP/1.1 304
代碼爲HTTP Error 304 - Not modified
這是不是一個錯誤,這是從服務器到瀏覽器的信號,自上次請求以來,當前內容並未發生變化。
你可以從GET
要求看,有沒有/partialHtml/businessResult.shtml
這是我最近在cat ~/Sites/mysite.com/log/error_log
[Tue Jan 08 11:24:49 2013] [error] [client 127.0.0.1] File does not exist: /Users/tidy/Sites/mysite.com/favicon.ico
而且畢竟這些活動跡象...服務器端包含機制不能正常工作:-(
任何協助,不勝感激
整齊。