我要评分
获取效率
正确性
完整性
易理解

Configuring a Proxy

To perform certain tasks, you need to access the Internet to obtain resources. In an isolated network environment, you need to configure a proxy for accessing the Internet. If Internet access is available in the current environment, skip this section.

  1. Modify the gunicorn_plugin.service file.
    • For Ubuntu:
      1
      vi /lib/systemd/system/gunicorn_plugin.service
      
    • For other OSs:
      1
      vi /usr/lib/systemd/system/gunicorn_plugin.service
      

    gunicorn_plugin.service is the file of the Kunpeng DevKit subtool service. It is used to enable the Allow Access to Internet option for dedicated software porting and software package rebuild.

  2. In the gunicorn_plugin.service file, add the following environment variables next to [Service]:
    1
    2
    Environment="http_proxy=ip:port"
    Environment="https_proxy=ip:port"
    

    ip:port indicates the IP address and port number of the proxy server.

  3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Restart the service.
    1. Run the following command to reload the configuration file:
      1
      systemctl daemon-reload
      
    2. Restart the service.
      1
      systemctl restart gunicorn_plugin.service
      
  5. Configure the DNS. (Skip this step if the DNS has been configured.)
    1. Open the resolv.conf file.
      1
      vi /etc/resolv.conf
      
    2. Add the following content to the file:
      1
      nameserver ip
      

      ip indicates the IP address of the DNS server.

    3. Press Esc, type :wq!, and press Enter to save the file and exit.