#問題点
サーバーのhtmlファイルにwebブラウザからアクセスしましたが、
ブラウザ内で開けずダウンロードする動作になっていて困っています。
#経緯
VPSサーバーに自分で設置したapacheで
今までphpの動作は問題なかったのですが、
初めてhtmlファイルを置いたところ
webブラウザ内で開けずダウンロードする流れになり、
httpヘッダーを調べるとなぜか
「Content-Type: text/html」
ではなく
「Content-Type: text/x-server-parsed-html」
になってしまっていてこのせいではないかと。
なにかhttpd.confの記述でミスしているのではないかと思うのですが、
特別無効化した覚えがなく困っております。
どう対策したらよいかアドバイスを頂きたいです。
#設定情報など
関係ありそうなhttpd.confからの抜粋
<Directory "/var/www/html"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> <Files ".ht*"> Require all denied </Files> <IfModule mime_module> TypesConfig /etc/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType text/html .shtml AddOutputFilter INCLUDES .shtml </IfModule> AddDefaultCharset UTF-8 <IfModule mime_magic_module> MIMEMagicFile conf/magic </IfModule> EnableSendfile on IncludeOptional conf.d/*.conf ServerTokens Prod KeepAlive On MaxKeepAliveRequests 80 KeepAliveTimeout 120 LimitRequestLine 65535 LimitRequestFieldSize 20000
/etc/mime.typesは改変していませんから、ちゃんとtext/html html htmって定義がありました。
SELinux絡みかと思って、作りたてのetcディレクトリやファイルにはchconで他のwebコンテンツと同じタイプを指定しました。
「<Directory "/var/www/html">」はあるけど「<Directory "/var/www/html/etc">」はまだ定義していないです。親ディレクトリをそのまま継承するなら不要じゃないかと思ってますが。
#環境
CentOS Linux release 7.4.1708 (Core)
Server version: Apache/2.4.6 (CentOS)
SELinux: Permissive
回答2件
あなたの回答
tips
プレビュー