Linux Lite Forums

Software - Support => Tutorials => Topic started by: ralphy on November 21, 2016, 02:03:26 AM

Title: Global proxy settings in Linux Lite 3.2
Post by: ralphy on November 21, 2016, 02:03:26 AM
Web Proxy tip for Linux Lite 3.2

If you're looking for a way to configure web proxy settings system-wide in Linux Lite 3.2, this guide may help you accomplish just that. dconf-tools/dconf-editor do not seem to work (or at least it didn't work for me in Linux Lite 3.2) and that's why I'm writing this post; hopefully it will help others.

What works: Environment variables

You will define some environment variables such as:
no_proxy
http_proxy
https_proxy

... in /etc/environment

Note: Some applications require the above mentioned variables all in upper case while others in lower case. Therefore we will define each variable using all 'UPPER CASE' as well as 'lower case'.


Depending on your needs, you can define different variables to connect to the desired proxy such as:

no_proxy=localhost,127.0.0.0/8,*.local
NO_PROXY=localhost,127.0.0.0/8,*.local
all_proxy=socks://proxy.domain.tld:port/
ALL_PROXY=socks://proxy.domain.tld:port/
http_proxy=http://proxy.domain.tld:port
HTTP_PROXY=http://proxy.domain.tld:port
ftp_proxy=http://proxy.domain.tld:port
FTP_PROXY=http://proxy.domain.tld:port 
https_proxy=http://proxy.domain.tld:port
HTTPS_PROXY=http://proxy.domain.tld:port


You can set the http_proxy variable with the hostname or IP address of the proxy server as well as its connection port:

http_proxy=http://proxy.domain.tld     (assumes port 80 by default)
http_proxy=http://proxy.domain.tld:8080 (connects to proxy.domain.tld on port 8080)
http_proxy=http://192.168.1.200:8080   (connects to 192.168.1.200 on port 8080)


If the proxy server you are connecting to requires a user name and password, include them as follow:

http_proxy=http://username:[email protected]
http_proxy=http://username:[email protected]:8080
http_proxy=http://username:[email protected]:8080

Similarly https_proxy is for https protocol.



Done with the basics, time to get it done :)  In this guide, we will be configuring some variables to connect to a http/https proxy without authentication. Use your favorite text editor to edit /etc/environment... vi, gedit, leafpad, you name it. Let's use leafpad in this guide for demonstrations purposes:

Code: [Select]
gksu leafpad /etc/environment
(http://i.imgur.com/eFAzsXj.png)

Let's add the variables needed to connect to a local (192.168.1.2) web http/https proxy on port 3128 that does not require authentication:

(http://i.imgur.com/Pq77ZBj.png)

You must logout or restart for your desktop environment to refresh it's environment variables. Since all desktop applications are started by the desktop environment, they subsequently inherit its environment settings.

By default, most web browsers use the system proxy settings but it is worth checking just to be sure. For example, in Firefox, check the network settings under Preferences => Advanced => Network => Settings... and make sure it is using the system proxy settings.
 
(http://i.imgur.com/wjJoNYW.png)

Have fun!