프록시 설정 방법마다 다른 효과와 장점이 있습니다. 예를 들어, pkg set-publisher 명령은 게시자 구성의 일부로 프록시를 저장하는 반면, http_proxy 환경 변수는 인증된 프록시를 설정할 수 있습니다.
pkg set-publisher 명령의 --proxy 옵션은 지정된 게시자 원본 및 미러 URI에 대한 영구 프록시 URI를 설정합니다. 프록시 값은 게시자 구성의 일부로 저장됩니다. 게시자 구성의 일부로 프록시 값을 저장하면 자식 이미지에 사용된 시스템 저장소가 자동으로 업데이트됩니다. 또한 게시자 구성의 일부로 프록시 값을 저장하면 다른 게시자마다 다른 프록시를 사용할 수 있습니다.
$ pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F file:///export/IPSpkgrepos/Solaris/ $ pkg publisher -F tsv PUBLISHER STICKY SYSPUB ENABLED TYPE STATUS URI PROXY solaris true false true origin online file:///export/IPSpkgrepos/Solaris/ - $ pkg set-publisher -g http://pkg.oracle.com/solaris/release/ --proxy proxyURI solaris $ pkg publisher solaris Publisher: solaris Alias: Origin URI: file:///export/IPSpkgrepos/Solaris/ SSL Key: None SSL Cert: None Origin URI: http://pkg.oracle.com/solaris/release/ Proxy: proxyURI SSL Key: None SSL Cert: None Client UUID: e15e3228-eada-11df-80ab-8023183d954b Catalog Updated: July 11, 2013 11:32:46 PM Enabled: Yes Properties: proxied-urls = [] $ pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F file:///export/IPSpkgrepos/Solaris/ solaris origin online T http://pkg.oracle.com/solaris/release/ $ pkg publisher -F tsv PUBLISHER STICKY SYSPUB ENABLED TYPE STATUS URI PROXY solaris true false true origin online file:///export/IPSpkgrepos/Solaris/ - solaris true false true origin online http://pkg.oracle.com/solaris/release/ proxyURI
이 이미지에 비전역 영역이 있으면 이 프록시 정보로 시스템 저장소가 자동으로 업데이트되므로 system-repository 서비스에 등록 정보를 설정할 필요가 없습니다. 비전역 영역에서 게시자 프록시를 검사하면 전역 영역에 보이는 프록시 URI가 보이지 않습니다. 전역 영역에서 시스템 저장소는 프록시 URI를 사용합니다. 비전역 영역에서 시스템 저장소는 자체가 프록시 역할을 하므로 비전역 영역에서 전역 영역의 시스템 저장소와 통신할 수 있습니다. 전역 영역과 비전역 영역의 관계는 시스템 저장소 게시자가 비전역 영역에서 어떻게 보이는지 예시합니다.
pkg set-publisher 명령의 --proxy 옵션은 인증된 프록시를 설정하는 데 사용할 수 없습니다. --proxy 옵션 값은 protocol://user:password@host 형식을 가질 수 없습니다.
프록시 환경 변수 값은 해당 프로토콜의 모든 URI에 적용됩니다. 런타임에 http_proxy 환경 변수 값은 pkg set-publisher 명령의 --proxy 옵션으로 설정된 값을 대체합니다. 프록시 환경 변수에 대한 자세한 내용은 curl(1) 매뉴얼 페이지의 ENVIRONMENT 절을 참조하십시오.
비전역 영역이 있는 이미지에 http_proxy 환경 변수를 설정하는 경우, 전역 영역에서 svc:/application/pkg/system-repository SMF 서비스의 프록시 등록 정보를 이와 같은 값으로 설정하고 서비스를 새로 고칩니다.
$ svccfg -s system-repository:default setprop config/http_proxy = astring: proxyURI $ svccfg -s system-repository:default listprop config/*proxy config/https_proxy astring config/http_proxy astring proxyURI $ svcprop system-repository:default | grep proxy config/https_proxy astring "" config/http_proxy astring "" $ svcadm refresh system-repository:default $ svcprop system-repository:default | grep proxy config/https_proxy astring "" config/http_proxy astring proxyURI
pkg publisher 명령은 환경 변수나 SMF 서비스 등록 정보로 설정된 프록시를 표시하지 않습니다.
http_proxy 환경 변수 값을 변경하면 system-repository 서비스 등록 정보를 업데이트하고 서비스를 새로 고쳐야 합니다.