Friday, 23 August 2013

Configure Proxy server


Configure Proxy server

Configuration Ubuntu :
(Three Steps to configure proxy server)

Go etc -> apache2 -> sites-available

    <VirtualHost *:80>
        ServerName pinakin
        ServerAdmin webmaster@localhost

         <Proxy *>
                Order deny,allow
                Allow from all
        </Proxy>
        ProxyRequests Off
        ProxyPass / http://localhost:8069/
        ProxyPassReverse / http://localhost:8069/
        #ProxyHTMLURLMap / http://localhost:8069/ /http://pinakin/

        ErrorLog /var/log/apache2/webclient-error.log
        CustomLog /var/log/apache2/webclient-access.log combined
    </VirtualHost>



Step 1 : Install Apache 2
   
      -  $ sudo apt-get install apache2
                 [sudo] password for tiny:
                 Reading package lists... Done
                 Building dependency tree    
                 Reading state information... Done
                 apache2 is already the newest version.
                 The following packages were automatically installed and are no longer required:
                 appmenu-gtk linux-headers-2.6.35-22 linux-headers-2.6.35-22-generic libxdot4
                 Use 'apt-get autoremove' to remove them.
                 0 upgraded, 0 newly installed, 0 to remove and 189 not upgraded.

Step 2 : Give permission to edit and enable module proxy, header or etc

     -  $ sudo chmod 777 /etc/apache2/sites-available/pinakin
   
     -  $ sudo a2enmod headers
               Enabling module headers.
               Run '/etc/init.d/apache2 restart' to activate new configuration!
     -  $ sudo a2enmod proxy
               Enabling module proxy.
               Run '/etc/init.d/apache2 restart' to activate new configuration!
     -  $ sudo a2enmod proxy_connect
               Considering dependency proxy for proxy_connect:
               Module proxy already enabled
               Enabling module proxy_connect.
               Run '/etc/init.d/apache2 restart' to activate new configuration!
     -  $ sudo a2enmod proxy_ftp
               Considering dependency proxy for proxy_ftp:
               Module proxy already enabled
               Enabling module proxy_ftp.
               Run '/etc/init.d/apache2 restart' to activate new configuration!
     -  $ sudo a2enmod proxy_http
              Considering dependency proxy for proxy_http:
              Module proxy already enabled
              Enabling module proxy_http.
              Run '/etc/init.d/apache2 restart' to activate new configuration!
     -  $ sudo a2enmod ssl
              Enabling module ssl.
              See /usr/share/doc/apache2.2-common/README.Debian.gz on how to configure SSL and
              create self-signed certificates.
              Run '/etc/init.d/apache2 restart' to activate new configuration!
     -  $ sudo a2ensite default-ssl
              Enabling site default-ssl.
              Run '/etc/init.d/apache2 reload' to activate new configuration!
     -  $ sudo a2dissite
              000-default  default-ssl
     -  $ sudo a2dissite 000-default
              Site default disabled.
              Run '/etc/init.d/apache2 reload' to activate new configuration!
     -  $ sudo a2ensite endicus
              Enabling site endicus.
              Run '/etc/init.d/apache2 reload' to activate new configuration!
     -  $ sudo /etc/init.d/apache2 restart
             \Syntax error on line 12 of /etc/apache2/sites-enabled/endicus:
              Invalid command 'ProxyHTMLURLMap', perhaps misspelled or defined by a module not
              included in the server configuration
     -  $ sudo /etc/init.d/apache2 restart
             Syntax error on line 12 of /etc/apache2/sites-enabled/endicus:
             Invalid command 'ProxyHTMLURLMap', perhaps misspelled or defined by a module not                      included in the server configuration
     -  $ sudo /etc/init.d/apache2 restart
             * Restarting web server apache2              
            waiting
            [ OK ]

Step 3 : To show list of hosts available

     -   $ sudo nano /etc/hosts
              [sudo] password for tiny:


127.0.0.1       localhost.localdomain   localhost
::1     test    localhost6.localdomain6 localhost6
127.0.1.1       test
127.0.0.1       pinakin
127.0.0.1       v6
127.0.0.1       v7



..Enjoy..

No comments:

Post a Comment