WordPress構築 〜Linux〜
初歩に戻ってWordPressをインストールしてみる。
環境はAWSが提供するAmazon EC2のAmazon Linux
Amazon LinuxのAMIは最初からapache、php、mysqlがインストールされているのでインストールの必要無し。
WordPressをインターネット上から落としてきます。
# cd /var/www/ # wget http://ja.wordpress.org/wordpress-3.5-ja.zip
解凍〜
unzip wordpress-3.5-ja.zip
もとのzipファイルは不要なので削除
rm wordpress-3.5-ja.zip
# /etc/init.d/httpd start # /etc/init.d/mysqld start
mysqlにログインしてWordPress用のデータベースを作成
mysql -u root -p ※ここでパスワードを聞かれるが何も入力せず、Enterを押せばOK mysql> create database wordpress -> character set utf8; Query OK, 1 row affected (0.00 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | test | | wordpress | +--------------------+ 5 rows in set (0.00 sec) mysql> grant all on wordpress.*to wordpress@localhost identified by 'wordpress'; Query OK, 0 rows affected (0.00 sec)
もちろんapacheのhttpd.confの設定も忘れずに(ぶっちゃけ忘れてて15分ほどつまったw)。忘れてるとapacheの生まれたての画面は表示されるのにwordpressが404エラーになります!
# vim /etc/httpd/conf/httpd.conf 293行目(あたり) - DocumentRoot "/var/www/html" + DocumentRoot "/var/www/" 320行目(あたり) - +
# /etc/rc.d/init.d/httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ] # /etc/init.d/mysqld restart Stopping mysqld: [ OK ] Starting mysqld: [ OK ]
あとはブラウザで下記URLにアクセスするだけ。
http://ec2インスタンスに割り当てたeip/wordpress/
表示された項目を入力し、"インストール"ボタンをクリックすれば「成功しました!」 と表示されるはず。
"ログイン"のボタンを押し、 先ほど入力した情報でログインすれば、あっという間にWordPressの構築完了。
あとは好きにカスタマイズすれば自分好みのWordPressができあがります!!
【感想】
httpd.confは私みたいな知識ない初心者だと見落としちゃいそうなので参考になれば嬉しい...
というよりもWordPressはすでにAmazon AMIも用意されている(参考: http://ja.megumi-cloud.com/)のでもういちからWordPressをインストールなんてすることはなさそうですがw