Translated message

A translation of this page exists in English.

Warning message

This translation is outdated. For the most up-to-date information, please refer to the English version.

如何通过 HTTP 代理将机器注册到 Red Hat Network (RHN)、Red Hat Satellite 5.x 或者 Red Hat Satellite Proxy server 上?

Solution In Progress - Updated -

Environment

  • http proxy 环境下的 Red Hat Enterprise Linux(RHEL)
  • Red Hat Network (RHN) Classic
  • Red Hat Satellite 5.x
  • Red Hat Proxy

Issue

  • 如何通过 HTTP 代理(proxy)将机器注册到 Red Hat Network (RHN)、Red Hat Satellite 5.x 或者 Red Hat Satellite Proxy server 上?
  • 一个普通的 apache 代理,能否用于 rhn_register, rhn_check, up2date, 和 yum?
  • 通过代理来访问 RHN 时,Up2date_client 出现报错。
  • 无法通过代理升级服务器。

Resolution

在 RHEL3,4,5 和 6 上,都是使用 rhn_register 命令把机器注册到 RHN 或者 Red Hat Satellite 5 上。(: RHN Classic Hosted, Satellite 5.5 and older, and stand-alone Satellite Proxy do not support RHEL 7).   在 RHEL3 和 RHEL4 上,使用 up2date 命令,在 RHEL 5 和 RHEL6 上,使用 yum 命令从 RHN,Red Hat Satellite 或 Red Hat Satellite Proxy 上检索包或包的信息。在 RHEL7 上不支持通过 RHN 注册系统,所以请使用 Red Hat Subscription Manager 注册。

如果您使用 rhn_register, up2date 或者 yum 命令通过 HTTP 代理访问 RHN,Red Hat Satellite 或者 Red Hat Satellite Proxy,请参考以下步骤配置。

  1. 打开并编辑 /etc/sysconfig/rhn/up2date

  2. 修改以下内容:

    enableProxy=0
    

    修改为:

    enableProxy=1
    
  3. 如果要求 proxy 认证,请把 enableProxyAuth 的值设成 1:

    enableProxyAuth=1
    
  4. 请在以下位置输入 http 代理的用户密码(有必要的话):

    proxyPassword=
    
  5. 请在以下位置输入 http 代理的用户名(有必要的话):

    proxyUser=
    
  6. 请在以下位置按照 host:port 的格式输入代理服务器的 URL:

    httpProxy=
    
  7. 保存文件。

同时,为了能使用代理服务器,您也需要配置 yum。

请在 /etc/yum.conf 文件里添加以下内容:

proxy=http://mycache.mydomain.com:3128
# The account details for yum connections
proxy_username=proxy-user
proxy_password=password.

注意:

Diagnostic Steps

  • 测试能否正常连接到代理服务器:
  # telnet <proxy_hostname> <proxy_port>

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments