移站是经常的事,现在把步骤写上,防止忘记命令
1.登录SSH
2.打包数据库,phpmyadmin中备份数据库,导入新数据库,数据库中域名链接进行相应替换
获取phpmyadmin root密码 cat /usr/local/directadmin/scripts/setup.txt
3.打包网站:afish、aaaacom等程序路径换成你自己的即可
cd /home/afish/domains/aaaacom
tar -zcvf public_html.tar.gz public_html
4.移动public_html.tar.gz到子目录public_html下
mv public_html.tar.gz /home/afish/domains/aaaacom/public_html
5.若旧站还打得开就可以用远程获取命令,否则只能下载压缩包上传到/home/afish/domains/bbbbcom下面
cd /home/afish/domains/bbbbcom
wget http://aaaacom/public_html.tar.gz
6.解压网站到新目录
cd /home/afish/domains/bbbbcom
tar -zxvf public_html.tar.gz
7.更改文件所属组
cd /home/afish/domains/bbbbcom
chown -R afish:afish public_html
8.文件夹与文件读写权限的修改
cd /home/afish/domains/bbbbcom/public_html
chmod 777 bmz_cache
chmod 777 cache
chmod 777 images
chmod -R 777 images/magicthumbs
chmod -R 777 includes/languages/english/html_includes/*
chmod 755 includes/languages/english/html_includes/classic
chmod 777 tempEP
9.登录FTP,前后台配置文件的修改:数据库、用户、密码、.htaccess文件
configure.php .htaccess
10.最后为了安全,网站设置好之后,将html_includes、tempEP文件夹读写权限恢复为原始
cd /home/afish/domains/bbbbcom/public_html
chmod -R 644 includes/languages/english/html_includes/*
chmod 755 includes/languages/english/html_includes/classic
chmod 755 tempEP
11.若要复制多个站,先使用以下移动命令到新目录,然后重复6到10步骤即可
mv /home/afish/domains/bbbbcom/public_html.tar.gz /home/afish/domains/cccccom
tar -zxvf public_html.tar.gz
打完收工!