14.SSIが動かない!!(2001/10/17)


本格移転を前にして、以前のページのデータを持ってきて、ちょろっと更新しつつ本公開を目指して頑張ってるわけだけど。
オレのトップページのLast updatedやWhat's new?のとこの更新年月日ってCGIで動かしとるわけ。
で、HTML文書内にコメントみたいな形で埋め込んでるわけだけど、チェックしたところ、うまく表示されへん。
オレさぁ、Apacheの設定そのまんま(デフォルト)でSSI有効になっとるもんだと思っててさぁ。
「んだよぉ、有効じゃねぇのかよ!」と夜中に叫んだわけで。
しゃーないので、 /etc/httpd/conf/httpd.conf をいじりましょか。

〜/etc/httpd/conf/httpd.conf〜
AddType text/x-server-parsed-html .shtml .html
Options Includes

これだけ追加してやれば、.htmlファイルでもSSI使えるわけ。 で、再起動してみるも…、使えへん。(涙) 頭きたので、さらに詳しく追加したる。 〜/etc/httpd/conf/httpd.conf〜
Options FollowSymLinks ExecCGI Includes
AddType text/x-server-parsed-html .html
AddType text/x-server-parsed-html .htm
AddType application/x-httpd-cgi .cgi
AddType application/x-httpd-cgi .pl
AddType text/x-server-parsed-html .shtml

でも、ダメ。(涙) あー、もういいですぅ〜。(半ギレ) ここでAddTypeしてやらんわ、ってことで、.htaccessでAddTypeやOptionsの指定をしてやることに。 っつうわけで、 〜/etc/httpd/conf/httpd.conf〜
<Directory /home/httpd/html>
    Options +ExecCGI -Indexes -FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

という具合に、AllowOverrideをAllにして.htaccessを使えるようにし、.htaccessファイルを /home/httpd/html に置いた。 〜/home/httpd/html/.htaccess〜
Options FollowSymLinks ExecCGI Includes
AddType text/x-server-parsed-html .html
AddType text/x-server-parsed-html .htm
AddType application/x-httpd-cgi .cgi
AddType application/x-httpd-cgi .pl
AddType text/x-server-parsed-html .shtml

これで、SSI使えるようになったけど…。 何か、納得いかんなぁ。(プンプン)

管理人の戯言トップ | ホームに戻る |

webmaster@ashiyu.net