メイソンを使用している間、私は本当に奇妙な振る舞いをします、例えば:
私はindex.html
ファイルを持っています(のような石工タグが含まれています<% $var %> hello
)。
参照しているときhttp://bla.com/index.html
、変数はコンパイル中に変換されます。
しかし、を参照しているときに奇妙な動作がありますhttp://bla.com/index
。
index
(のみ)と呼ばれるファイルはありませんがindex.html
、それでもロードindex.html
され、コード全体が<% ... %>
!!!を含むプレーン/テキストとして表示されます。
何を間違って設定しましたか?
これは私のApache構成です:
<VirtualHost *:80>
ServerAdmin webmaster@abc.com
ServerAlias abc.com www.abc.com
ServerName abc.com
DocumentRoot /var/www/abc.com
DirectoryIndex index.html
<Directory "/var/www/abc.com/">
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
SetHandler perl-script
PerlModule HTML::Mason::ApacheHandler
PerlSetVar MasonUseObjectFiles 1
<LocationMatch "(\.html|\.txt|\.pl|\.js)$">
SetHandler perl-script
PerlHandler HTML::Mason::ApacheHandler
</LocationMatch>
<LocationMatch "(\.m(html|txt|pl)|dhandler|autohandler)$">
SetHandler perl-script
PerlHandler Apache::Constants::NOT_FOUND
</LocationMatch>