Odyssey & Linux
 
 
 
管理人が作成した模型の紹介です
 
 
 

 

 

  Webmin(ブラウザでの設定ツール)

Webminのバージョンが1.400になってユーザーインタフェースが変更になっています。
1.400の方はこちらで

Webminのセットアップ

Webminがインストールされていない場合は下記より入手してインストールする。

  webmin 公式ミラーページ:http://webmin.ispace.co.jp/

今回は上記のHPよりコンパイル済のものを入手しました webmin-1.050.tar.gz (Unix tar/gzip format, 5698 Kb)

(最新版はwebmin-1.170.tar.gz (Unix tar/gzip format, 6626 kB)) になっています 13 Nov 2004)

Terminalを起動して下記のコマンドを入力(青色の部分を入力)

[root@omote ~]# cp webmin-1.050.tar.gz /usr/local
[root@omote ~]# cd /usr/local
[root@omote local]# gunzip webmin-1.050.tar.gz
[root@omote local]# tar xf webmin-1.050.tar
[root@omote local]# cd webmin-1.050

この後Setupの作業です。
(出力されるメッセージは最新物ですと変更になっていると思います)

セットアップ用のスクリプトを起動して質問に答える形で進めていきます。(青色の部分が入力する項目です)
(ほとんどデフォルトのままです。デフォルトの設定で良い場合はEnterのみでOK)

[root@omote webmin-1.050]# ./setup.sh
***********************************************************************
* Welcome to the Webmin setup script, version 1.050 *
***********************************************************************
Webmin is a web-based interface that allows Unix-like operating
systems and common Unix services to be easily administered.
Installing Webmin in /usr/local/webmin-1.050 ***********************************************************************
Webmin uses separate directories for configuration files and log files.
Unless you want to run multiple versions of Webmin at the same time
you can just accept the defaults.

Config file directory [/etc/webmin]:/etc.webmin
Log file directory [/var/webmin]:/var/webmin

***********************************************************************
Webmin is written entirely in Perl. Please enter the full path to the
Perl 5 interpreter on your system.
Full path to perl (default /usr/bin/perl):/usr/bin/perl
Testing Perl ...
Perl seems to be installed ok
***********************************************************************
Operating system name: Redhat Linux
Operating system version: 8.0
***********************************************************************
Webmin uses its own password protected web server to provide access
to the administration programs. The setup script needs to know :
- What port to run the web server on. There must not be another
web server already using this port.
- The login name required to access the web server.
- The password required to access the web server.
- If the webserver should use SSL (if your system supports it).
- Whether to start webmin at boot time.
Web server port (default 10000):10000
Login name (default admin): root
Login password:password
Password again:password
The Perl SSLeay library is not installed. SSL not available.
Start Webmin at boot time (y/n): y
***********************************************************************
Creating web server config files..
..done
Creating access control file..
..done
Inserting path to perl into scripts..
..done
Creating start and stop scripts..
..done
Copying config files..
..done
Configuring Webmin to start at boot time..
Created init script /etc/rc.d/init.d/webmin
..done
Creating uninstall script /etc/webmin/uninstall.sh ..
..done
Changing ownership and permissions ..
..done
Running postinstall scripts ..
..done
Attempting to start Webmin mini web server..
Starting Webmin server in /usr/local/webmin-1.050
..done
***********************************************************************
Webmin has been installed and started successfully. Use your web
browser to go to
http://omote.sytes.net:10000/
and login with the name and password you entered previously.
[root@omote webmin-1.050]#

以上でセットアップは終了です
バージョンアップする場合は、セットアップするディレクトリーを入力するだけで全て終わります。

TOPに戻る

WebminでLinuxマシンにログインする

URL欄に 192.168.XXX.XXX:10000 を入力
rootのパスワードを入力 これで下記の画面になります。(1番最初は全て英語で表示されます)

別の機械にVine Linux 2.6r1 をインストールしてみましたが root のパスワードを入力してもログインできませんでした。

