ここでは、まず Nature's Linux のミドルウェア系パッケージである Nature's Linux on WebDB-APMをインストールします。このパッケージは Nature's Linux 上で WebとDBのサーバを動作させるためのパッケージであり、Apache, PHP, MySQL の最新の安定版が含まれています。
login as: dev
dev@10.99.7.102's password:
Last login: Wed Oct 20 15:54:00 2004
Nature's Linux BASE-OS Edition. Release 1.2
[VFS-dev@tcng002 dev]$ su -
Password:
[VFS-root@tcng002 root]#
apt-get update を実行して、Nature's Linux の deb パッケージダウンロードサイトにアクセスし、使用可能な deb パッケージの情報をローカルディスク上に取得します。
apt-get install nl-webdb-apm で Nature's Linux on WebDB-APM をインストールします。以下のようにメッセージが表示されますので、最後にYと入力するとインストールが始まります。
[VFS-root@tcng002 root]# apt-get install nl-webdb-apm
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
apache13-modssl libdbd-mysql libdbi-perl libmysql40 mysql40 php4-mysql
The following NEW packages will be installed:
apache13-modssl libdbd-mysql libdbi-perl libmysql40 mysql40 nl-webdb-apm
php4-mysql
0 upgraded, 7 newly installed, 0 to remove and 20 not upgraded.
Need to get 11.7MB of archives.
After unpacking 35.8MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 ftp://packages.n-linux.com deb/ apache13-modssl 1.3.31+2.8.20-nl1 [1876kB]
Get:2 ftp://packages.n-linux.com deb/ libmysql40 4.0.21-nl2 [177kB]
Get:3 ftp://packages.n-linux.com deb/ libdbd-mysql 2.9004-nl1 [121kB]
Get:4 ftp://packages.n-linux.com deb/ libdbi-perl 1.45-nl1 [588kB]
Get:5 ftp://packages.n-linux.com deb/ mysql40 4.0.21-nl2 [5490kB]
Get:6 ftp://packages.n-linux.com deb/ php4-mysql 4.3.9-nl1 [3437kB]
Get:7 ftp://packages.n-linux.com deb/ nl-webdb-apm 1.0.0-nl1 [2738B]
Fetched 11.7MB in 8s (1359kB/s)
Selecting previously deselected package apache13-modssl.
(Reading database ... 16389 files and directories currently installed.)
Unpacking apache13-modssl (from .../apache13-modssl_1.3.31+2.8.20-nl1_i386.deb) ...
Selecting previously deselected package libmysql40.
Unpacking libmysql40 (from .../libmysql40_4.0.21-nl2_i386.deb) ...
Selecting previously deselected package libdbd-mysql.
Unpacking libdbd-mysql (from .../libdbd-mysql_2.9004-nl1_i386.deb) ...
Selecting previously deselected package libdbi-perl.
Unpacking libdbi-perl (from .../libdbi-perl_1.45-nl1_i386.deb) ...
Selecting previously deselected package mysql40.
Unpacking mysql40 (from .../mysql40_4.0.21-nl2_i386.deb) ...
Selecting previously deselected package php4-mysql.
Unpacking php4-mysql (from .../php4-mysql_4.3.9-nl1_i386.deb) ...
Selecting previously deselected package nl-webdb-apm.
Unpacking nl-webdb-apm (from .../nl-webdb-apm_1.0.0-nl1_i386.deb) ...
Setting up apache13-modssl (1.3.31+2.8.20-nl1) ...
Setting up libmysql40 (4.0.21-nl2) ...
Setting up libdbd-mysql (2.9004-nl1) ...
Setting up libdbi-perl (1.45-nl1) ...
Setting up mysql40 (4.0.21-nl2) ...
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
041028 9:54:00 /opt/package/mysql40/libexec/mysqld: Shutdown Complete
To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/opt/package/mysql40/bin/mysqladmin -u root password 'new-password'
/opt/package/mysql40/bin/mysqladmin -u root -h tcng002 password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd /opt/package/mysql40 ; /opt/package/mysql40/bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests
Please report any problems with the /opt/package/mysql40/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com
Setting up php4-mysql (4.3.9-nl1) ...
Changed httpd.conf, Please, restart apache.
Setting up nl-webdb-apm (1.0.0-nl1) ...
[VFS-root@tcng002 root]#
[VFS-root@tcng002 root]# dpkg -l | grep nl-
ii nl-vfsbase 1.0.3-nl1 Nature's Linux base files package for VFS.
ii nl-webdb-apm 1.0.0-nl1 This is the middleware appliance package of
[VFS-root@tcng002 root]#
httpd.conf を変更後、service apache statusを実行して、Apacheの状態を確認します。
httpd is stoppedと表示されたらservice apache start、
httpd (pid ... ) is running...と表示されたらservice apache reloadを実行します。
[VFS-root@tcng002 root]# service apache status
httpd is stopped
[VFS-root@tcng002 root]# service apache start
Starting apache: [ OK ]
[VFS-root@tcng002 root]#
mysql -u root mysql と入力します。このコマンドは MySQL にパスワードなしの MySQLのroot ユーザとしてログインすることを意味します。ログインが成功すると、MySQL Monitor へのウェルカムメッセージが表示されます。
[VFS-mysql@tcng002 mysql]$ mysql -u root mysql
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 1 to server version: 4.0.21
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
MySQL プロンプトから set password for root=password('<パスワード>'); と入力して、root のパスワードを設定します。Query OK と表示されたら成功です。
mysql> set password for root=password('nl-tech');
Query OK, 0 rows affected (0.03 sec)
mysql>
MySQL プロンプトから flush privileges; と入力して、認証関連の変更を反映させます。Query OK と表示されたら成功です。
mysql ユーザーで mysql -p -u root mysql と入力します。パスワード入力を求められますので、先ほど設定したパスワードを入力します。上記のようなMySQL Monitor へのウェルカムメッセージが表示されたらログイン成功です。
[VFS-mysql@tcng002 mysql]$ mysql -p -u root mysql
Enter password:
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 2 to server version: 4.0.21
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
MySQL にログインし、MySQL プロンプトから show databases; と入力して、データベースが作成されていることを確認し、\qと入力してMySQLを終了します。
[VFS-mysql@tcng002 mysql]$ mysql -p -u root mysql
Enter password:
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: 4.0.21
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+----------+
| Database |
+----------+
| mysql |
| test |
| xoops |
+----------+
3 rows in set (0.00 sec)
mysql> \q
Bye
[VFS-mysql@tcng002 mysql]$
mysql ユーザーで mysql -p -u root <データベース名> と入力します。パスワード入力を求められますので、先ほど設定したroot のパスワードを入力します。ログインに成功すると、MySQL Monitor へのウェルカムメッセージが表示されます。ここでは例としてデータベース名をxoopsとしています。
[VFS-mysql@tcng002 mysql]$ mysql -p -u root xoops
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5 to server version: 4.0.21
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
MySQL プロンプトから grant all on <データベース名>.* to <ユーザ名>@localhost identified by '<パスワード>'; と入力してユーザアカウント <ユーザ名>(例えば xoopsadm)を作成します。他のマシンからもデータベースをアクセスするのならば、<ユーザ名>@localhost の部分を適宜変更してからユーザアカウントを追加します。Query OK と表示されたら成功です。
mysql> grant all on xoops.* to dev@localhost identified by 'nl-tech';
Query OK, 0 rows affected (0.05 sec)
mysql>
MySQL プロンプトから flush privileges; と入力して、認証関連の変更を反映させます。Query OK と表示されたら成功です。
mysql ユーザーで mysql -p -u <ユーザ名> <データベース名> と入力します。パスワード入力を求められますので、先ほど設定したパスワードを入力します。上記のようなMySQL Monitor へのウェルカムメッセージが表示されたらログイン成功です。
[VFS-mysql@tcng002 mysql]$ mysql -p -u dev xoops
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 4.0.21
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
東京在住。
ソフトウェアエンジニア。学生の頃は DEC System-20/Tops-20,
DEC VAX-11/730/DCL, DEC VAX-11/780/Unix BSD, IBM 3090-200VF/VPS,
Encore Multilmax/UMAX 4.3, Sun4-280/SunOS4.1 と MS-DOS なぞ
今は亡きマシンと戯れて過ごす。仕事ではUnixとWindowsを使い、
「既にある物をなるべく使う」「効率的に開発する」をポリシーに
直近では XOOPS、PHPやWikiを使ったサイト構築に従事。好きな動物は
ペンギンとホッキョクグマ。先日、旭山動物園にて猛スピードで
泳ぎまくるTUX君とホッキョクグマを見てご満悦。現在フリー。