2017-06-14 2 views
0

LinuxおよびApacheでLaravel 5.4を実行しています。次のエラーが突然私たちの.htaccessファイルへの変更なしで/var/log/httpd/error_logに現れてされています:コマンド 'text/css'が正しくありません。サーバー設定に含まれていないモジュールでスペルが間違っているか、または定義されています

/var/www/html/public/.htaccess: Invalid command 'text/css', perhaps misspelled or defined by a module not included in the server configuration 

全体.htaccessファイルには、次のようになります。

<IfModule mod_expires.c> 

    ExpiresActive on 
    ExpiresDefault          "access plus 1 month" 

    # CSS 
    ExpiresByType text/css        "access plus 1 year" 

    # Data interchange 
    ExpiresByType application/json      "access plus 0 seconds" 
    ExpiresByType application/xml      "access plus 0 seconds" 
    ExpiresByType text/xml        "access plus 0 seconds" 

    # Favicon (cannot be renamed!) 
    ExpiresByType image/x-icon       "access plus 1 week" 

    # HTML components (HTCs) 
    ExpiresByType text/x-component      "access plus 1 month" 

    # HTML 
    ExpiresByType text/html        "access plus 0 seconds" 

    # JavaScript 
    ExpiresByType application/javascript    "access plus 1 year" 
    ExpiresByType application/x-javascript    "access plus 1 year" 

    # Manifest files 
    ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds" 
    ExpiresByType text/cache-manifest     "access plus 0 seconds" 

    # Media 
    ExpiresByType audio/ogg        "access plus 1 month" 
    ExpiresByType image/gif        "access plus 1 month" 
    ExpiresByType image/jpeg       "access plus 1 month" 
    ExpiresByType image/png        "access plus 1 month" 
    ExpiresByType video/mp4        "access plus 1 month" 
    ExpiresByType video/ogg        "access plus 1 month" 
    ExpiresByType video/webm       "access plus 1 month" 

    # Web feeds 
    ExpiresByType application/atom+xml     "access plus 1 hour" 
    ExpiresByType application/rss+xml     "access plus 1 hour" 

    # Web fonts 
    ExpiresByType application/font-woff2    "access plus 1 month" 
    ExpiresByType application/font-woff     "access plus 1 month" 
    ExpiresByType application/vnd.ms-fontobject   "access plus 1 month" 
    ExpiresByType application/x-font-ttf    "access plus 1 month" 
    ExpiresByType font/opentype       "access plus 1 month" 
    ExpiresByType image/svg+xml       "access plus 1 month" 

</IfModule> 

<IfModule mod_rewrite.c> 

    <IfModule mod_negotiation.c> 
     Options -MultiViews 
    </IfModule> 

    RewriteEngine On 

    # Redirect Trailing Slashes If Not A Folder... 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)/$ /$1 [L,R=301] 

    # Force traffic through https 
    # RewriteCond %{HTTPS} on 

    # Redirect non-www urls to www 
    # Force through www for SSL certificate coverage (except IP) 
    RewriteCond %{HTTP_HOST} !^[0-9]+\. 
    RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ 
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301] 

    # Handle Front Controller... 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteRule^index.php [L] 

    # Handle Authorization Header 
    RewriteCond %{HTTP:Authorization} . 
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 

    # End of Apache Rewrite Rules 

</IfModule> 

