使用CPAN与一个代理失败后o conf init / proxy / [英] Using CPAN with a proxy failing after o conf init /proxy/

查看:417
本文介绍了使用CPAN与一个代理失败后o conf init / proxy /的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在公司环境中有一个Linux盒,其中通过需要身份验证的代理来访问Web访问。



在第一次运行cpan时,它会自动配置它通常执行的操作:


自动配置除urllist之外的所有内容。
现在请调用'o conf init urllist'来配置您的CPAN服务器。



commit:written'/usr/lib/perl5/5.10。 0 / CPAN / Config.pm'


知道我有一个代理来浏览,并且已经阅读了文档和几页web about proxy and cpan I:


cpan [1]> o conf init / proxy /



如果您通过代理访问网络,可以在
CPAN配置中或通过环境变量指定它们。
$ CPAN :: Config中的变量优先。



您的ftp_proxy? []



您的http_proxy? [] 10.12.8.9:3128



您的no_proxy? []



如果您的代理是验证代理,您可以永久存储您的用户名
。如果你不想要,只需按返回。



您的代理用户ID是什么? [] my_net_id



您的验证代理密码也可以永久保存在磁盘上
。如果这违反了您的安全策略,只需按
返回。



CPAN:Term :: ReadKey loaded ok(v2.30)
您的帐户代理密码?
请记住调用'o conf commit'以使配置永久!



cpan [2]> o conf commit
commit: /usr/lib/perl5/5.10.0/CPAN/Config.pm'


现在应该都好了,对吧?
所以我希望,


cpan [3]> i / Some :: Module /
CPAN: ok(v2.18)



我想连接到以下网站之一以获得
'authors / 01mailrc.txt.gz':

http://www.perl.org/CPAN/ ftp://ftp.perl.org/pub/CPAN/



尝试连接到互联网是否可以? [yes] LWP不可用



使用/ usr / bin / curl -L -f -s -S --netrc-optional尝试获取
http://www.perl.org/CPAN/authors/01mailrc.txt.gz curl :(22)请求的URL返回错误:407



系统调用/ usr / bin / curl -L -f -s -S --netrc-optional
http://www.perl.org/CPAN/authors/01mailrc.txt.gz>
/root/.cpan/sources/authors/01mailrc.txt.tmp29726
返回状态22(wstat 5632)警告:预期文件[/root/.cpan/sources/authors/01mailrc.txt.gz.tmp29726]不存在



尝试使用 / usr / bin / wget -O
/root/.cpan/sources/authors/01mailrc.txt.tmp29726获取
http://www.perl.org/CPAN/authors/01mailrc.txt.gz
--2012-07-17 15:57:38- - http://www.perl.org/CPAN/authors/01mailrc.txt.gz 正在连接到
10.12.8.9:3128 ...已连接。代理请求已发送,正在等待响应... 301永久移动位置:
http://www.cpan。 org / authors / 01mailrc.txt.gz [以下]
--2012-07-17 15:57:38-- http://www.cpan.org/authors/01mailrc.txt.gz 连接到10.12.8.9:3128 ...已连接。代理请求已发送,
正在等待响应... 407需要代理验证
2012-07-17 15:57:38错误407:需要代理验证。


那么密码提示在哪里?



配置cpan通过公司代理通过身份验证访问互联网时缺少什么?

解决方案

安装LWP。 cpan实用程序正在使用curl,我猜是因为它无法加载LWP。没有代理参数传递到curl,因此您需要在运行命令之前导出http_proxy = http:// host:port /。



或者,如果可以安装LWP使用您的分发的软件包管理器,那么它应该正确配置代理访问。


I have a Linux box in a corporate environment in which web access is gated through a proxy which requires authentication.

During a first run of cpan it auto configures everything that it normally does:

Autoconfigured everything but 'urllist'. Please call 'o conf init urllist' to configure your CPAN server(s) now!

commit: wrote '/usr/lib/perl5/5.10.0/CPAN/Config.pm'

Knowing that I have a proxy to navigate, and having read the docs and several pages on the web about proxy and cpan I:

cpan[1]> o conf init /proxy/

If you're accessing the net via proxies, you can specify them in the CPAN configuration or via environment variables. The variable in the $CPAN::Config takes precedence.

Your ftp_proxy? []

Your http_proxy? [] 10.12.8.9:3128

Your no_proxy? []

If your proxy is an authenticating proxy, you can store your username permanently. If you do not want that, just press RETURN. You will then be asked for your username in every future session.

Your proxy user id? [] my_net_id

Your password for the authenticating proxy can also be stored permanently on disk. If this violates your security policy, just press RETURN. You will then be asked for the password in every future session.

CPAN: Term::ReadKey loaded ok (v2.30) Your proxy password? Please remember to call 'o conf commit' to make the config permanent!

cpan[2]> o conf commit commit: wrote '/usr/lib/perl5/5.10.0/CPAN/Config.pm'

All should be good now, right? So I wish,

cpan[3]> i /Some::Module/ CPAN: Storable loaded ok (v2.18)

I would like to connect to one of the following sites to get 'authors/01mailrc.txt.gz':

http://www.perl.org/CPAN/ ftp://ftp.perl.org/pub/CPAN/

Is it OK to try to connect to the Internet? [yes] LWP not available

Trying with "/usr/bin/curl -L -f -s -S --netrc-optional" to get http://www.perl.org/CPAN/authors/01mailrc.txt.gz curl: (22) The requested URL returned error: 407

System call "/usr/bin/curl -L -f -s -S --netrc-optional "http://www.perl.org/CPAN/authors/01mailrc.txt.gz" > /root/.cpan/sources/authors/01mailrc.txt.tmp29726" returned status 22 (wstat 5632) Warning: expected file [/root/.cpan/sources/authors/01mailrc.txt.gz.tmp29726] doesn't exist

Trying with "/usr/bin/wget -O /root/.cpan/sources/authors/01mailrc.txt.tmp29726" to get http://www.perl.org/CPAN/authors/01mailrc.txt.gz --2012-07-17 15:57:38-- http://www.perl.org/CPAN/authors/01mailrc.txt.gz Connecting to 10.12.8.9:3128... connected. Proxy request sent, awaiting response... 301 Moved Permanently Location: http://www.cpan.org/authors/01mailrc.txt.gz [following] --2012-07-17 15:57:38-- http://www.cpan.org/authors/01mailrc.txt.gz Connecting to 10.12.8.9:3128... connected. Proxy request sent, awaiting response... 407 Proxy Authentication Required 2012-07-17 15:57:38 ERROR 407: Proxy Authentication Required.

So where's the password prompt?

What am I missing to configure cpan to access the internet through the corporate proxy with authentication?

解决方案

Install LWP. The cpan utility is using curl, I guess because it couldn't load LWP. No proxy parameters are being passed to curl, so you need the export http_proxy=http://host:port/ before running the command.

Or, if you can install LWP using your distribution's package manager, then it should configure the proxy access correctly.

这篇关于使用CPAN与一个代理失败后o conf init / proxy /的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