Webで調べてみたところ、次のことをして root のパスワードを Webmin に教えてあげるとログインできるようになるようです。

# /usr/libexec/webmin/changepass.pl /etc/webmin root パスワード

(Vine Linux Home Page より引用しました)

TOPに戻る

Webminnの設定 日本語表示にする。

Webmin設定をクリック

Language(言語)をクリック

Display in language(言語で表示)の中で Japanese (JA_JP,EUC) を選択し Change Language ボタンをクリックすると、表示が日本語になります。

TOPに戻る

WebminにアクセスできるPCを制限する

デフォルトのままですと外部のPCからでもWebminにアクセスできますのでパスワードを推測された場合サーバーの設定を変えられますのでアドレスでアクセスできるPCを制限しておきます。

Webmin → Webmin設定 → IP アドレスのアクセス制御 とクリック

”リストされたアドレスからのみ許可”をチェック、その右側のテキストBOXに許可するPCのIPアドレスを入力する
(上の例ではサーバーとクライアント2台分を設定しています)

”保存”をクリックして設定を有効にする。

TOPに戻る

WebminでApacheのログを確認する

WebminでApacheのログ(アクセスログとエラーログ)を表示出来るようにしておくとエディターなどでログファイルを開く必要がなくなります。

Webmin → システム → システムログ とクリック

”新規のシステムログを追加”をクリックすると、次の画面が出ます。

”ログ先” テキストボックスに”/var/log/httpd/access_log”を入力(参照ボタンからでも入力できます)
このログの場所はRedhatのデフォルトの設定です。

”ログをアクティブにしますか?” を ”はい”にする。

”ログに記録するメッセージの種類” の中の ”機能” の中で ”すべて”(ドロップダウンテキストボックスの中)を選択

”保存” をクリック

以上でアクセスログをWebminで確認できるようになります。

エラーログは ”ログ先” を ”/var/log/httpd/error_log”に変えて同じ事をしてください。

Webminで毎日の決まった作業を設定する

毎日決まった時間に同じ事をPCにさせる場合 Cron を設定することで可能ですが、Webminを使って設定することができます。(管理人はPCの時刻合わせとデータのバックアップを行っています)

まずWebminにログインします。上のメニューの中で”システム”をクリックします。

システムのメニューに切り替わりますので”予定済み Cron 作業”をクリックします。

すでに登録されている Cron 作業の一覧が表示されます。
スクロールして一番下にある”新しいスケジュールのcronジョブを作成”をクリックします。

この画面はPCの時間設定を毎日朝4時に行うように設定しているところです。
cronジョブを実行するユーザ  root(時間設定はrootではないと出来ないため)
コマンド              /usr/sbin/ntpdate 133.40.41.175 (サーバーは色々有りますがたまたま見つけたものを使用しています)
コマンドの引数          必要な場合入力(今回は必要ないので入力していません)
実行する時間           分・時・日・月・曜日をそれぞれ選択します。(毎日朝4時に設定しています)
すべて入力が出来たら下の”保存”ボタンをクリックします。

バックアップ作業の設定は以下の通りにしています。
cronジョブを実行するユーザ  root
コマンド              /home/masami/backup.sh
コマンドの引数          必要な場合入力(今回は必要ないので入力していません)
実行する時間           分・時・日・月・曜日をそれぞれ選択します。(毎日朝4時に設定しています)
すべて入力が出来たら下の”保存”ボタンをクリックします。

backup.shの内容は次の通りです。

#! /bin/sh
cp -ar /var/www/html /usr2/BackUP
cp -ar /var/www/cgi-bin /usr2/BackUP
cp -ar /var/log/httpd /usr2/BackUP

/usr2 は2台目のHDDに作ってあります。(LinuxをインストールしてあるHDDとは別のものです)
これでLinuxをインストールしてあるHDDがクラッシュしてもデータは残ってくれると思います。

ページTOP 戻る