Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have setup my apache to act as proxy server by configuring it as:

[server]# cat /etc/apache2/httpd.conf
Listen 10.2.28.56:8787
ProxyRequests on
<Proxy *>
    Order deny,allow
    Deny from all
    Allow from 10.2.0.0/16
</Proxy>

and a client at 10.2.1.85 uses yum to update/install system packages via this proxy:

[client]# grep proxy /etc/yum.conf
proxy='http://10.2.28.56:8787'

I also have proper environment variables for proxy usage as follows:

[client]# cat .bashrc
mytunnel='http://102.28.56:8787'
export http_proxy=$mytunnel
export ftp_proxy=$mytunnel
export HTTP_PROXY=$http_proxy
export FTP_PROXY=$ftp_proxy

When yum tries to update its repositories, it complains about connection times out for certain FTP links as follows

[client]# yum -v repolist
Loading "fastestmirror" plugin
Loading "protectbase" plugin
Config time: 0.067
Yum Version: 3.2.22
Loading mirror speeds from cached hostfile
 * base: ftp.oss.eznetsols.org
 * centosplus: ftp.oss.eznetsols.org
 * extras: ftp.oss.eznetsols.org
 * rpmforge: apt.sw.be
 * updates: ftp.oss.eznetsols.org
ftp://ftp.oss.eznetsols.org/linux/centos/5.7/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout: <urlopen error timed out>
Trying other mirror.

I can curl or wget the complaining URL as follows (I have proper *_proxy env vars):

[client]# wget ftp://ftp.oss.eznetsols.org/linux/centos/5.7/os/x86_64/repodata/repomd.xml
--2011-11-30 03:28:33--  ftp://ftp.oss.eznetsols.org/linux/centos/5.7/os/x86_64/repodata/repomd.xml
Connecting to 10.2.28.56:8787... connected.
Proxy request sent, awaiting response... 200 OK
Length: 1140 (1.1K) [application/xml]
Saving to: `repomd.xml'

I am guessing that the FTP connection from yum is not forwarded properly by my Apache Proxy server as I can see that its trying to connect to wrong port by looking at apache2 error logs as:

[server]# tail -n1 /var/log/apache2/error.log
[Wed Nov 30 15:50:39 2011] [error] (110)Connection timed out: proxy: FTP: attempt to connect to 111.90.255.253:8787 (*) failed
[server]# host 111.90.255.253
253.255.90.111.in-addr.arpa domain name pointer ftp.oss.eznetsols.org.

The [server]# is a debian (ubuntu 11.04 desktop) while [client]# is CentOS-5.7 (yeah, I can see you are laughing)
What am I missing here?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.