WordPress の管理画面にIPアドレス制限 【Apache 2.4系】

WordPress の不正アクセスで多いのは管理画面でログインできる「wp-login.php」にアクセスが多いです。ログで確認すると海外からアクセスが多いので、WAF(Web Application Firewall)のModSec ...
メンテナンスモードで「fstab」の書き込みができなくなった場合の対処方法

LinuxサーバーでHD故障でディスクを外してたりして再起動しました。故障したHDの「fstab」の故障したHDのマウントしている箇所のコメントアウトを忘れていたので、起動時に失敗しました。
画面ではメンテナンスモードに移 ...
ModSecurityでホワイトリスト・ブラックリストを追加

無料のWAFの「ModSecurity」でホワイトリストとブラックリストを設定する方法を説明します。「ModSecurity」のインストール方法は「無料のWAF(Web Application Firewall)のModSecurit ...
一時的にManページを日本語で表示する

以前の記事で「CentOS manコマンドを日本語表示にする」で、manページを日本語に変更する方法を紹介していました。
以前の方法では環境自体が日本語環境になるので、普段は英語環境のほうが良いってユーザーもいるかと思います。 ...
dovecotの設定内容の確認(doveconf)

メールサーバーの設定を見直していて、Dovecot側設定一覧を確認したくて、postfix の「postconf」のようなコマンドがないか探していたら「doveconf」のコマンドがありました
$ doveconf# 2.2.3 ...シェルスクリプトで特定の文字がある場合の分岐

シェルスクリプトの「if」文で特定の文字が含まれる場合の分岐は、 ] のように検索したい文字を*で囲みます。「*」は任意の文字列を表すワイルドカードとして使用されています
以下のシェルスクリプトでは、変数内(VARNAME ...
CloudMonkeyを利用して、スナップショットの作成日を取得する

クラウドで毎日スナップショットを取得していますが、たまに失敗している場合があるので、スナップショットを作成した日時を取得してメールするようにしたい。スナップショットの情報は「CloudMonkey」で取得してその情報を加工してメールで ...
CloudMonkeyをインストール

運用しているクラウドサービスで毎日スナップショットを取得していますが、スナップショットの取得に失敗する場合があり、たまにスナップショット取得に失敗してそれ以降スナ ...
SSL証明書のチェックで脆弱性のまたは強度の弱い暗号スイートを使用している可能性の警告

CentOS 6で運用しているサーバーでSSL証明書を更新して、CMANの「SSLチェック【証明書・プロトコル・暗号スイート確認】」でSSL証明書をチェックすると下記のように「脆弱性または強度が弱い暗号化スイートを使用している可能性が ...
gzファイルをgrepで文字列検索する

過去のログファイルをgrepで検索する機会が多いと思いますが、ログファイルのファイルサイズの容量を小さくする為に「gzファイル」で圧縮されているケースがあります。今までは下記のように、zcat で展開してからgrep していました
acme.sh でSSL証明書発行時にエラー

古いサーバーでPythonの関係と思いますが、「Certbot」を利用できないので、Bashで書かれている「acme.sh」でLet’s EncryptのSSL証明書を発行しました。acme.shは、Bashで書かれている ...
rsyncコマンドでパーミッションエラーが表示される

rsyncコマンドを利用してコピーすると以下のようにエラーがでます
$ rsync -avz --delete --rsync-path="sudo rsync" 192.168.0.1:/var/www/html//backu ...MySQLで データインポート時に 「Unknown collation: utf8mb4_unicode_520_ci」 エラー表示

他の運営しているWordpressのサイトの引っ越しする作業があり、WordPressのDBをインポートすると下記のエラーが表示されました
Unknown collation: utf8mb4_unicode_520_ci...
awkでファイル内の値を集計

awkコマンドを利用すると簡単にファイル内のある数値を集計できます。
下記のような数字が入っているファイルがあります
XFSファイルシステムでのディスク容量の拡張

使用しているクラウドで、ディスクの空きが少なくなってきたので、ディスク容量拡張する事にしました。
クラウドのサポートページにディスク容量を拡張する下記のような手順がありましたが、ファイルシステムがext4だったので、xfs ...