Linux - add a Web proxy

Linux - add a Web proxy (client side)

Posted By: pmietlicki

Published to Linux on Jun 04, 2015

Under ubuntu :

http://askubuntu.com/questions/175172/how-do-i-configure-proxies-in-ubuntu-server-or-minimal-cli-ubuntu

You'll need to define some environment vairables, go to /etc/environment and add :

http_proxy=http://myproxy.server.com:8080/ 
https_proxy=http://myproxy.server.com:8080/ 
ftp_proxy=http://myproxy.server.com:8080/ 
no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com" 
HTTP_PROXY=http://myproxy.server.com:8080/ 
HTTPS_PROXY=http://myproxy.server.com:8080/ 
FTP_PROXY=http://myproxy.server.com:8080/ 
NO_PROXY="localhost,127.0.0.1,localaddress,.localdomain.com"

The difference of case reflects the disparate configurations of various potential tools that you could use.

Concerning apt, you'll have to create a specific configuration, for example, add 95proxies inside /etc/apt/apt.conf.d with :

Acquire::http::proxy "http://myproxy.server.com:8080/"; 
Acquire::ftp::proxy "ftp://myproxy.server.com:8080/"; 
Acquire::https::proxy "https://myproxy.server.com:8080/";

Under redhat ou centos

Source :

http://www.putorius.net/2012/06/how-to-configure-system-proxy-settings.html

Inside .bash_profile or /etc/bashrc , add at the end of the file :

http_proxy=http://webserv.domain.com:8080
export http_proxy

For yum, inside /etc/yum.conf :

proxy=http://webserv.domain.com:8080 

For the subscription service, as indicated on :

https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/rhsm-http-proxy.html

Under command line, type :

subscription-manager config --server.proxy_hostname=proxy.example.com --server.proxy_port=8080 --server.proxy_user=admin --server.proxy_password=secret

Tags: linux, proxy

Archive