設定

ACLの表記について

今日はCiscoのACL資料作成を頼まれた。
configの取得は先輩がしていたので、取得した
configから資料に纏めるだけで良いんだけど。。。
Ciscoなんて普段触っていないし、今までも言われた
コマンドを実行した結果をベンダーに送るくらい
しか、した事ないし・・・。
そんな訳でネットで検索して、ACLの解釈を。
なんとなく解釈はできるけど、、、ACL表記内に
「0.0.0.255 」って・・・そんなネットワークないよね?

それで、ネットで調査。
0.0.0.255 」は、ワイルドカードマスクでの表記らしい。
32ビットのIPアドレスのうち、ビット0の部分が一致
しているアドレスを許可するらしい。

でも、何故ワイルドカードマスクを使ってACLを設定
するの?と疑問。普通にサブネットマスクで表記すれば
良いじゃん。って。

その答えは、

アクセスリストでは、ネットワークを指定する際に、
サブネットマスクが使えません。

それで、ワイルドカードマスクを利用するらしい。
なるほどねぇー。

そうなると、ワイルドカードマスクからサブネット
を判断して、どのようなACL設定となるのか確認する事
になる。
パッと見、ワイルドカードマスクからサブネットマスク
を解釈するのは、今の私には無理なので。。。

サブネット計算機 なるものを発見した。

これから、ネットワークも勉強して強化しないとなぁ。
がんばるぞーーーーー。

| | コメント (0) | トラックバック (0)

Movable Typeの設定

MySQLへログイン
# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.16

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

「mt」というデータベースを作成
mysql> create database mt;
Query OK, 1 row affected (0.01 sec)

管理DBをデフォルト(管理をカレント)
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
Movable Typeがログインするユーザー名とパスワードを設定
以下は例として「ユーザー名:admin」「パスワード:password」としています。 
mysql> grant usage on mt.* to admin@localhost identified by 'password';
Query OK, 0 rows affected (0.00 sec)

「mt」に対してすべての権限を「admin」に許す
mysql> grant all on mt.* to admin@localhost;
Query OK, 0 rows affected (0.00 sec)

終了
mysql> exit
Bye

Movable Type設定ファイルのコピー
# cp -p /var/www/html/cgi-bin/mt-config.cgi-original /var/www/html/cgi-bin/mt-config.cgi

設定ファイルの編集
# vi /var/www/html/cgi-bin/mt-config.cgi
##          Movable Type configuration file                   ##
##                                                            ##
## This file defines system-wide settings for Movable Type    ##
## In total, there are over a hundred options, but only those ##
## critical for everyone are listed below.                    ##
##                                                            ##
## Information on all others can be found at:                 ##
## http://www.sixapart.jp/movabletype/manual/config

################################################################
##################### REQUIRED SETTINGS ########################
################################################################

# The CGIPath is the URL to your Movable Type directory
Movable TypeのCGI実行パスを設定
CGIPath    http://se-memo.nifty.com/cgi-bin/

# The StaticWebPath is the URL to your mt-static directory
# Note: Check the installation documentation to find out
# whether this is required for your environment.  If it is not,
# simply remove it or comment out the line by prepending a "#".
StaticWebPathパスを設定
StaticWebPath    http://se-memo.nifty.com/cgi-bin/mt-static

#================ DATABASE SETTINGS ==================
#   REMOVE all sections below that refer to databases
#   other than the one you will be using.

##### MYSQL #####
使用データベース「MySQL」の各種設定
ObjectDriver DBI::mysql
データベース名
Database mt
オール権限のユーザー名
DBUser admin
上記ユーザーのパスワード
DBPassword password
自サーバのホストDB使用
DBHost localhost

##### POSTGRESQL #####
すべてコメントアウト
#ObjectDriver DBI::postgres
#Database DATABASE_NAME
#DBUser DATABASE_USERNAME
#DBPassword DATABASE_PASSWORD
#DBHost localhost

