WordPressをUbuntu Serverにインストールするメモ

/ WordPress / Comment[0]
LAMP必須
$ sudo apt-get install apache2 mysql-server php5 php5-mysql
php5-mysqlもインストールしないと「お使いのサーバーのPHPではWordPressに必要なMySQL拡張を利用できないようです。」と表示される。

  1. MySQLにWordPress用のデータベースを作る
  2. $ mysql -u root
    mysql> CREATE DATABASE wordpress;
    mysql> GRANT ALL PRIVILEGES ON wordpress.* TO "testuser"@"localhost" IDENTIFIED BY "xxxyyy123";
    mysql> exit

  3. WordPressをダウンロード
  4. $ sudo -u www-data bash ←ログインせずに権限だけを使ってbashを起動する小ワザ
    $ cd /var/www
    $ wget http://ja.wordpress.org/wordpress-3.9.1-ja.tar.gz

  5. WordPressをDocumentRootに展開
  6. $ tar xf wordpress-3.9.1-ja.tar.gz

  7. WordPressのルートディレクトリにwp-config.phpを作る
  8. $ cd wordpress
    $ vi wp-config.php

    wp-config.phpテンプレ
    <?php
    mb_language('Japanese');
    mb_internal_encoding('UTF-8');

    //mysqlで設定したものを入力
    define('DB_NAME', 'wordpress');
    define('DB_USER', 'testuser');
    define('DB_PASSWORD', 'xxxyyy123');
    define('DB_HOST', 'localhost');
    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');

    $table_prefix = 'wp_';

    define('WPLANG', 'ja');
    define('ABSPATH', dirname(_FILE_).'/');

    require_once(ABSPATH.'wp-settings.php');
    ?>

http://server/wordpressにアクセスするとアカウントの作成ウィザードが表示される。
関連記事

コメント

:
:
:
:
:
管理人のみ表示を許可