将文件从虚拟 Linux 计算机传输到 Digital Ocean 服务器
Transferring files from virtual Linux computer to Digital Ocean server
我的 Windows PC 上安装了虚拟 Linux 计算机。在 Linux 计算机中,我有一个正在运行的 PHP 网站,其中包含多个文件、模板等。我正在尝试将其从我自己的虚拟 Linux 服务器上移到 Digital Ocean 上,感觉就像我错过了什么。有什么方法可以将所有文件夹和文件从一个系统复制到另一个系统?我无法使用 Digital Ocean 找到任何类型的 'Windows Explorer'-y file/folder 界面。
我尝试了本教程,但卡在了 'put localFile' 步骤:
这对任何人都有意义吗?非常感谢任何帮助。
一种简单的方法是对您的本地站点进行 gzip 压缩并将其推送到您的 DO
站点
假设您的网站位于 /var/www/html/..
中的本地 VM 上
因此在您的虚拟机 /var/www
中执行
root@yourvm:/var/www# tar -zcvf website.tar.gz html
然后将文件 website.tar.gz 复制到您的 DO 帐户(假设您的 VM 已连接到互联网)
root@yourvm:/var/www# scp website.tar.gz username@doserver.com:/home/username/
然后当您登录到 DO 时,将您的网站解压缩到 /var/www/html/
、
root@yourvm:/#tar -zxvf /home/username/website.tar.gz -C /var/www/
如果您正在寻找 "windows explorer" 近似值,您可以简单地使用 filezilla - 我已经将它与 digital ocean droplet 一起使用。配置连接后 - 它几乎是一个 gui 界面。
这里是Digital Ocean tutorial on securely setting up filezilla
这是页面简介,听起来它可能适用于您的情况:
Are you a recent cloud hosting convert and find yourself struggling to
figure out how to best manage the files on your first virtual private
server (VPS)? Do you find yourself intimidated by the command line? If
so, you will be happy to learn that FileZilla provides a user-friendly
graphical interface that can securely transfer files to-and-from, as
well as move files around within, your VPS
注意:我将此作为 "simplest option possible" 答案提供,我个人不再使用 filezilla,因为传输文件需要很长时间。提到的其他答案,例如rsync
或压缩和传输将是我现在的方式 - 更快!
我的 Windows PC 上安装了虚拟 Linux 计算机。在 Linux 计算机中,我有一个正在运行的 PHP 网站,其中包含多个文件、模板等。我正在尝试将其从我自己的虚拟 Linux 服务器上移到 Digital Ocean 上,感觉就像我错过了什么。有什么方法可以将所有文件夹和文件从一个系统复制到另一个系统?我无法使用 Digital Ocean 找到任何类型的 'Windows Explorer'-y file/folder 界面。
我尝试了本教程,但卡在了 'put localFile' 步骤:
这对任何人都有意义吗?非常感谢任何帮助。
一种简单的方法是对您的本地站点进行 gzip 压缩并将其推送到您的 DO
站点
假设您的网站位于 /var/www/html/..
因此在您的虚拟机 /var/www
中执行
root@yourvm:/var/www# tar -zcvf website.tar.gz html
然后将文件 website.tar.gz 复制到您的 DO 帐户(假设您的 VM 已连接到互联网)
root@yourvm:/var/www# scp website.tar.gz username@doserver.com:/home/username/
然后当您登录到 DO 时,将您的网站解压缩到 /var/www/html/
、
root@yourvm:/#tar -zxvf /home/username/website.tar.gz -C /var/www/
如果您正在寻找 "windows explorer" 近似值,您可以简单地使用 filezilla - 我已经将它与 digital ocean droplet 一起使用。配置连接后 - 它几乎是一个 gui 界面。
这里是Digital Ocean tutorial on securely setting up filezilla
这是页面简介,听起来它可能适用于您的情况:
Are you a recent cloud hosting convert and find yourself struggling to figure out how to best manage the files on your first virtual private server (VPS)? Do you find yourself intimidated by the command line? If so, you will be happy to learn that FileZilla provides a user-friendly graphical interface that can securely transfer files to-and-from, as well as move files around within, your VPS
注意:我将此作为 "simplest option possible" 答案提供,我个人不再使用 filezilla,因为传输文件需要很长时间。提到的其他答案,例如rsync
或压缩和传输将是我现在的方式 - 更快!