ssh-keygen
git clone git@github.com:mlzboy/geilibuy-blog.git wordpress
cd ~/wordpress/public
从远程下载一份数据库的配置文件到本地
scp mlzboy@boy38girl.com:/home/mlzboy/wordpress/shared/wp-config.php .
cd ~/wordpress/config
从别的地方复制deploy.rb到此目录下
cd ~/wordpress
mkdir sql
cap -T
cap sync:down
在本地创建博客数据库
mysql -uroot -pxxxx
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| b2c2_production |
| mysql |
+--------------------+
3 rows in set (0.02 sec)
mysql> create database b2c2_blog;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| b2c2_blog |
| b2c2_production |
| mysql |
+--------------------+
4 rows in set (0.00 sec)
导入远程数据库下载来的备份
mysql -uroot -pzhoubt b2c2_blog
<pre><span style="font-family: 'Gentium Basic',Garamond,Palatino,Georgia,serif; white-space: normal; font-size: 16px; color: rgb(51, 51, 51); line-height: 24px;"><div><div id="highlighter_701631" class="syntaxhighlighter bash" style=" 625px; margin: 1em 0px ! important; position: relative ! important; overflow: auto ! important; font-size: 1em ! important; background-color: white ! important;"><table style="background-image: none ! important; bottom: auto ! important; float: none ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; outline- 0px ! important; overflow: visible ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; 625px; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-weight: normal ! important; font-style: normal ! important; font-size: 1em ! important; min-height: inherit ! important; padding: 0px ! important; margin: 0px ! important;" border="0" cellpadding="0" cellspacing="0"><tbody style="background-image: none ! important; bottom: auto ! important; float: none ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; outline- 0px ! important; overflow: visible ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; auto ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-weight: normal ! important; font-style: normal ! important; font-size: 1em ! important; min-height: inherit ! important; padding: 0px ! important; margin: 0px ! important;"><tr style="background-image: none ! important; bottom: auto ! important; float: none ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; outline- 0px ! important; overflow: visible ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; auto ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-weight: normal ! important; font-style: normal ! important; font-size: 1em ! important; min-height: inherit ! important; padding: 0px ! important; margin: 0px ! important;"><td class="code" style="background-image: none ! important; bottom: auto ! important; float: none ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; outline- 0px ! important; overflow: visible ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; 588px; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-weight: normal ! important; font-style: normal ! important; font-size: 1em ! important; min-height: inherit ! important; padding: 0px ! important; margin: 0px ! important;"><div class="container" style="background-image: none ! important; bottom: auto ! important; float: none ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; outline- 0px ! important; overflow: visible ! important; position: relative ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; auto ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-weight: normal ! important; font-style: normal ! important; font-size: 1em ! important; min-height: inherit ! important; padding: 0px ! important; margin: 0px ! important;"> <div class="line number1 index0 alt2" style="background-image: none ! important; background-color: white ! important; bottom: auto ! important; float: none ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; outline- 0px ! important; overflow: visible ! important; padding: 0px 1em ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; auto ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-weight: normal ! important; font-style: normal ! important; font-size: 1em ! important; min-height: inherit ! important; white-space: pre ! important; margin: 0px ! important;"><code class="bash plain" style="overflow: visible ! important; background-image: none ! important; bottom: auto ! important; float: none ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; outline- 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; auto ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-weight: normal ! important; font-style: normal ! important; font-size: 1em ! important; min-height: inherit ! important; color: black ! important; padding: 0px ! important; margin: 0px ! important;">sudo apt-get </code><code class="bash functions" style="overflow: visible ! important; background-image: none ! important; bottom: auto ! important; float: none ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; outline- 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; auto ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-weight: normal ! important; font-style: normal ! important; font-size: 1em ! important; min-height: inherit ! important; color: rgb(255, 20, 147) ! important; padding: 0px ! important; margin: 0px ! important;">install</code> <code class="bash plain" style="overflow: visible ! important; background-image: none ! important; bottom: auto ! important; float: none ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; outline- 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; auto ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-weight: normal ! important; font-style: normal ! important; font-size: 1em ! important; min-height: inherit ! important; color: black ! important; padding: 0px ! important; margin: 0px ! important;">python-software-properties</code></div> <div class="line number2 index1 alt1" style="background-image: none ! important; background-color: white ! important; bottom: auto ! important; float: none ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; outline- 0px ! important; overflow: visible ! important; padding: 0px 1em ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; auto ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-weight: normal ! important; font-style: normal ! important; font-size: 1em ! important; min-height: inherit ! important; white-space: pre ! important; margin: 0px ! important;"><code class="bash plain" style="overflow: visible ! important; background-image: none ! important; bottom: auto ! important; float: none ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; outline- 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; auto ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-weight: normal ! important; font-style: normal ! important; font-size: 1em ! important; min-height: inherit ! important; color: black ! important; padding: 0px ! important; margin: 0px ! important;">sudo add-apt-repository ppa:brianmercer</code><code class="bash plain" style="overflow: visible ! important; background-image: none ! important; bottom: auto ! important; float: none ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; outline- 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; auto ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-weight: normal ! important; font-style: normal ! important; font-size: 1em ! important; min-height: inherit ! important; color: black ! important; padding: 0px ! important; margin: 0px ! important;">/php</code></div> <div class="line number3 index2 alt2" style="background-image: none ! important; background-color: white ! important; bottom: auto ! important; float: none ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; outline- 0px ! important; overflow: visible ! important; padding: 0px 1em ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; auto ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-weight: normal ! important; font-style: normal ! important; font-size: 1em ! important; min-height: inherit ! important; white-space: pre ! important; margin: 0px ! important;"><code class="bash plain" style="overflow: visible ! important; background-image: none ! important; bottom: auto ! important; float: none ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; outline- 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; auto ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-weight: normal ! important; font-style: normal ! important; font-size: 1em ! important; min-height: inherit ! important; color: black ! important; padding: 0px ! important; margin: 0px ! important;">sudo apt-get update</code></div> </div> </td> </tr> </tbody> </table> </div> </div> </span>
sudo apt-get
install
php5-fpm php5-mysql
<span style="font-family: 微软雅黑,Arial,Helvetica,sans-serif; white-space: normal; font-size: 12px; color: rgb(17, 0, 0);"> <pre class="bash" style="outline- 0px; vertical-align: baseline; background-color: transparent; padding: 8px 0px 5px 10px; auto; white-space: pre; font-family: monospace; clear: none; overflow: visible; font-size: 12px; line-height: 1.333; margin: 0px; border: 1px solid rgb(221, 221, 221);">sudo service php5-fpm start<br />确认nginx.conf中有以下的节
server {
listen 80 ;
server_name blog.geilibuy.com;
#access_log /var/log/nginx/localhost.access.log;
index index.php index.htm index.html;
#root /var/www/wordpress;
#root /home/mlzboy/wordpress/current/public;
root /home/mlzboy/my/wordpress/public;
expires 7d;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param APPLICATION_ENV production;
include fastcgi.conf;
expires off;
}
}
红色路径的部分需要正确
参考
http://www.cnblogs.com/lexus/archive/2011/02/11/1951283.html
确认/etc/hosts下有如下配置
127.0.0.1 tuan.geilibuy.com
127.0.0.1 geilibuy.com
127.0.0.1 www.geilibuy.com
127.0.0.1 i0.geilibuy.com
127.0.0.1 i1.geilibuy.com
127.0.0.1 i2.geilibuy.com
127.0.0.1 i3.geilibuy.com
127.0.0.1 i4.geilibuy.com
127.0.0.1 blog.geilibuy.com
更必原先wp-config.php
中的数据库用户为
root
zzzzzzz
这样就省得设置单独的用户名和密码了,但是安全性上也要差一些了
![](http://img.zemanta.com/pixy.gif?x-id=5956fdd8-78b3-8958-82be-c04c5832a7d0)