# BEGIN Compression 
<IfModule mod_filter.c> 

    AddOutputFilterByType DEFLATE application/atom+xml 
    AddOutputFilterByType DEFLATE application/javascript 
    AddOutputFilterByType DEFLATE application/json 
    AddOutputFilterByType DEFLATE application/ld+json 
    AddOutputFilterByType DEFLATE application/manifest+json 
    AddOutputFilterByType DEFLATE application/rdf+xml 
    AddOutputFilterByType DEFLATE application/rss+xml 
    AddOutputFilterByType DEFLATE application/schema+json 
    AddOutputFilterByType DEFLATE application/vnd.geo+json 
    AddOutputFilterByType DEFLATE application/vnd.ms-fontobject 
    AddOutputFilterByType DEFLATE application/x-font-ttf 
    AddOutputFilterByType DEFLATE application/x-javascript 
    AddOutputFilterByType DEFLATE application/x-web-app-manifest+json 
    AddOutputFilterByType DEFLATE application/xhtml+xml 
    AddOutputFilterByType DEFLATE application/xml 
    AddOutputFilterByType DEFLATE font/eot 
    AddOutputFilterByType DEFLATE font/opentype 
    AddOutputFilterByType DEFLATE image/bmp 
    AddOutputFilterByType DEFLATE image/svg+xml 
    AddOutputFilterByType DEFLATE image/vnd.microsoft.icon 
    AddOutputFilterByType DEFLATE image/x-icon 
    AddOutputFilterByType DEFLATE text/cache-manifest 
    AddOutputFilterByType DEFLATE text/css 
    AddOutputFilterByType DEFLATE text/html 
    AddOutputFilterByType DEFLATE text/javascript 
    AddOutputFilterByType DEFLATE text/plain 
    AddOutputFilterByType DEFLATE text/vcard 
    AddOutputFilterByType DEFLATE text/vnd.rim.location.xloc 
    AddOutputFilterByType DEFLATE text/vtt 
    AddOutputFilterByType DEFLATE text/x-component 
    AddOutputFilterByType DEFLATE text/x-cross-domain-policy 
    AddOutputFilterByType DEFLATE text/xml 

</IfModule> 
# END of Compression 
+0

このエラーをアクセスログのリクエストと照合できますか? CSSファイルのリクエストごとにこのエラーが発生していますか? '.htaccess'ファイルがこのエラーを生成していた場合は、500(Internal Server Error)の応答が表示されます。 FWIWの '.htaccess'ファイルは"見た目 "です。 (何か奇妙な隠し文字?) – MrWhite

+0

@ user82217私は 'access_log'で500エラー応答でタイムスタンプと一致するリクエストを見つけることができました。単一のURIから来ているようです(要求はすべて昨日500のエラーを持っています)が、ページにアクセスしたにもかかわらずトリガーされていません。それが戻ってきた場合に備えて、私たちはそれを見守っていきます。 – Taylor

答えて

0

我々は内マッチング要求を見つけることができました

[14/Jun/2017:09:11:05 -0500] "GET /register HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36" 

このエラーが発生していない:「無効なコマンド」のエラーのそれぞれについて、/var/log/httpd/access_log昨日の朝から、ページがアクセスされた後であっても。元の質問を投稿した直後に、キャッシュをクリアしてすべてのセッションを削除し、サーバーを再起動しました。

-1

新しい開発環境をセットアップしているうちに、このエラーも発生しました。私が見つけたすべてを試した後、私は最終的にフィルタブロックに余りにも多くの行があることを示す記事を見つけました。記事から:

症状

Webサイトには、500種類のエラーを示す開くことができません。

[コア::警報] /var/www/vhosts/example.com/httpdocs /var/www/vhosts/example.com/logs/error_logファイルに次のようなレコードがあり

/.htaccess:.htaccessファイルでAddOutputFilterByTypeディレクティブ式の無効なコマンドは「text/cssの」、おそらくモジュールによってスペルミスまたは定義されたサーバ構成に含まれていない

原因

長すぎる宣言。

追加情報については、次のリソースを参照してください:それはのようになりますので、セクションを変更し

https://github.com/ezekg/theme-juice-vm/issues/4 http://mail.blueonyx.it/pipermail/blueonyx/2010-April/004320.html

解像度

<IfModule mod_filter.c> 
AddOutputFilterByType DEFLATE "application/atom+xml" "application/javascript" "application/json" "application/ld+json" "application/manifest+json" "application/rdf+xml" "application/rss+xml" "application/schema+json" "application/vnd.geo+json" "application/vnd.ms-fontobject" "application/x-font-ttf" "application/x-javascript" "application/x-web-app-manifest+json" "application/xhtml+xml" "application/xml" "font/eot" "font/opentype" "image/bmp" "image/svg+xml" "image/vnd.microsoft.icon" "image/x-icon" "text/cache-manifest" "text/css" "text/html" "text/javascript" "text/plain" "text/vcard" "text/vnd.rim.location.xloc" "text/vtt" "text/x-component" "text/x-cross-domain-policy" "text/xml" 
</IfModule> 

それは、私の場合に働いた。

関連する問題

 関連する問題