Gentoo Wiki



An http proxy is a method whereby your http request is relayed through another server which fetches the pages on your behalf. The advantage of this is that it can store the information you accessed and should you need it again it just has to access its hard disk, thus saving you valuable bandwidth. It may not sound much but scale the above up to several hundred users and you start to see some serious bandwidth savings. This is a very brief description. Proxies can do much more, but that should be covered in another page.

Setting up your gentoo machine to use a proxy server:

There is a useful link below that shows the basics of setting up environmental variables for your system i.e. the http_proxy variable. Many applications will use this variable once it is set although some will require manual configuration as well.

Open up /etc/env.d/99local with your favorite editor:

File: /etc/env.d/99local

You might also want to add the following for ftp:


Obviously replace the port and domain name with one relevant to your needs. Save the file and you are done. When gentoo loads it parses through all the files in env.d to setup global variables so all users should now see that entry.

With gentoo being based around portage which tends to generate quite a few file downloads, you can also tell it to use your proxy for portage downloads as well as it pays attention to the variables ftp_proxy and http_proxy for its wget downloads.

Right one last thing is to update your environmental variables to take account of the changes you made.


Check it worked by logging out of your shell and logging back in (this refreshes your path variables which are loaded on login) and then typing:

echo $http_proxy

Hopefully it will return the value of your proxy server. If you dont want to have to log out and back in again then type:

env-update && source /etc/profile

This changes your profile imediately and you should then be able to see the proxy variable.

Hope that helps.

See Also

Retrieved from ""

Last modified: Wed, 20 Aug 2008 01:24:00 +0000 Hits: 30,191