用rsync向Dreamhost发布网站

2007-08-20 08:42:59

首先用ssh登录到Dreamhost的服务器上,执行以下命令:

cd $HOME
mkdir .ssh
cd .ssh
touch authorized_keys
chmod go-w $HOME $HOME/.ssh $HOME/.ssh/authorized_keys

在本地终端中执行:

ssh-keygen -t rsa

连续三次回车

rsync -avrz  --progress "/home/shark/.ssh/id_rsa.pub" sharkui@www.sharkui.com:/home/sharkui/.ssh/authorized_keys

注意替换其中的shark、sharkui、www.sharkui.com为你自己的本地用户名、Dreamhost用户名、Dreamhost主机名。

然后执行发布命令:

rsync -avzP --delete --exclude=wp-config.php /var/www/ sharkui@www.sharkui.com:/home/sharkui/sharkui.com/

同样请注意替换其中的用户名和主机名。

/var/www是我的本地测试路径, –exclude=wp-config.php表示不发布wp-config.php文件,因为两边的数据库配置是不一样的,发上去就麻烦了。

2 Responses to “用rsync向Dreamhost发布网站”

  1. 网站源码商城 Says:

    好像这样能大大提高发布网站的速度了。

  2. Supremato Says:

    Hi! Welcome to our free adult dating blog: http://free-adult-dating.thumblogger.com/
    This free adult dating blog is about World’s Largest Adult Social Network and Sex Personals.
    Hot Singles, Hot adult Photos, Real Webcams. Make new friends, find hot singles, wild couples & sexy groups.
    Millions of members. Free Sign Up!!! Click on the banner and join now!!!

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>