关于通过http请求访问Linux下的ftp的问题以及解决办法

欢迎大家关注我的公众号,添加我为好友!

今天在学习ssm商城的时候安装好了虚拟机,装好了CentOS,配置好了NGINX服务器,也配置好了Linux自带的ftp,但是通过http访问的时候却不能实现。情况如下:

我使用的“FileZilla”工具访问:

但是从网页上就是不能够访问。

解决办法:

1.首先进入到NGINX配置文件下面:

 

然后继续往下:

 

其中 “server_name”表示的是本机IP 也可设置成 “localhost”,“location”表

示本地的意思 。

先看根目录“root  /home/ftpuser/hry/”表示的是根路径,

“images”表示本地路径。

区别 比如访问路径“http://192.168.64.128/home/ftpuser/hry/images”

设置了根路径之后就可以更改为“http://192.168.64.128//images”

代码:

 server {
        listen       80;
        server_name  192.168.64.128;
        location / {
            root   html;
            index  index.html index.htm;
        }
        location /images/ {
            root   /home/ftpuser/hry/;
            autoindex on;
        }

还有一个就是查看“ vi /etc/vsftpd.conf”配置如下,必须一致。

anonymous_enable=NO
# 禁止匿名用户登陆
# Uncomment this to allow local users to log in.
local_enable=YES
 # 允许本地用户登陆
# Uncomment this to enable any form of FTP write command.
write_enable=YES
 # 可以进行写操作
# Default umask for local users is 077. You may wish to change this to 022,
#if your users expect that (022 is used by most other ftpd's)
local_umask=022
# 上传文件的权限 默认没有读的权限
# It is recommended that you define on your system a unique user which the

最后,感谢被我搜索过的文章,然后才总结出这一篇文章,谢谢!!!

欢迎大家关注我的公众号,添加我为好友!

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值