在同一网络中远程访问文件

时间:2016-04-03 19:03:57

标签: http curl command-line wget

我正在尝试使用wget远程访问某些文件,使用curl over HTTP协议,但我只选择“HTTP / 1.1 404 Not Found”

我需要访问的文件位于文件夹/ var / www / html中,启动了带有Ubuntu的Apache2机器。从另一台Ubuntu机器上我尝试了以下内容:

当我使用以下命令时,我得到“HTTP / 1.1 404 Not Found”

wget "http://222.168.xx.xxx:80/var/www/html/4?action=AttachFile&do=view&target=dns.log"

curl -v http://222.168.xx.xxx:80/var/www/html/dns.log

尝试以下命令,我只获得一个index.html文件: wget 192.168.xx.xxx dns.log

请问,我有什么问题吗?如何使用line命令远程访问文件?

谢谢!

2 个答案:

答案 0 :(得分:0)

http://222.168.xx.xxx:80/是“文档根”,因此该站点开始从该目录提供文档。

换句话说:/var/www已经指向<div class="container" ng-controller = "mycontroll"> <div class="col-md-4" ng-repeat="video in videos track by $index"> <div class="embed-responsive embed-responsive-16by9"> <iframe width="420" height="315" ng-src="{{video|trustAsResourceUrl}}" frameborder="0" allowfullscreen></iframe> </div> </div> </div><!-- container end --> ,不需要在请求URI中包含后者。

答案 1 :(得分:0)

使用curl发出请求的正确方法是: curl http://222.168.xx.xxx/file_to_download

使用telnet:
telnet 222.168.xx.xxx 80 GET \file_to_download HTTP\1.0