working with Linux OS behind proxy server (Linuxmint 17)

# Configuring proxy servers when you are using Linux/Windows operating system.

# In this case i am using Linux mint 17 - XFCE x64bit

# There are mostly two ways to configure proxy for Linux operating system tools.
    #1. First you can look for tool configuration file, that can be found in Linux System /etc directory,
    For example: If you are using WGET (Linux download manager) that its configuration file in
        ~ And you need to edit this file to setup proxy for wget,
                ~ This proxy will be configured for wget will be used every time you run wget.
           So, if you are using proxy for a while than you should avoid this method.

    #2. Second method for configuring proxy is using console/Terminal environment variable.

Environment variables are very important and allows you to directly communicate with another 
command line application or look for any configuration file where that defined for your specific
A simple example is, So you have installed JAVA_JDK or you are going to install java into your SYSTEM,
How your SYSTEM is going to find that you have installed JAVA_JDK installed,
    -> You can say that path can be defined using windows registry. ok but what about linux?

Their is one another way to use it even without installing it,

    -> This is using Environment variables, these are specific for two scopes
        -> LOCAL Environment Variables
        -> GLOBAL Environment Variables    => need admin privileges
    -> export JAVA_HOME environment variable for that Directory where you have installed/extract
        java_jdk contents.
    -> And you are ready to go ..

         ~  for BASH shell on Linux mint17-XFCE-x64
         ~ I have used this command-
              $ export http_proxy=
              ~ So, what actually this is going to do?
                   ~ This actually create a new environment variable using :
                             KEY = http_proxy

            ~ If you want to see Environment variable, use env  command,
                   ~ $ env
                    # This is going to print every environment variable KEY and corresponding
                       key VALUES.

    # If you are using Linux tools using CYGWIN package

      ~You can set environment variable using set command on windows, 
            ~ There is Syntax
              >set http_proxy=
              >wget http://www.google.co.in 

    # Linux == export ( to define environment variables temporarily)
        ~ And to view them use == env  command

    # Windows == set ( to define environment variables temporarily on windows OS  )
        ~ And to view all of them use   == set command

# Some examples:
    #1. using wget command line download manager for UNIX like systems.
        $ export http_proxy=
       $ wget -o home.html http://python.org


       $ http_proxy= wget -o home.html http://python.org


      ~ Use wget  configuration, edit and define proxy server and port for http, https, ftp protocol.
         # nano /ect/wgetrc

    #2. using pip python modules/packages management tool
        ~ LINUX
        $  export http_proxy=
        $ sudo pip install ipython[test, notebook, zmq, qtconsole]
        # This is how we can install IPython with notebook, qtconsole, zmq dependencies.


        $ http_proxy= pip install ipython[test, notebook, zmq, qtconsole]


        # use pre-defined option for proxy server
            $ sudo pip --proxy install ipython

    #3. using apt-get to install Linux packages form console/terminal
    ~ Although you can use Synaptic package manager or GDebi package manager which are GUI
         for Linux package management, yet apt-get is most basic tool for managing packages on
         debian based Linux operating systems.

         ~ LINUX
         $ export http_proxy=
         $ sudo apt-get install ipython


         # http_proxy= apt-get install ipython


       ~ edit configuration file for apt-get tool
          ~ which is apt.conf
          ~ PATH == /etc/apt/apt-conf
               # and now define proxy for this file, note that you can not edit this file untill
                  you have root user privileges.

         Acquire::http::Proxy "";
    # edit your BASH configuration file that can be found in your HOME directory.
       # Time to edit this file, nano is my favorite command line editor.
       # nano ~/.bashrc
         # go to the bottom of file and this line of code,
           of-course you are familiar with this code. 

         export http_proxy

             # Save using ( CTRL+O )  and exit using ( CTRL+X )

    #4. Using easy_install behind proxy server
        $ export http_proxy=
        $ sudo -E easy_install  ipython

Post a Comment