コンソールでPHPのバージョンを確認する方法

PHPのバージョンを確認したいけど、phpinfo()のPHPファイルをWEBディレクトリに作るのが面倒で、SSHのコンソールで確認できればと思う場合は無いでしょうか?
コンソールでは、PHPコマンド打てば、PHPのバ ...
2017年は、元旦に「うるう秒」挿入されます

平成29 年(2017 年)1月1日(日)の午前8時59分59秒と午前9時00分00秒の間に「8時59分60秒」を挿入される模様にです
「うるう秒」挿入のお知らせ(NICT)「うるう秒」挿入の ...
Linux でディレクトリ構造のみコピーする

ディレクトリをそのままコピーするのじゃなくて、ディレクトリ構造のみをコピーしたいケースは無いででしょうか?
例えば、メールサーバーを移行した際に、ユーザーのメールボックスの領域だったり、Apacheでバーチャルホストを ...
ip_conntrackの設定を変更しても初期値に戻る場合

iptablesでは、パケットを解析するために ip_conntrack(nf_conntrack)というファイルを作って、そのパケットの情報を記録します。
このip_conntrack(nf_conntrack)に記 ...
マウントしているファイルシステムの種類を確認

この記事を掲載しているサーバーはServerman@VPSというサーバーを借りて運用しています。クラウドですので、OSインストール作業がなかったので、どのようなファイルシステムで ...
プロセスの生存を監視するスクリプト

Linuxでスクリプトを作っていると、あるプロセスが上がってないとサービス起動するとか、あるプロセスが上がってないとメールするとか、そのような監視プログラムを利用する場合あります。
その都度、以前使用したスクリプトでそ ...
CentOS ハードウェア情報の取得

他のディストリビューションでも使用できると思いますが、LinuxのCentOSでCPUやメモリ等のハードウェア情報を取得したい場合に使用するコマンドを紹介します
CPU情報 取得CPU情報を取得するには「/proc/c ...
変数内に複数の検索する文字列があるかチェックするシェルスクリプト

特定の文字列やエラーなどの文字列が変数内のあったら、処理をわけるという処理が必要なスクリプトを作る機会があったので、そのスクリプトを紹介します
スクリプトは、以下の様な感じの処理です
egrepコマンドで検索する ...タイムゾーンを日本に変更する方法 「Linux」

AWSでAmazon Linux, CentOS を使用しているとタイムゾーンがUTCになっていて日本時間じゃなくて使い勝手が悪かったので変更方法を紹介します
AWS以外でも同じような方法で変更できるかと思います
Server.InternalError: Internal error on launch で起動しない場合 [AWS]

AWSで無料枠のインスタンスで評価用のサーバーを作成し、本番予定のインスタンスタイプ(i2.8xlarge)で負荷テストをする案件があり、サーバーを構築後シャットダウンをおこない、評価用インスタンスの「i2.8xlarge」に変更 ...
NIC(LANカード)交換後にネットワークが上がらない時の対処方法

CentOS 6.x でNIC(LANカード)を交換後にネットワークが起動しないケースがありました。その場合の対処方法を説明します
CentOS 6.x では、MAC アドレスと ethX を対応付けが記録されていて、 ...
fstabの書き方が間違っているいて起動しない場合の対処方法

先日データーセンター作業で、運用しているサーバーのディスク容量が少なくなり、HD交換として起動すると以下のエラーが表示されました
fsck.ext4: No such file or directory which tryi ...ntpdでの時刻同期がずれる場合の対策(frequency error xxx PPM 〜)

CentOS 6.x で稼働しているサーバーで、以下の様なエラーが出力されてntpdの時刻同期が出来てにない事象が発生しました。原因はハードウェアクロックとカーネルクロックの時刻が大幅にずれており同期ができなくっているみたいです
vimで行番号を表示・非表示にする方法

vimで行番号を表示・非表示にする方法を紹介します
行番号を表示行番号を表示するには、ESCを押したあとに、下記のように「:set number」または「:set nu」と入力します
:set numberまたは ...行番号を付けて出力する(nlコマンド)

ファイルに行番号をつけて出力する方法は、catコマンド、awkコマンド、nlコマンドで出力できます。本記事では、「nlコマンド」を利用した場合の方法を説明します
catコマンドで行番号を表示cat -n <ファイ ...