【发布时间】:2013-06-01 01:00:58
【问题描述】:
我已将 Apache 2.2 配置为与 Coldfusion 9.2 一起运行,两者都在同一个 Centos 6.2 上。 Apache DocumentRoot 的一般配置是
DocumentRoot "/var/www/html"
到目前为止,Apache 将所有对 cfcs 和 cfms 的调用都交给了 Coldfusion。然后我创建了一个虚拟主机
<VirtualHost 192.168.123.207:80>
ServerName myserver.server.private
ServerAlias www.myserver.server.private
ServerAlias webmail.myserver.server.private
ServerAlias admin.myserver.server.private
DocumentRoot /home/myserver/public_html
ErrorLog /var/log/virtualmin/myserver.server.private_error_log
CustomLog /var/log/virtualmin/myserver.server.private_access_log combined
ScriptAlias /cgi-bin/ /home/myserver/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/myserver/public_html>
Options +Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch
allow from all
AllowOverride All
Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>
<Directory /home/myserver/cgi-bin>
allow from all
AllowOverride All
Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.myserver.server.private
RewriteRule ^(.*) http://myserver.server.private:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.myserver.server.private
RewriteRule ^(.*) http://myserver.server.private:10000/ [R]
</VirtualHost>
当我在http://myserver.server.private/hello.html 上打开一个 html 文件时,虚拟主机文档根目录 (/home/myserver/public_html) 中的正确文件会被提供。
虽然调用 cfm 失败。 Apache 正确传递请求,但随后出现 Coldfusion 错误消息:
File not found: /hello.cfm
似乎 Coldfusion 正在获取文件名,为其添加了错误的目录路径前缀,并且无法从磁盘加载它。
我扫描了所有 Coldfusion 文件以查找错误的文档根目录,但找不到任何内容。
编辑
事实证明,Coldfusion 在它自己的 webroot 目录中查找
/opt/coldfusion/wwwroot
我在那里放置了一个名称相同但内容不同的文件,并且该文件得到了服务,尽管有 a) 虚拟主机 b) 通用 DocumentRoot 设置为 /var/www/html。
【问题讨论】:
-
我不熟悉你的设置,Apache 和 Centos,但即使在 JRun 和 Windows 上 ColdFusion 仍然会查看它自己的 webroot 目录并从该位置提供文件,即使存在同名文件在 Web 服务器上定义的 webroot。
标签: apache coldfusion virtualhost