虚拟主机没有性价比,所以迁移到aws(ubuntu 12.04 x64).

全流程如下

#安装服务
sudo apt-get install apache2
sudo apt-get install mysql-server mysql-client
sudo apt-get install php5 php5-gd php5-mysql php5-curl
sudo apt-get install phpmyadmin
#rewrite 模块
sudo a2enmod rewrite
#编辑配置文件
sudo vi /etc/apache2/apache2.conf
#添加以下行后保存退出(也许未必需要)
ServerName 127.0.0.1
AddDefaultCharset UTF-8
AddType application/x-httpd-php .php .htm .html
#进入数据库
/usr/bin/mysql -u root -p
#建立数据库
CREATE DATABASE databasename;
CREATE USER databaseuser@localhost;
SET PASSWORD FOR databaseuser@localhost= PASSWORD("databasepassword");
GRANT ALL PRIVILEGES ON databasenamel5beta.* TO databaseuser@localhost IDENTIFIED BY 'databasepassword';
FLUSH PRIVILEGES;
#导入数据库
use databasename
source link-to-your-sql.sql
#### aws 需要使用/swap来避免数据库crash ####
sudo dd if=/dev/zero of=/swapfile bs=1M count=1024
sudo mkswap /swapfile
sudo swapon /swapfile
#### 在/etc/fstab中加入
/swapfile swap swap defaults 0 0
#文件目录
mkdir wordpress
cd wordpress
tar -xzvf your-wordpress-files.tar.gz .
#权限
sudo chown -R www-data .
#链接
sudo ln -s your-path-to/wordpress /var/www
#编辑 virtual host
##从默认复制一份
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/your-host-name.com
##编辑
sudo vi /etc/apache2/sites-available/your-host-name.com
##添加
ServerName your-host-name.com
ServerAlias www.your-host-name.com
DocumentRoot /var/www/wordpress
##保存退出后,添加站点
sudo a2ensite wordpress
#修改 /etc/apache2/sites-available/default 
#和 /etc/apache2/sites-available/your-host-name.com 的 
#<Directory /var/www/>
AllowOverride All

#重启服务
sudo service apache2 restart

#最后解析域名到主机ip,完成

参考资料

http://hi.baidu.com/sf_chipan/item/b13567d71378666bddf9beaa

https://www.digitalocean.com/community/articles/how-to-install-wordpress-on-ubuntu-12-04

http://stackoverflow.com/questions/10284532/amazon-ec2-mysql-aborting-start-because-innodb-mmap-x-bytes-failed-errno-12