最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【记录】Linode的CentOS中通过LNMP去创建ftp并上传网站文件

CentOS crifan 3563浏览 0评论

折腾:

【记录】Linode的CentOS中去初始化和配置LNMP

后,需要去通过ftp上传之前备份好的网站文件。

先去创建ftp。

LNMP下FTP服务器的安装和使用(Pureftpd和Proftpd) – LNMP一键安装包

回到lnmp1.4目录下去执行:

./pureftpd.sh

然后就安装完毕了:

./pureftpd.sh
Copy configure files…
mkdir: cannot create directory usr/local/pureftpd/etc File exists
Add pureftpd service at system startup…
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
1001
Starting pureftpd…
Starting Pure-FTPd…  done
+———————————————————————-+
| Install Pure-FTPd completed,enjoy it!
| =>use command: lnmp ftp {add|list|del|show} to manage FTP users.
+———————————————————————-+
| For more information please visit https://lnmp.org
+———————————————————————-+

然后去添加ftp的用户

[root@crifan lnmp1.4]# ls /home/wwwroot/
crifan  www.crifan.com
[root@crifan lnmp1.4]# lnmp ftp add     
+——————————————-+
|    Manager for LNMP, Written by Licess    |
+——————————————-+
|              https://lnmp.org             |
+——————————————-+
Enter ftp account name: crifan
Enter password for ftp account crifan: xxxx
Enter directory for ftp account crifan: /home/wwwroot/
Password:
Enter it again:
Created FTP User: crifan Sucessfully.

然后去去用filezilla去登录看看

【整理】Mac中好用的FTP工具软件

【已解决】lnmp创建了ftp后无法登录:响应 SSH-2.0-OpenSSH_6.6.1 错误 无法和 SFTP 服务器建立 FTP 连接,请选择合适的协议

然后试试通过Filezilla去上传之前备份的文件。

先去上传mysql文件:

 

速度大概有500KB,还不错。

继续传4G多的文件,结果速度就只有200多KB了

另外,为了wwwroot中全部用于放置我的Wordpress的文件,所以把之前lnmp的文件都移动到单独的lnmp文件夹了:

[root@crifan home]# cd wwwroot/
[root@crifan wwwroot]# ll
total 8
drwxr-xr-x 3 www www 4096 Sep  5 09:57 crifan
drwxr-xr-x 3 www www 4096 Sep  5 11:01 www.crifan.com
[root@crifan wwwroot]# cd crifan/
[root@crifan crifan]# ll
total 84
-rw-r–r–  1 root root  2781 Sep  5 09:57 index.html
-rw-r–r–  1 root root  5683 Sep  5 09:57 lnmp.gif
-rw-r–r–  1 root root 20256 Sep  5 09:57 ocp.php
-rw-r–r–  1 root root    20 Sep  5 09:57 phpinfo.php
drwxr-xr-x 14 www  www   4096 Sep  5 09:57 phpmyadmin
-rw-r–r–  1 root root 42609 Sep  5 09:57 p.php
[root@crifan crifan]# mkdir lnmp
[root@crifan crifan]# mv index.html lnmp.gif ocp.php phpinfo.php p.php lnmp/
[root@crifan crifan]# ll
total 8
drwxr-xr-x  2 root root 4096 Sep  5 11:08 lnmp
drwxr-xr-x 14 www  www  4096 Sep  5 09:57 phpmyadmin
[root@crifan crifan]# mv phpmyadmin lnmp/
[root@crifan crifan]# ll
total 4
drwxr-xr-x 3 root root 4096 Sep  5 11:09 lnmp
[root@crifan crifan]# cd lnmp/
[root@crifan lnmp]# ll
total 84
-rw-r–r–  1 root root  2781 Sep  5 09:57 index.html
-rw-r–r–  1 root root  5683 Sep  5 09:57 lnmp.gif
-rw-r–r–  1 root root 20256 Sep  5 09:57 ocp.php
-rw-r–r–  1 root root    20 Sep  5 09:57 phpinfo.php
drwxr-xr-x 14 www  www   4096 Sep  5 09:57 phpmyadmin
-rw-r–r–  1 root root 42609 Sep  5 09:57 p.php
[root@crifan lnmp]#

对于之前的理解:

到底是放网站文件到:

/home/wwwroot/crifan

还是:

/home/wwwroot/www.crifan.com

