2012-07-18 6 views
17

인증을 필요로하는 프록시를 통해 웹 액세스가 게이트되는 기업 환경에서 Linux 상자가 있습니다. CPAN의 IT 자동차의 첫 번째 실행시o proxy/proxy/

은 평소와 모든 구성 :

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'

을 내가 탐색하는 프록시를 가지고 있음을 알고, 그리고 프록시와 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'

모두 올바르게해야합니다. 맞습니까? 그래서 나는

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.

을 기원 어디 암호를 묻는 메시지가 있어요?

인증을 통해 기업 프록시를 통해 인터넷에 액세스하도록 cpan을 구성하려면 무엇이 누락 되었습니까?

답변

9

LWP를 설치하십시오. cpan 유틸리티는 curl을 사용하고 있습니다. LWP를로드 할 수 없어서입니다. curl에 전달되는 프록시 매개 변수가 없으므로 명령을 실행하기 전에 export http_proxy = http : // host : port /가 필요합니다.

배포판의 패키지 관리자를 사용하여 LWP를 설치할 수 있으면 프록시 액세스를 올바르게 구성해야합니다.

+0

우승자가 있습니다. 말 앞에 장바구니를 두는 것처럼 보이 긴하지만 LWP와 18 개의 의존성을 손으로 설치 한 다음 cpan이 프록시를 통해 탐색합니다. @ 루치아노는 그것을 가지고 있습니다. – MichaelRpdx

+0

CPAN에서 19 개의 패키지를 수동으로 설치하는 대신에,'http_proxy','proxy_user','proxy_pass'의 세개 모두를 빈 문자열에 설정하거나'~/.cpan/CPAN/MyConfig.pm' 텍스트 편집기 사용). 그런 다음 쉘 환경에서'HTTP_PROXY','HTTPS_PROXY' 및 소문자 변형이 설정되고'export'되어 있는지 확인하십시오. _ 이것은 새로운 Perl 설치 소스 및 인증이 필요한 회사 HTTP 프록시를 사용하여 저에게 효과적이었습니다. _ – TheDudeAbides

3

당신은 cpan를 호출하기 전에이를 사용하여 시도 할 수 있습니다 :

export http_proxy=http://my_net_id:[email protected]:3128/ 

이 방법은 어쩌면 curl 프록시를 사용합니다.

+0

실제로 입력'10.12.8.9은 : 3128' 잘못된 보인다. 오히려'http : //10.12.8.9 : 3128'을 말해야합니다. – daxim

+0

@Paulo 아무런 영향이 없었습니다. – MichaelRpdx

+0

@daxim 게시 된 로그의 참고 사항 cpan이 프록시 서버에 연결 중입니다. 필요한 인증을 수행하지 않고 있습니다. – MichaelRpdx

22

구성 CPAN 프록시 설정에 절대 프록시 URL 주소를 제공해야합니다. 단순히 IP 주소와 포트 번호를 제공하는 대신 걱정하지 마시고 아래와 같이 입력하십시오.

cpan> o conf init /proxy/ 

Your ftp_proxy? [] ftp://10.12.8.9:3128 

Your http_proxy? [] http://10.12.8.9:3128 

Your no_proxy? [] 

이름비밀번호 필요한 경우 (당신이 다운로드 권한이 있는지 확인)

가 나는 또한 동일한 문제가를 제공하지만, 지금은 나를 위해 작동합니다. 나는 너를 위해서 일해야한다.

은 BR 제리 제임스는

+0

이것은 프록시를 제거하는 올바른 대답이었습니다. 기존의 도커 이미지/컨테이너에는 http_proxy의 env가 있는데 설정을 해제하고 싶습니다. –