##### SQLITE #####
すべてコメントアウト
#ObjectDriver DBI::sqlite
#Database /path/to/sqlite/database/file

##### BERKELEYDB #####
すべてコメントアウト
#DataSource  /path/to/database/directory

基本からしっかりわかる Movable Type 4.1 カスタマイズブック Movable Type 4.1/MTOS 4.1対応 (Web Designing BOOKS)

      
基本からしっかりわかる Movable Type 4.1 カスタマイズブック Movable Type 4.1/MTOS 4.1対応 (Web Designing BOOKS)

著者:大藤 幹

基本からしっかりわかる Movable Type 4.1 カスタマイズブック Movable Type 4.1/MTOS 4.1対応 (Web Designing BOOKS)

| | コメント (0) | トラックバック (0)

MovableType インストール apache設定編

MovableTypeは、webサーバが利用可能である事が必須。
早速、Apacheの設定をここを参考に。
MySQLでてこずったけど、Apacheはスムーズに設定できた。

設定ファイルのバックアップを取る
# cp -p /etc/httpd/conf/httpd.conf /etc/httpd/conf/OLG_httpd.conf

設定ファイルの編集
# vi /etc/httpd/conf/httpd.conf

管理者のメールアドレスを設定する
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.  e.g. admin@your-domain.com
#
ServerAdmin webmaster@se-memo.nifty.com


サーバ名を設定する
#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If this is not set to valid DNS name for your host, server-generated
# redirections will not work.  See also the UseCanonicalName directive.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#
ServerName se-memo.nifty.com :80


ドキュメントルートの指定
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html" (自分の環境に併せる)


ドキュメントルートの設定
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/var/www/html">

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
#
SSIの許可(コマンドExec含む)、CGIの許可、シンボリックリンク許可
    Options Includes ExecCGI FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
.htaccessの許可
    AllowOverride All

</Directory>
設定ファイルの編集は、ここまで。

次は、apache(httpd)を起動する

# /etc/rc.d/init.d/httpd start
httpd を起動中:                                            [  OK  ]

起動時にapache(httpd)を起動する
# chkconfig httpd on
設定内容を確認
# chkconfig --list httpd
httpd           0:オフ  1:オフ  2:オン  3:オン  4:オン  5:オン  6:オフ

