Wordpress 3.2.1 のインストール手順

今度は Wordpress 3.2.1 のダウンロード。
サーバーの /var/www/wordpress にファイルを置くことにして…

[paraches@localhost myTest]$ cd /var/www
[paraches@localhost www]$ sudo wget http://ja.wordpress.org/wordpress-3.2.1-ja.zip
[paraches@localhost www]$ sudo unzip wordpress-3.2.1-ja.zip 

設定ファイルをコピーして編集。

[paraches@localhost www]$ cd wordpress
[paraches@localhost wordpress]$ sudo cp wp-config-sample.php wp-config.php

変更点は以下の通り

// ** MySQL 設定 - こちらの情報はホスティング先から入手してください。 ** //
/** WordPress のためのデータベース名 */
define('DB_NAME', 'wordpress');

/** MySQL データベースのユーザー名 */
define('DB_USER', 'wordpress');

/** MySQL データベースのパスワード */
define('DB_PASSWORD', 'xxxxxxxx');

わかり易くデータベース名を「wordpress」、データベースのユーザ名を「wordpress」とした。
データベースのパスワード(上の例ではxxxxxxxx)は適当に。(後で MySQL のデータベースを作る時に必用になるので忘れない様に。)


MySQL の設定
MySQLWordpress 用のデータベースを作る。
まずは MySQL を起動。今まで使ったことがないので、これが MySQL 最初の起動。

[paraches@localhost wordpress]$ sudo /etc/init.d/mysqld start
MySQL データベースを初期化中:  Installing MySQL system tables...
OK
Filling help tables...
OK

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:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

                                                           [  OK  ]
mysqld を起動中:                                           [  OK  ]
[paraches@localhost wordpress]$ 


で、パスワードの設定やら色々とやってくれるスクリプトを起動

[paraches@localhost wordpress]$ sudo /usr/bin/mysql_secure_installation 




NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] Y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!

「Set root password? [Y/n]」には Y と答えて、その後で root のパスワードを2回入力。

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

「Remove anonymous users? [Y/n]」にも Y と答える。これで anonymous ユーザが削除される。

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

「Disallow root login remotely? [Y/n]」にも Y と答える。これでリモートで root ユーザとしてアクセスできなくなる。

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

「Remove test database and access to it? [Y/n]」にも Y と答える。これで最初から入っている test データベースが削除される。

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

「Reload privilege tables now? [Y/n]」にも Y と答える。これで結果が反映されたテーブルがリロードされる。

Cleaning up...



All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!


[paraches@localhost wordpress]$ 

というわけで、最初の MySQL の設定終了。


設定が終わったら、今度は Wordpress 用のデータベースを作って Wordpress のユーザを作る。

[paraches@localhost wordpress]$ sudo mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.1.52 Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MySQL に root でアクセスしたら…

mysql> create database wordpress;
Query OK, 1 row affected (0.00 sec)

mysql> grant all privileges on wordpress.* to wordpress@localhost identified by 'xxxxxxxx';
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
[paraches@localhost wordpress]$ 

2回コマンド入力して exit で終了。
'xxxxxxxx' は wp-config.php に書いたパスワード。
これで Wordpress 用のデータベース作成も OK。


apache の設定
今回は http://localhost/wordpress にアクセスすると Wordpress のページが表示される様にする。

Wordpress 用の設定ファイルを作って読み込ませる。

[paraches@localhost wordpress]$ cd /etc/httpd/conf.d/
[paraches@localhost conf.d]$ sudo echo "Alias /wordpress /var/www/wordpress" > wordpress.conf 
[paraches@localhost conf.d]$ cat wordpress.conf 
Alias /wordpress /var/www/wordpress

[paraches@localhost conf.d]$ sudo /etc/init.d/httpd reload
httpd を再読み込み中: 
[paraches@localhost conf.d]$ 

で、OK。
Firefox 5 で http://localhost/wordpress にアクセスすると…

後はサイトのタイトル入れて、admin のパスワード入れてメールアドレス入れて進めば OK!

「ログイン」ボタンをクリックしたらダッシュボードへのログイン画面!