Rate This Document
Findability
Accuracy
Completeness
Readability

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_framework.service or gunicorn_plugin.service file. The following commands use the gunicorn_framework.service file as an example.
    • For Ubuntu:
      1
      vi /lib/systemd/system/gunicorn_framework.service
      
    • For other OSs:
      1
      vi /usr/lib/systemd/system/gunicorn_framework.service
      
    • gunicorn_framework.service is the file of the Kunpeng DevKit framework service.
    • gunicorn_plugin.service is the file of the Kunpeng DevKit subtool service.
  2. In the gunicorn_framework.service file, add the following environment variables to the end of the [Service] field:
    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
      2
      systemctl restart gunicorn_framework.service
      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.