搜:

lnmp 什么是虚拟主机

参考了:

VPS+LNMP+WordPress搭建个人网站/博客 – jwcyber

http://www.jwcyber.com/build-site/comment-page-5/#3

之后,感觉应该是后者:

/home/wwwroot/www.crifan.com

-》等文件上传完毕后,需要去放到www.crifan.com中。

【记录】从fzhost搬家crifan.com到Linode的Atlanta的VPS

后续已确定此处的sftp只是SSH协议的用户,用的是root账号。

所以就无须pureftpd了。

那么就把之前安装的:

Pure-FTPd去卸载掉:

./pureftpd.sh uninstall 

并且lnmp去del掉之前添加的账号

lnmp ftp del

[root@crifan ~]# cd lnmp1.4
[root@crifan lnmp1.4]# ll
total 92
-rwxr-xr-x 1 root root  8647 Jun  1 14:06 addons.sh
-rw-r–r– 1 root root 11290 Jun  1 14:06 ChangeLog
drwxr-xr-x 3 root root  4096 Aug 23 21:47 conf
drwxr-xr-x 2 root root  4096 Aug 19 11:28 include
drwxr-xr-x 2 root root  4096 May 29 08:43 init.d
-rwxr-xr-x 1 root root  5777 Aug  1 22:12 install.sh
-rw-r–r– 1 root root   209 Jul  3  2016 License
-rwxr-xr-x 1 root root   313 Sep  4 21:23 lnmp.conf
-rwxr-xr-x 1 root root  4806 Jun  1 14:06 pureftpd.sh
-rw-r–r– 1 root root  6137 Jun  1 14:08 README
drwxr-xr-x 6 root root  4096 Sep  5 10:31 src
drwxr-xr-x 2 root root  4096 Apr  1 09:49 tools
-rwxr-xr-x 1 root root  6460 Jun  1 14:06 uninstall.sh
-rwxr-xr-x 1 root root  2567 Jun 12 21:27 upgrade1.x-1.4.sh
-rwxr-xr-x 1 root root  2777 Jun  1 14:06 upgrade.sh
[root@crifan lnmp1.4]# ./pureftpd.sh uninstall
+———————————————————-+
|          Pureftpd for LNMP,  Written by Licess           |
+———————————————————-+
|This script is a tool to install pureftpd for LNMP        |
+———————————————————-+
|For more information please visit https://lnmp.org        |
+———————————————————-+
|Usage: ./pureftpd.sh                                      |
+———————————————————-+
Stop pureftpd…
Stopping Pure-FTPd…   done
Remove service…
Removing pureftpd service at system startup…
Delete files…
Pureftpd uninstall completed.
[root@crifan lnmp1.4]# lnmp ftp del
+——————————————-+
|    Manager for LNMP, Written by Licess    |
+——————————————-+
|              https://lnmp.org             |
+——————————————-+
Pureftpd was not installed!
[root@crifan lnmp1.4]# lnmp ftp list
+——————————————-+
|    Manager for LNMP, Written by Licess    |
+——————————————-+
|              https://lnmp.org             |
+——————————————-+
Pureftpd was not installed!
[root@crifan lnmp1.4]#

此处,上传文件速度又变慢了:

只有80多KB了。。郁闷了。要上传大半天了。

断开WiFi换另外一个WiFi,重新传,速度快一点了,有150KB左右

但是后来速度一直在100KB左右徘徊

又切换为另外一个WI-FI,速度又好一点了:300KB多

最后终于上传完毕了:

然后去解压缩:

[root@crifan ~]# cd /home/wwwroot/www.crifan.com/
[root@crifan www.crifan.com]# ll
total 4450804
-rwxr-xr-x 1 root root  148725546 Sep  5 10:59 crifan_com_db_wp_20170904.sql
-rwxr-xr-x 1 root root 4408887879 Sep  5 18:25 crifan_com_files_20170828.tar.bz2
[root@crifan www.crifan.com]# tar xvjf crifan_com_files_20170828.tar.bz2

然后移动到对应的文件到对应的目录下。

此处是移动到之前新建vhost虚拟主机的根目录:

/home/wwwroot/www.crifan.com/

中,即可。

转载请注明:在路上 » 【记录】Linode的CentOS中通过LNMP去创建ftp并上传网站文件

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.167 seconds, using 22.14MB memory