クライアントより[http://サーバのアドレス/]でアクセスして
Apacheのテストページが表示されていればOK。

Apacheハンドブック

      
Apacheハンドブック

著者:Ben Laurie,Peter Laurie,大川 佳織,田辺 茂也

Apacheハンドブック

| | コメント (0) | トラックバック (0)

MovableType インストール事前準備 MySQL編

職場で社内情報共有ツールとして使えるものを選出
してくれ。との要望が。。。
それも、出来ればお金をかけない方向性でとの事。
思いつくものは、MovableType、XOOPS、WordPress。
とりあえず、要望として第一に挙がったのが
MovableTypeだったので、インストールを試みた。
MovableTypeを使うには事前準備として、以下が必要だ。

■Webサーバー(Apacheなど)が利用可能な事
■MySQLなどのデータベースが利用可能な事
■プログラム実行環境(PerlやPHPなど)が必要(#whereis perlで確認しておく)

「インストール環境」
■OS:CentOS4
■DB:MySQL
■MT:MovableType4.13

今回は、CentOSをインストールする事から始めた。
CDからのインストールだったので楽々インストール完了。
(ただ、MySQLのチェックボックスをONにしてインストール
したが、MySQLが起動しない。
しかも、何故かMYSQLSERVERがインストールされていない。)
再度、CDからソフトウエアのインストールを試す。
詳細インストールを覗くと、
MYSQLSERVERがデフォルトでは
チェックが入っていないのでインストールされない。という
情けないお粗末な結果が判明。

MYSQLSERVERにチェックを入れ、無事インストールが完了。

# /etc/init.d/mysqld start #MySQLの起動コマンド
# /etc/init.d/mysqld stop #MySQLの停止コマンド

無事、MySQLの起動コマンドで起動した〜。

次は、データベースの作成と自動実行の登録。
サーバ再起動する度に起動コマンド実行するのは大変
ですからねー。

その後のMySQLの設定は、ここを参考にした。

# mysql -u root
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 3.23.58

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

インストール直後のデータベース表示
mysql> show databases;
+-----------+
| Databases |
+-----------+
| mysql     |
| test      |
+-----------+
データベースが「mysql」と「test」の2つが存在している。


「mysql」データベースのテーブル名表示
mysql> show tables from mysql;
+-----------------+
| Tables_in_mysql |
+-----------------+
| columns_priv    |
| db              |
| func            |
| host            |
| tables_priv     |
| user            |
+-----------------+
6 rows in set (0.00 sec)
columns_priv    :フィールドについてのアクセス制限
db              :各データベースについてのアクセス制限
func            :システムテーブル(ユーザ定義関数)
host            :ホストによる制限
tables_priv     :テーブルについてのアクセス制限
user            :ユーザによりアクセスを制限


MySQLアカウントのrootが自動的に作成されているがパスワードが
設定されていないので設定する。

rootにパスワードを設定する(パスワードを"se-heigi"とする場合)
mysql> SET PASSWORD FOR root@localhost=PASSWORD('se-heigi');
Query OK, 0 rows affected (0.00 sec)

MySQL monitorの終了
mysql> exit
Bye


MySQL monitorにrootで接続する
(この時、"-p"オプションを指定しパスワード入力をする)

# mysql -u root -p
上記で設定したパスワード"se-heigi"を入力
Enter password:se-heigi(通常は表示されません)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5 to server version: 3.23.58

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

「use」コマンドで「mysql」データベースに切り替える。
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

データベースが変更された
Database changed

MySQLに接続できるユーザの表示
mysql> select host,user,password from user;
+------------------------+------+------------------+
| host                   | user | password         |
+------------------------+------+------------------+
| localhost              | root | 451b483e5c7325d5 |
| se-memo.nifty.com     | root |                  |
| se-memo.nifty.com   |      |                  |
| localhost              |      |                  |
+------------------------+------+------------------+
4 rows in set (0.00 sec)

パスワード無しのユーザ(匿名ユーザ)の削除(セキュリティの為)
mysql> delete from user where user="";
Query OK, 2 rows affected (0.00 sec)

MySQLに接続できるユーザの表示
mysql> select host,user,password from user;
+------------------------+------+------------------+
| host                   | user | password         |
+------------------------+------+------------------+
| localhost              | root | 451b483e5c7325d5 |
| se-memo.nifty.com    | root |                  |
+------------------------+------+------------------+
2 rows in set (0.00 sec)


パスワード無しのユーザが削除されたホスト「se-memo.nifty.com
にもパスワードを設定する

mysql> SET PASSWORD FOR root@se-memo.nifty.com=PASSWORD('se-heigi');
Query OK, 0 rows affected (0.00 sec)

MySQLに接続できるユーザの表示
mysql> select host,user,password from user;
+------------------------+------+------------------+
| host                   | user | password         |
+------------------------+------+------------------+
| localhost              | root | 451b483e5c7325d5 |
| se-memo.nifty.com   | root | 451b483e5c7325d5 |
+------------------------+------+------------------+
2 rows in set (0.00 sec) 


MySQL monitorの終了
mysql> exit
Bye

 

基礎からのMySQL [基礎からのシリーズ] (プログラマの種シリーズ)

      
基礎からのMySQL [基礎からのシリーズ] (プログラマの種シリーズ)

著者:西沢 夢路

基礎からのMySQL [基礎からのシリーズ] (プログラマの種シリーズ)

 

| | コメント (0) | トラックバック (0)