cookieisaac
cookieisaac

Reputation: 1407

How to configure apache server to allow wget with proxy?

I'm totally new to the apache httpd stuff

I setup my host ServerHost1 as a file server with httpd

# httpd -v
Server version: Apache/2.4.6 (Red Hat Enterprise Linux)
Server built:   Dec  2 2014 08:09:42

I have put the file TestFile.txt under /var/www/html/TestDir/TestFile.txt

I modified part of the httpd.conf as follow

<Directory />
    Order deny,allow
    Allow from all
</Directory>

On a test host TestHost1 with full Internet access, I can downloaded my file with wget

TestHost1]# wget http://ServerHost1/TestDir/TestFile.txt
--2016-03-17 13:39:12--  http://ServerHost1/TestDir/TestFile.txt
Resolving ServerHost1 (ServerHost1)... <IP address>
Connecting to ServerHost1 (ServerHost1)|<IP address>|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2859976598 (2.7G) [application/octet-stream]
Saving to: ‘TestFile.txt’

2% [>                                                            ] 60,645,376  24.0MB/s 

On the host sitting on a semi-isolated network TestHost2, I have to use proxy for wget to work. It works fine with google

TestHost2]# wget google.ca
--2016-03-17 13:53:26--  http://google.ca/
Resolving proxy.com (proxy.com)... <ProxyIP>
Connecting to proxy.com (proxy.com)|<ProxyIP>|:3128... connected.
Proxy request sent, awaiting response... 301 Moved Permanently
Location: http://www.google.ca/ [following]
--2016-03-17 13:53:26--  http://www.google.ca/
Reusing existing connection to proxy.com:3128.
Proxy request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html’

    [ <=>                                   ] 19,928      --.-K/s   in 0.1s

2016-03-17 13:53:27 (159 KB/s) - ‘index.html’ saved [19928]

However when I try to get my file from ServerHost1, it gets ERROR 503: Service Unavailable

TestHost2]# wget http://ServerHost1/TestDir/TestFile.txt
--2016-03-17 13:57:13--  http://ServerHost1/TestDir/TestFile.txt
Resolving proxy.com (proxy.com)...<ProxyIP>
Connecting to proxy.com (proxy.com)|<ProxyIP>|:3128... connected.
Proxy request sent, awaiting response... 503 Service Unavailable
2016-03-17 13:57:13 ERROR 503: Service Unavailable.

So the question is

(1) Why am I seeing 503 ServiceUnavailable when the file is apparently available (since I can downloaded from testhost1)?

(2) How do I configure my httpd.conf file so that TestHost2 can wget the file from ServerHost1?

Upvotes: 0

Views: 1920

Answers (1)

user6085494
user6085494

Reputation:

Maybe try with ProxyRequests as described in Apache docs https://httpd.apache.org/docs/2.4/mod/mod_proxy.html

Upvotes: 1

Related Questions