10

Using server version of 10.4 beta 2

Need to to set the proxy that the system needs to use

Thanks

2
  • I would like to setup the proxy from a /etc/network/interfaces file, which has been enhanced with guessnet-magic; so depending on the network I end up using I want to setup the system wide proxy.
    – blueyed
    Aug 11, 2011 at 18:44
  • oh man, this is just mean, over 10k views, and only 4 up boats :(
    – thecoshman
    May 24, 2012 at 7:56

4 Answers 4

13

Depending on your needs you could add

   http_proxy="http://your.proxy.here:3128/"
   https_proxy="http://your.proxy.here:3128/"
   ftp_proxy="http://your.proxy.here:3128/"

to /etc/environment to have them set by the login-process.

cheerio

4
  • 1
    would this apply the proxy settings even if no one logs in? Ideally, I don't want to have to arse around on the machine, just to update it or what not.
    – thecoshman
    Apr 15, 2010 at 11:59
  • Typo: cat /etc/environment Jan 9, 2012 at 8:58
  • There is also AUTO_PROXY for URL to PAC file formats.
    – Wernight
    Aug 26, 2014 at 7:50
  • Once you've updated your /etc/environment file, you can make sure the changes take place immediately for the current session without having to log off and back on, by running source /etc/environment. Aug 6, 2018 at 22:19
1

To proxy updates, add a new file called 01proxy to your /etc/apt/apt.conf.d/ directory with the following line:

Acquire::http::proxy "http://[user]:[password]@[server_ip_or_name]:[port#]";

Substitute the user name/password used to log into the proxy (if required), the server ip or fully-resolved name, and the proxy port # to use when adding this line.

1

@Lairsdragon is correct (set /etc/environment), but there are more nuances.

An application will typically need to be run with this environment in place, for instance, from a login shell. That said, it's even more complex than that:

  • Many applications, especially servers are smart enough to consult /etc/environment.
  • Many don't consult /etc/enironment.
  • Some applications don't support proxies at all.
  • Others are configured with their own configuration files.
  • Still others will read from a different global file (like the gconf registry).

To really set something, you need to read the documentation on a particular application you are interested in to make sure you have set the correct file. Chances are, it will talk about how to set up a http_proxy somewhere in it's docs if it supports this.

This is similar on all operating systems. Setting network proxies is a confusing mess with many different and varied approaches to solving this problem.

Some References:

0

http://studyhat.blogspot.com/2010/01/squid-proxt-server.html

in place of yum install you can use sudo apt-get install squid then follow the blog!!!

1
  • 1
    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. May 22, 2012 at 2:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .