Apacheで特定のIPアドレス制限が効かない

BASIC認証とIP制限を併用しているサイトが合って、特定のファイルのみIP制限したいとの要望があって「.htaccess」に設定を入れても、IP制限が全く効かなかった。
Sat ...関数の呼び出し順で「command not found」のエラー

関数を使ったシェルスクリプトで関数の呼び出す場所は、定義した関数より前に書くと「command not found」や「Main: コマンドが見つかり ...
var_dumpの内容を改行を入れて見やすくする方法

Lightsailで運用しているCentOS 7に、muninをインストールします。
NginxをWEBサーバーを構築済みとしており、ドメインは「munin.example.com」として手順を作成しています。Nginxの ...
sedコマンドで行頭から指定した行を削除する

sedコマンドで、1行目から5行目まで削除したい時は、下記のように書けば指定した行数だけ削除できます。
$ sed -i -e '1,5d' <ファイル名>また、5行目から10行だと、下記のようにすれば指定した ...
OwnCloudでサーバー側で直接にファイルを追加・削除する

OwnCloudサーバーでサーバー側にファイルが保存されている領域にファイルを追加したり削除してもブラウザではそのファイルは確認できません。
OwnC ...
シェルスクリプトを実行している絶対パスを取得する

シェルスクリプトで実行しているディレクリ名を取得する場合「dirname ${0}」でディレクトリ名を取得できます。
但し、実行時に相対パスで実行するとディレクトリ名も相対パスとなります。
下記のスクリプトでは、「 ...
vsftpdでパッシブモードを設定する

FTPサーバーのvsftpdでパッシブモードも有効にして、F/W(iptables)でパッシブモードで利用するポートを開放する手順を説明します
vsftpdでパッシブモードを有効 ...ファイルパスからディレクリ名・ファイル名を取得

ファイルパスからディレクトリ名・ファイル名を取得するには「dirname」、「basename」を使うとディレクトリ名やファイル名を取得できます
dir ...シェルスクリプトでファイルを読み込んで処理する

シェルスクリプトでファイルの内容を読み込んで、その内容を出力したりする方法を紹介します
ファイルを標準入力へリダイレクトさせて読み込むwhile read lineで、標準入力 ...
cpコマンドで隠しファイルをコピーする

cpコマンドで「.htaccess」等の隠しファイルを含むディレクトリをコピーするときに、「 cp -r test/* 」とすると、コピー元に「.htaccess」等の隠し ...
ファイル内の重複した行を削除する「uniqコマンド」

Linuxのuniqコマンドを利用すると、重複した行を削除したり、重複している行のみ表示できます。
uniq コマンドではオプションなしでは、重複している行を削除できますが「ソート」 ...
MySQLで一般クエリーログを出力する設定にする

MySQLやMariaDBでクエリーを実行したSQLを出力するには、一般クエリログで確認できるので、この項目を有効にしてログファイルの出力先を指定すれば、ログファイルに出力 ...
シンボリックリンクを利用してデータベースの保存先を変更する 【mariadb, MySQL】

mariadb, MySQLで、データベースの保存先の設定は、「/etc/my.cnf」の「datadir=/var/lib/mysql」の箇所です
# vi/etc/my.cnfd ...Linux でOSのバージョン、カーネルのバージョンの確認方法

Redhat系のCentOSで、OSのバージョンを確認するには、「/etc/redhat-release」をみると確認できます
$ cat/etc/redhat-releaseCentOS Li ...シェルスクリプトでwhile内のでsshコマンドを使用すると1回しか処理されない

シェルスクリプトでwhile文を利用して、そのループ処理内にsshコマンドを使用するとループ処理されずに1回のみとなる場合の対処方法です
下記のシェルスクリプトでは、LIST_FILE=/home/admin/list.t ...