Difference between revisions of "Features/Automatic Proxy Settings"

From Sugar Labs
Jump to navigation Jump to search
Line 40: Line 40:
 
Steps:
 
Steps:
  
* Create .htaccess file and add the following content:  
+
* Install httpd web server:
 +
 
 +
  yum install httpd
 +
 
 +
* Enable configuration override with htaccess
 +
 
 +
  vim /etc/httpd/conf/httpd.conf
 +
 
 +
    <Directory "/var/www/html">
 +
                     
 +
    #                 
 +
    # Possible values for the Options directive are "None", "All",
 +
    # or any combination of:
 +
    #  Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
 +
    #                 
 +
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
 +
    # doesn't give it to you.
 +
    #                 
 +
    # The Options directive is both complicated and important.  Please see
 +
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
 +
    # for more information.
 +
    #                 
 +
    Options Indexes FollowSymLinks
 +
                     
 +
    #                 
 +
    # AllowOverride controls what directives may be placed in .htaccess files.
 +
    # It can be "All", "None", or any combination of the keywords:
 +
    #  Options FileInfo AuthConfig Limit
 +
    #                 
 +
    AllowOverride None                                                       
 +
                     
 +
    #                 
 +
    # Controls who can get stuff from this server.
 +
    #                 
 +
    Order allow,deny 
 +
    Allow from all   
 +
                     
 +
    </Directory>     
 +
 
 +
    Change AllowOverride None ==> AllowOverride All
 +
 
 +
* Create .htaccess file:
 +
 
 +
 
  
 
   AddType application/x-ns-proxy-autoconfig .pac
 
   AddType application/x-ns-proxy-autoconfig .pac

Revision as of 19:16, 8 January 2013

Summary

Allow the user to setup transparent Proxy service.

Owner

Ariel Calzada

Current status

  • Targeted release: 0.98
  • Last updated: 2013-01-07
  • Percentage of completion: 80%

Detailed Description

Sugar deployments and users need to be able to set a proxy to access some network services.

In this entry you can learn a way of configuring automatic proxy server (PAC and WPAD) for testing purposes.

For testing a proxy in XO you can go to: Features/Proxy Settings

Benefit to Sugar

See Detailed Description.

Scope

It's not directly related to XO, it's just a part for building an environment for automatic proxy testing in XO

PAC - Proxy Auto Config

PAC method for proxy is very simple. You have to create a web-accessible file with special syntax in which you include proxy server data. This example works with Apache server. You can take a look to Bibliograpy for more info about PAC file configuration and installation in other webservers.

Steps:

  • Install httpd web server:
  yum install httpd
  • Enable configuration override with htaccess
  vim /etc/httpd/conf/httpd.conf
   <Directory "/var/www/html">
                      
   #                  
   # Possible values for the Options directive are "None", "All",
   # or any combination of:
   #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
   #                  
   # Note that "MultiViews" must be named *explicitly* --- "Options All"
   # doesn't give it to you.
   #                  
   # The Options directive is both complicated and important.  Please see
   # http://httpd.apache.org/docs/2.2/mod/core.html#options
   # for more information.
   #                  
   Options Indexes FollowSymLinks
                      
   #                  
   # AllowOverride controls what directives may be placed in .htaccess files.
   # It can be "All", "None", or any combination of the keywords:
   #   Options FileInfo AuthConfig Limit
   #                  
   AllowOverride None                                                         
                      
   #                  
   # Controls who can get stuff from this server.
   #                  
   Order allow,deny   
   Allow from all     
                      
   </Directory>       
   Change AllowOverride None ==> AllowOverride All
  • Create .htaccess file:


  AddType application/x-ns-proxy-autoconfig .pac
  • Create PAC file and add the following content:
  function FindProxyForURL(url, host) {
      return "PROXY PROXY_SERVER_IP_OR_HOSTNAME:PORT";
  }
  • Upload both file to the same location:
 mv proxy.pac /var/www/proxy.pac
 mv .htaccess /var/www/.htaccess
  • Restart apache /etc/init.d/apache2 restart

WPAD - Web Proxy Autodiscovery

Web Proxy Auto-Discovery Protocol, or WPAD, is a technology which aids a web browser in automatically detecting the location of a PAC file using DNS or DHCP.

A browser that supports both DHCP and DNS will first attempt to locate a PAC file using DHCP, and should a DHCP configuration not exist fail-over to DNS WPAD will occur. If neither are configured, a browser will fail open. Source

Bibliography