Apacheのバーチャルホストの一覧表示と内容確認

ApacheでVirtualHost で設定されているドメインの一覧や内容を確認するには、VirtualHost の設定ファイルを見ればわかりますが、複数のVirtualHost を設定している場合は、その設定ファイルを一個一個みるに ...
Apache 2.4系 DoS攻撃対策 mod_dosdetector 導入

以前にも同じような記事(DoS攻撃対策 Apacheモジュール mod_dosdetector 導入)DoS攻撃対策を書きましたが、内容的は同じ内容になります。こちらはCentOS 7系のサーバ ...
大きめのCSVファイルをアップロードして際のMySQLのエラー【MariaDB,MySQL】

MySQL(MariaDB)で、大きなCSVファイ ...
Curlでリクエスト中の進行状況を表示しない

curlでWEBページを保存する時に、オプションを指定しない場合は、下記のようにダウンロードできる進捗状況が表示されます。
通常にWEBページをダウンロードする場合はいいですが、シェルスクリプトでプログラムを実行している場 ...
grep コマンドで数字のみを表示する

数字と文字を含むテキストがあり、その中で数字のみを抽出したい場合の「grep -o ‘*’」のようにgrepコマンドを利用すれば利用できます
# grep -o '*'とすれば、数字のみを抽出できます$ ...viエディタでコロン「:」が打てない場合の対処方法

とあるクラウドサーバーで仮想マシンのクローンより新規仮想マシンを作成する作業がありました。
コピー元の仮想マシンが複数のディスクをマウントしており、コピー先のマシ ...
findコマンドで空ファイル(0バイト)の削除する

0バイトの空ファイルを一括削除したい場合、findコマンドを利用すれば簡単に一括で削除する事ができます
空ファイル、空ディレクトリを一括で削除するfindの ...
innodb_buffer_pool_size, innodb_log_file_sizeを変更後に起動しなくなった

CentOS 7.x のサーバーで、メモリを増設したのでMariaDBのDBのチューニングで、「innodb_buffer_pool_size」, 「innodb_log_file_size」の値を変更後、MariaDBが下記のエラー ...
SSL証明書で秘密鍵(key)と公開鍵(crt)がペアになっているか確認する

SSL証明書を更新して、Apacheを起動してみると下記のような「X509_check_private_key:key values mismatch」エラーがあがり起動しなくなった。
SSL Library Error: 1 ...topコマンドでコア単位でCPU使用率を確認する

topコマンドではCPUの使用率が表示されますが、デフォルトでは複数のCPUコアを1つにまとめて表示されます。
これをCPU使用率をコア別に表示するには、topコマンドを叩いてから「1」のキーを押します
digコマンドでTXTレコード(DNSレコード)の確認

Let’s Encryptの無料SSL証明書でワイルドカードSSLが利用できるようなり3ヶ月に一度更新しています。
個人利用ではなく商用利用しているので自動更新ではなく、手動でテストサーバーでSSL証明書を更新してその後に本番 ...
lsコマンドでディレクトリのみ表示する方法

ls コマンドでディレクトリのみを表示する方法を紹介します。
ls -l 対象パスとすると、下記のようにファイル名とディレクリ名が表示されますが、これをディレクトリのみで表示する方法です ...
yum でインストールで「Protected multilib versions・・・」のエラー

yumで「rrdtool」をインストールしようとしたら下記のエラーがあがり「rrdtool」でインストール出来ませんでした。
$ yum install rrdtoolProtected multilib versions: r ...シェルスクリプトで、1週間分のファイルをバックアップする

定期的に特定のファイルをバックアップする方法を紹介します。日時でcronで実行して7世代(1週間分)、特定のファイルを保存するシェルスクリプトです。動作確認はCentOSでおこなっています
流れとしては、バックアップするフ ...
date コマンドで前月を取得する

dateコマンドで前月の日付を取得するには「1 month ago」のオプションを付けると一ヶ月前の値を取得ることが出来ます。
$ date +'%Y-%m-%d'2020-11-04$ date -d '1 month ago ...