Yum & wget proxy settings

Source: Internet
Author: User
Tags configuration settings ftp protocol

Transfer from http://www.cnblogs.com/windows/archive/2012/12/14/2817533.html

Yum

Configure Proxy Server access
To set up all Yum operations using a proxy server, you can/etc/yum.confSets the information for the proxy server in the The proxy configuration entry must be set to the URL of the full proxy server, including the TCP port number. If your proxy server requires a user name and password, you can specify them with Proxy_username and Proxy_password configuration items.
This configuration allows Yum to use proxy server mycache.mydomain.com, connection port number 3128, username yum-user, password qwerty.
# Proxy Server-proxy server:port number
proxy=http://mycache.mydomain.com:3128
# Account Details for Yum connections
Proxy_username=yum-user
Proxy_password=qwerty
configuration file settings to use a proxy server
Global Settings
If you define a proxy server in/etc/yum.conf, all users will apply this proxy server setting when using Yum.
10.2. Configure a proxy server for a single user
To enable delegate access for a specific user, simply add the line of text in the instance box to the user's shell configuration. For the default bash shell, the configuration is~/.bash_profileIn This setting allows Yum to use a proxy server, mycache.mydomain.com, to connect the port number 3128.
# Proxy Server used by this account
Http_proxy= "http://mycache.mydomain.com:3128"
Export Http_proxy
Configure settings for using a proxy server
If the proxy server requires a user name and password, simply add them to the URL. To include user name Yum-user, password qwerty, add settings:
# Proxy server and username/password used by this account
http_proxy= "Http://yum-user:[email protected]:3128"
Export Http_proxy

Configuration settings for secure proxy servers
environment variable Http_proxy
The environment variable http_proxy is also used by other tools such as curl. Although Yum can identify uppercase or lowercase http_proxy,curl requires that the name of the environment variable be lowercase.

Wget

Setting the proxy server used by the wget

Wget can use the user settings file ". Wgetrc" to read a lot of settings, we mainly use this file here is to set up a proxy server. What user is logged in with, and what the ". Wgetrc" file under the home directory works. For example, if the "root" user wants to use ". Wgetrc" to set up a proxy server, "/root/.wgetrc" will work, the following gives a ". wgetrc" file content, readers can refer to this example to write their own "WGETRC" File:

  Http-proxy = 111.111.111.111:8080

ftp-proxy = 111.111.111.111:8080
Proxy-user=mgxxxxx
Proxy-passwd=xxx

The meaning of these two lines is that the proxy server IP address is: 111.111.111.111, the port number is: 8080. The first line specifies the proxy server used by the HTTP protocol, and the second line specifies the proxy server used by the FTP protocol.

(GO) Yum & wget proxy settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.