Vagrantでcssファイルが反映されないとき

Vagrantでstyle.cssが反映されないときの対処メモ。

■環境
・Vagrant
・CentOS 6.7
・Apache 2.2.15

■1. httpd.conf 確認

/etc/httpd/conf/httpd.conf#
# EnableSendfile: Control whether the sendfile kernel support is
# used to deliver files (assuming that the OS supports it).
# The default is on; turn this off if you serve from NFS-mounted
# filesystems.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile
#
#EnableSendfile off

EnableSendfile ディレクティブ

このディレクティブはクライアントにファイルの内容を送るときに httpd がカーネルの sendfile サポートを使うかどうかを制御します。デフォルトでは、 例えば静的なファイルの配送のように、リクエストの処理にファイルの 途中のデータのアクセスを必要としないときには、Apache は OS が サポートしていればファイルを読み込むことなく sendfile を使って ファイルの内容を送ります。

https://httpd.apache.org/docs/2.2/ja/mod/core.html#enablesendfile

というわけで、offにします。→コメントを外します。

/etc/httpd/conf/httpd.conf 変更後EnableSendfile off

■2. httpd再起動

で、反映します。以上!

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です