Configuring a System Network Proxy

Configuring the system network proxy is optional and is mainly required by dependency installation. If your server network can directly access the external network, skip this step. If your server cannot access external network, you need to configure the network proxy. The following procedure is a commonly used method and may not be applicable to all network environments. The network proxy configuration method varies with the actual network environment.

  1. Log in to the user environment as the root user.
  2. Run the following command to edit the /etc/profile file:
    vi /etc/profile
    Add the following content to the file, save the file, and exit:
    export http_proxy="http://user:password@proxyserverip:port"
    export https_proxy="http://user:password@proxyserverip:port"

    In the preceding commands, user indicates the username on the intranet, password (special characters need to be converted) indicates the user password, proxyserverip indicates the IP address of the proxy server, and port indicates the port number.

    To ensure the security of user passwords, delete user passwords after finishing the deployment.

  3. Run the following command to make the configuration take effect.
    source /etc/profile
  4. Run the following command to check whether the external network is connected:
    wget www.baidu.com

    If the HTML file can be downloaded, the server is connected to the external network successfully.

    If a certificate error occurs when you use a proxy to connect to the network, install the certificate of the proxy server before downloading third-party components.