Recently, a centos host is used on the campus network, and a proxy is required to connect to the network. If it is a windows host, set it in the Internet option, however, in the linux system where any configuration file needs to be changed, I am really confused. Now, let's summarize the configuration methods below. On the one hand, we will leave it to ourselves, and others will be able to avoid detours.
1. Global http Proxy
All users (the simplest and most direct configuration method. If you follow this configuration, you will not need to check it later)
Edit/etc/profile to add
http_proxy===
If you do not need the user name or password, you can leave it blank. You only need to enter the IP address and port, such as http: // 123.123.123.123: 8000.
Many related reprinted articles on the Internet have written export http_proxy as export_http_proxy.
Almost all the Internet users only write the http code. When running commands, they often do not even access the internet. Especially for some open-source projects on github, the addresses are https, therefore, you must add https entries. You can add ftp entries without any trouble.
Single User
Edit ~ /. Bash_profile Add the same content as above
http_proxy===
2. yum proxy (yum is the command for downloading software in centos. It is similar to apt-get In ubuntu. you can install most of the commonly used software only by configuring this command)
Edit/etc/yum. conf to add
proxy=http:
If you do not need the same user name or password, you can leave it empty.
3. wget proxy (wget is used for downloading files, and the corresponding files can be downloaded using a url later)
Edit/etc/wgetrc to add
https_proxy = http:http_proxy = http:ftp_proxy = http: