This brief tutorial shows you how to set up an Apache daemon
as a proxy server that works with Kaleidoscope. The proxy server is
configured to accept requests only form the localhost (the same host
which runs the proxy server) ,so it is protected from external
misuse.
While this tutorial was tested on a Hardy Haron Ubuntu
distribution, it should apply for other Ubuntu versions.
First, we install Apache2 on our ubutnu machine.
sudo apt-get install apache2
Next we instruct the server to bind to the localhost and
choose a port on which the server will listen. The configuration
files are under /etc/apache2.
cd /etc/apache2/
Edit the file ports.conf using your favorite editor.
sudo vim ports.conf
Change the line:
Listen 80
to
Listen 127.0.0.1:<port of choice>
Example:
Listen 127.0.0.1:8085
Remember the port number as you will need it for configuring
Kaleidoscope.
Next, comment the lines dealing with mod_ssl
#<IfModule mod_ssl.c>
# Listen 443
#</IfModule>
Instruct the httpd process to load the necessary proxy
modules by copying some files from mods-available to mods-enabled
The files needed are proxy_connect.load, proxy_http.load,
proxy.load and proxy.conf
sudo mv mods-available/proxy_connect.load mods-enabled/
sudo mv mods-available/proxy.load mods-enabled/
sudo mv mods-available/proxy_http.load mods-enabled/
sudo mv mods-available/proxy.conf mods-enabled/
We turn on the proxy module and deny external users by
editing proxy.conf
cd mods-enabled
sudo vim proxy.conf
After you edit your file it should look like this example:
<IfModule mod_proxy.c>
|
#turning ProxyRequests on and allowing
proxying from all may allow
#spammers to use your proxy to send email.
ProxyRequests on
AllowCONNECT 443
<Proxy *>
|
AddDefaultCharset off
Order deny,allow
Deny from all
Allow from localhost
|
</Proxy>
# Enable/disable the handling of HTTP/1.1 "Via:" headers.
# ("Full" adds the server version; "Block" removes all outgoing
Via: headers)
# Set to one of: Off | On | Full | Block
#ProxyVia On
|
</IfModule>
We are nearly done. Restart apache for the changes to take
effect:
sudo apache2ctl restart
To test the configuration try and send proxy requests from
your Web browser:
On Firefox: Go to Edit->Preferences, under the Advanced
dialog choose the Network tab. Press Settings.
Choose Manual proxy configuration and enter localhost
as the Http Proxy and your chosen port under Port.
Try and access a web page.
You may now install and run Kaleidoscope in Proxy mode (See
installation guide.)