プラグインiThemes Securityを更新したら500Internal Server Error
-
プラグインiThemes Securityを管理画面から更新したところ、
500Internal Server Errorとなり、ブラウザで表示されなくなってしまいました。管理画面にもログインできません。
wordpressのバージョンは、「更新」ボタンが出ていたので最新ではありません。
(現在のバージョンを確認していません)解決方法はありますでしょうか?
-
iThemes Securityは、旧Better WP Securityなのですが、
ftpからフォルダ名を変更したりしても、まったく管理画面に入れません。よろしくお願いいたします。
プラグインディレクトリを変更してもエラーのままということは、プラグインが.htaccessを書き換え、それがサーバーでは許可されていないか、Webサーバーのバージョンの差異による記述方式の違いによってエラーになっているのではないかと推測します。
私はこのプラグインを使ったことはないですが、アップロードディレクトリでphpの実行を禁止する機能では、.htaccessを書き換えているようです。
.htaccessに
# PHP Uitschakelen in Uploads - Beveiliging > Instellingen > Systeem Tweaks > Uploads RewriteRule ^wp\-content/uploads/.*\.(?:php[1-6]?|pht|phtml?)$ - [NC,F]
という行があれば、下のRewriteRuleもコメントアウトしてみてください。
# PHP Uitschakelen in Uploads - Beveiliging > Instellingen > Systeem Tweaks > Uploads # RewriteRule ^wp\-content/uploads/.*\.(?:php[1-6]?|pht|phtml?)$ - [NC,F]
また、サーバーのコントロールパネルなどでエラーログを参照できるのであれば、エラーの内容を確認してみてください。
お忙しいところありがとうございます。
該当箇所が見つかりませんでした。RewriteRuleで探すと、以下の3か所が見つかりました
# End Abuse HTTP Referrer Blocking RewriteRule ^.* - [F,L]
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Options +FollowSymLinks </IfModule> # END WordPress
また、
FTPからhttpd-error_logをダウンロードしてみました。
以下のような内容がたくさん書かれてありました。(00.000には実際のIPが書かれています)[Tue Jun 14 00:30:11 2016] [alert] [client 000.00.00.000] /usr/home/aa1342nofx/html/.htaccess: RewriteCond: cannot compile regular expression '^https?://(?:[^/]+\\.)?semalt\\.com'\n
続いて、.htaccessを見ると、
# BEGIN iThemes Security - Do not modify or remove this line # iThemes Security Config Details: 2 # Enable HackRepair.com's blacklist feature - Security > Settings > Banned Users > Default Blacklist # Start HackRepair.com Blacklist RewriteEngine on # Start Abuse Agent Blocking RewriteCond %{HTTP_USER_AGENT} "^Mozilla.*Indy" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "^Mozilla.*NEWT" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "^$" [NC,OR] 以下、続く
などがあり、他に、
<IfModule !mod_authz_core.c>
Order allow,deny~~ など書かれています。エラーメッセージによると、
^https?://(?:[^/]+\\.)?semalt\\.com’
が書かれている行がエラーなのではないでしょうか。
この行をコメントアウトしてはどうでしょうか。そして、該当行はBlock SemaltやSemalt Blockerなどのプラグインが書き込んだ記述と思いますので、そのようなプラグインを削除すれば良いと思います。
トライしてみました。
RewriteCond %{HTTP_REFERER} "^https?://(?:[^/]+\.)?semalt\.com" [NC,OR]
この1行が該当すると思い、#RewriteCond %{HTTP_REFERER} "^https?://(?:[^/]+\.)?semalt\.com" [NC,OR]
として再度UPしてみました。状況が変わりませんでした。
海外のフォーラムで同じような質問があがっているのですが、
https://wordpress.org/support/topic/plugin-better-wp-security-500-internal-server-error-for-wrong-htaccess?replies=4
https://wordpress.org/support/topic/better-wp-security-3410-update-500-internal-server-error?replies=17意訳しても具体的にどう作業を進めて良いかわかりません。
お手数おかけします・・。エラーログに出ていた箇所をコメントアウトされたので、出力されているエラーが変化していると思います。
.htaccessに変更を加えられてから出ているエラーを教えていただけますでしょうか。海外のものはどれも3年前の投稿ですので、あまり参考には・・・
ありがとうございます。
httpd-error_logというファイルには以下です
直前の3つを記載してあります[Tue Jun 14 20:11:23 2016] [alert] [client 000.00.00.000] /usr/home/aa1342nofx/html/.htaccess: RewriteCond: cannot compile regular expression '^https?://(?:[^/]+\\.)?kambasoft\\.com'\n [Tue Jun 14 20:11:49 2016] [alert] [client 000.00.00.000] /usr/home/aa1342nofx/html/.htaccess: RewriteCond: cannot compile regular expression '^https?://(?:[^/]+\\.)?kambasoft\\.com'\n [Tue Jun 14 20:11:50 2016] [alert] [client 000.00.00.000] /usr/home/aa1342nofx/html/.htaccess: RewriteCond: cannot compile regular expression '^https?://(?:[^/]+\\.)?kambasoft\\.com'\n
httpd-error_log.201606というファイルには以下です。
こちらには今日の時間での記録がありません。。[Mon Jun 13 23:40:01 2016] [alert] [client 000.00.00.0] /usr/home/aa1342nofx/html/.htaccess: RewriteCond: cannot compile regular expression '^https?://(?:[^/]+\\.)?semalt\\.com'\n [Mon Jun 13 23:41:04 2016] [alert] [client 000.00.00.0] /usr/home/aa1342nofx/html/.htaccess: RewriteCond: cannot compile regular expression '^https?://(?:[^/]+\\.)?semalt\\.com'\n [Mon Jun 13 23:50:23 2016] [alert] [client 00.000.00.000] /usr/home/aa1342nofx/html/.htaccess: RewriteCond: cannot compile regular expression '^https?://(?:[^/]+\\.)?semalt\\.com'\n
本当ですね。
また新しいkambasoft~というところがエラーということなのでしょうか。スパムコメントの出力元として弾くための記述でしょうか・・・
kambasoft~の箇所というか、似た記述は全てコメントアウトすると良いと思います。ありがとうございます。
この後、以下の記述がある箇所をコメントアウトしたところ、^https?://(?:[^/]+\\.)?kambasoft\\.com'\n
^https?://(?:[^/]+\\.)?savetubevideo\\.com'\n
変化があり
403Forbidden
You don’t have permission to access /wp-content/plugins/better-wp-security/ on this server.となりました。
エラーを見ると
[Tue Jun 14 19:21:20 2016] [error] [client 000.00.00.000] malformed header from script. Bad header=<br />: /usr/home/aa1342nofx/html/index.php
[Tue Jun 14 19:16:26 2016] [alert] [client 000.00.00.000]/usr/home/aa1342nofx/html/.htaccess: Invalid command '\xef\xbb\xbf#', perhaps mis-spelled or defined by a module not included in the server configuration
[Tue Jun 14 16:50:05 2016] [error] [client 000.00.00.000] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /usr/home/aa1342nofx/html
などのエラーが出ています
先ほど投稿されたログ
Tue Jun 14 20:11:50 2016
より日時がさかのぼっているようです。
設定などを変更した後にアクセスした際のログが必要です。いっそのこと、
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Options +FollowSymLinks </IfModule> # END WordPress
だけ残した.htaccessを作成して入れ替えると、とりあえずアクセスできるようになるかもしれません。
もちろん、現在のものはどこかにバックアップしておいてください。何度も申し訳ございません。
ありがとうございます。.htaccessを入れ替えてみました。
以下のエラーとなったため、[Tue Jun 14 23:40:32 2016] [alert] [client 000.00.00.000] /usr/home/aa1342nofx/html/.htaccess: Invalid command '\xef\xbb\xbf#', perhaps mis-spelled or defined by a module not included in the server configuration
terapadで文字コードUTF-8N、改行CR+LFで修正し、再度アップし、とったエラーが以下です
[Wed Jun 15 00:02:50 2016] [error] [client 000.00.00.000] malformed header from script. Bad header=<br />: /usr/home/aa1342nofx/html/index.php
munyagu様
ご報告です。
無事に復活できました。
munyaguさんのご指示通り、以下の.htaccessを作成し入れ替え、
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Options +FollowSymLinks </IfModule> # END WordPress
さらに
malformed header from script. Bad header=とエラーが出ていたので、
>もちろん、現在のものはどこかにバックアップしておいてください。
バックアップしたおいた.htaccessと見比べ、error_logで該当していないと思われる記述をひとつずつ追加していきました。エラーログの見方、対処方法など、ご丁寧に教えて頂き、本当にありがとうございました。
お手数をおかけしました。ありがとうございました。
- トピック「プラグインiThemes Securityを更新したら500Internal Server Error」には新たに返信することはできません。