Difference between revisions of "Features/Automatic Proxy Settings"

From Sugar Labs
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
Line 21: Line 21:
 
(PAC and WPAD) for testing purposes.
 
(PAC and WPAD) for testing purposes.
  
For testing a proxy in XO you can go to: [http://wiki.sugarlabs.org/go/Features/Proxy_Settings Features/Proxy Settings]
+
For testing a proxy in XO you can go to: [http://wiki.sugarlabs.org/go/Features/Proxy_Settings#How_To_Test Features/Proxy Settings]
  
 
== Benefit to Sugar ==
 
== Benefit to Sugar ==
Line 35: Line 35:
 
PAC method for proxy is very simple. You have to create a web-accessible
 
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
 
file with special syntax in which you include proxy server data. This example
works with Apache server. You can take a look to [http://wiki.sugarlabs.org/go/Features/Automatic_Proxy_Settings#Detailed_Description Bibliograpy]  
+
works with Apache server. You can take a look to [http://wiki.sugarlabs.org/go/Features/Automatic_Proxy_Settings#Bibliography Bibliograpy]  
for mor info about PAC file configuration and installation in other webservers.
+
for more info about PAC file configuration and installation in other webservers.
  
 
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">
 +
    ...   
 +
    #                 
 +
    # 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                                                                                                                                           
 +
    ...                     
 +
  </Directory>     
 +
  Replace the line "AllowOverride None" with "AllowOverride All"
 +
 
 +
* Create a web enabled directory proxy
 +
 
 +
  mkdir /var/www/html/proxy
 +
 
 +
* Create .htaccess file and the following content:
 +
 
 +
  vim /var/www/html/proxy/.htaccess
  
 
   AddType application/x-ns-proxy-autoconfig .pac
 
   AddType application/x-ns-proxy-autoconfig .pac
  
 
* Create PAC file and add the following content:
 
* Create PAC file and add the following content:
 +
 +
  vim /var/www/html/proxy/proxy.pac
  
 
   function FindProxyForURL(url, host) {
 
   function FindProxyForURL(url, host) {
Line 50: Line 77:
 
   }
 
   }
  
* Upload both file to the same location:
+
* Set permissions for the directory proxy
 +
 
 +
  chown -R apache.apache /var/www/html/proxy
 +
  chmod -R 755 /var/www/html/proxy
 +
 
 +
* Restart httpd web server
  
  mv proxy.pac /var/www/proxy.pac
+
  service httpd restart
  mv .htaccess /var/www/.htaccess
 
  
* Restart apache /etc/init.d/apache2 restart
+
* Test in your favorite browser
 +
 
 +
[[File:testproxyiceweasel-1.png]]
 +
 
 +
[[File:testproxyiceweasel-2.png|700px]]
  
 
== WPAD - Web Proxy Autodiscovery ==
 
== 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. [http://findproxyforurl.com/ Source]
  
 
== Bibliography ==
 
== Bibliography ==

Latest revision as of 20:28, 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">
   ...    
   #                  
   # 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                                                                                                                                             
   ...                       
  </Directory>       
  Replace the line "AllowOverride None" with "AllowOverride All"
  • Create a web enabled directory proxy
  mkdir /var/www/html/proxy
  • Create .htaccess file and the following content:
  vim /var/www/html/proxy/.htaccess
  AddType application/x-ns-proxy-autoconfig .pac
  • Create PAC file and add the following content:
  vim /var/www/html/proxy/proxy.pac
  function FindProxyForURL(url, host) {
      return "PROXY PROXY_SERVER_IP_OR_HOSTNAME:PORT";
  }
  • Set permissions for the directory proxy
  chown -R apache.apache /var/www/html/proxy
  chmod -R 755 /var/www/html/proxy
  • Restart httpd web server
  service httpd restart
  • Test in your favorite browser

Testproxyiceweasel-1.png

Testproxyiceweasel-2.png

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