The Linux system (used in this article is the CentOS6.4) host as a client, in a network environment with Internet proxy, there are several places to do the client Agent configuration when accessing the networks:
1. Set up the network agent under the GUI
2. Setting the network proxy for environment variables in the system
3. Proxy settings when using Yum
4, the application itself proxy settings
1, the network agent under the graphical interface
After the system installs the graphical interface, in the system–> preferences–> network proxy location, you can open the Web Proxy's setup interface, as
The proxy settings here provide a configuration for some GUI programs to access the network, but for example when using Firefox, you still need to configure the network agent in the Firefox program itself to access the Web page (and after configuring the network agent in Firefox, even if it is not configured here, Firefox will be able to access the Web page).
The configuration here is actually saved in the ~/.gconf/system/proxy directory and in the Http_proxy directory
2. Agent-related environment variables
Common environment variables related to proxies are: Http_proxy, Https_proxy, Ftp_proxy
When some command-line tools require a proxy, proxy settings, such as curl, are used here.
The format is:
Export http_proxy= "Http://username:[email protected]<proxyserver>:<proxyport>"
If you want to make this configuration permanent, add this configuration to/etc/profile/**.sh or ~./bash_profile
[[email protected] ~]# vim/etc/profile.d/proxy.sh # #新创建proxy. SH Add the following three segments
Export http_proxy= "Http://username:[email protected]<proxyserver>:<proxyport>"
Export https_proxy= "Http://username:[email protected]<proxyserver>:<proxyport>"
Export ftp_proxy= "Http://username:[email protected]<proxyserver>:<proxyport>"
3. Agent settings in Yum
If a proxy server is used in a network environment, the agent needs to be configured in the Yum warehouse configuration as a client to use the Yum source based on Internet access
#vim/etc/yum.conf
Add the following paragraph
proxy= http://<proxyserver>:<proxyport>
Proxy_username=username
Proxy_password=password
#yum Clean All
#yum Makecache
4, the application itself proxy settings
Some GUI applications, even if the agent is configured in the system, still need to configure the agent itself, such as Firefox (Edit->preferences can be configured, do not repeat here);
Some command tools, such as curl, can be used directly if the environment variable HTTP_PROXY is configured on the system, without the need for additional configuration. If the agent is not configured in an environment variable, you will need to specify the proxy with the appropriate options when using curl, as follows:
#curl-i-X http://<proxyserver>:<proxyport>-U <username:password>
The HTTP proxy address of the-X or--proxy instruction connection
-U or--proxy-user specify the user name and password of the connection agent
This article permanently updates the link address : http://www.linuxidc.com/Linux/2014-09/106215.htm
Some proxy settings for the Linux system as a client