Installing Multiple Instances of Privoxy under OSX (for use in Privoxy/Tor Bundle Installations) Tutorial by David Kibrick Last Updated: 1/1/08 You may freely redistribute this document in any known physical or digital form, provided that you do not receive any compensation for said redistribution, and providing that you retain this header and license statement in its entirety. THIS DOCUMENTATION IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID KIBRICK BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This is a quick tutorial on how to run multiple instances of Privoxy on a computer running Mac OS X. This is useful if you like to be able to browse with the convenience of Privoxy, but not while using Tor, simply by doing a quick proxy switch in your browser (for example, using a plugin like SwitchProxy), rather than having to edit the config file and stop/start Privoxy. The added bonus of this is that you can keep your normal Privoxy install when installing the Tor bundle, as the package install causes problems with my previous workaround (PrivoxySwitcher shell script for Tor). This tutorial assumes that you have a previous install of Privoxy, generally from the Tor/Privoxy/Vidalia bundle. If you have not installed the bundle, do this first, so that you will have some files available to copy in later steps of this tutorial. This tutorial also assumes that you are comfortable doing administrative-type actions on your computer and editing text-based configuration files, and have access to an administrator account, which you will need to complete the installation. Disclaimer: This tutorial is not endorsed in any way by the Tor or Privoxy projects. By using Privoxy without Tor, you will be able to block some information, but your IP will not be masked, and you will not have the more complete anonymity offered by Tor. This setup has been tested under OSX 10.4 and 10.5. Steps: Configuring New Privoxy Installation -If you have not downloaded and installed the Tor/Privoxy/Vidalia bundle, do so now. -Download and unzip the latest privoxy package from privoxy.org. -Use an unpackager utility (such as unpkg - http://www.timdoug.com/unpkg/) to unpackage the file to a folder. -Name this folder something nifty, like "NewPrivoxy" and add to your system library folder. -(optional?) Rename privoxy executable (this allows you to differentiate between the processes in Activity Monitor) -Edit the Privoxy shell script in your new StartupItems folder to reflect all of the new file paths and executable name (if changed) -Edit the new config file, change the listening port number to a new port other than 8118 -Important: If you don't want Privoxy to log every site you visit, comment out debug option 1 in the config file! -If necessary, make copies of config.new and user_action.new, strip the .new off of the ends (otherwise you will get errors when starting the proxy) -Edit the StartPrivoxy command to reflect the new file paths (and executable name if you changed it) -Run StartPrivoxy.command in your new install folder, check terminal to make sure no errors come up -Finally, test the new proxy in a web browser to see if it's working (easiest way is to go to config.privoxy.org and see if the proxy is showing up on the new port number) -(optional) If you are running Firefox, install the SwitchProxy extension (https://addons.mozilla.org/en-US/firefox/addon/125) or other proxy switcher of your choice to allow for easy switching between the different proxy settings. Configuring Startup Item -Go into /Library/StartupItems, copy existing Privoxy folder to a new name that matches the name of your new Privoxy install folder. -edit the .loc file to the directory path of your new install. -Rename the startup shell script to the exact name of the new StartupItem folder you created -Edit the shell script to reflect the new path and executable (should be automatic with info pulled from the .loc file, might need to rename the executable if you changed the name in an earlier step) -Edit the StartupParameters.plist file to reflect the name and information of the new file. You should make sure to change the Provides statement to something other than the normal description for Privoxy. Some caveats: -Always check that your startup item entries are set to root/wheel permissions (under 10.5, at least, the system should automatically prompt you to correct these permissions if they are set incorrectly) -Make sure that the name of the startup item folder and the name of the startup shell script are exactly the same (including capitalization) -In the startup parameters plist, make sure the providing definition is set to something other than the default (for example, "Not Tor Proxy") - if you still have problems, set order preference to Last -If dynamic file paths are not working, change the StartupItems shell script for starting Privoxy to manually write out all of the commands and file paths, as shown in the example below Here are some sample configs, using the new Privoxy install directory in your Library folder called PrivoxyNoTor and executable name privoxynotor: -----Privoxy.loc: /Library/PrivoxyNoTor -----PrivoxyNoTor (startup shell script without file extension): #!/bin/sh daemonpath="`cat /Library/StartupItems/PrivoxyNoTor/Privoxy.loc`" daemonname="privoxynotor" daemonpidfile="/var/run/${daemonname}.pid" daemonexe=privoxynotor daemonconfigfile="config" . /etc/rc.common StartService () { ConsoleMessage "Starting Privoxy" cd /Library/PrivoxyNoTor ./privoxynotor --pidfile /var/run/privoxynonor.pid config } StopService () { ConsoleMessage "Stopping Privoxy" kill $(cat /var/run/privoxynotor.pid) } RestartService () { StopService; StartService; } RunService "$1" -----StartupParameters.plist { Description = "Privoxy - No Tor"; Provides = ("Not Tor Proxy"); Requires = ("Resolver"); Uses = ("Network"); OrderPreference = "Last"; Messages = { start = "Starting PrivoxyNoTor"; stop = "Stopping PrivoxyNoTor"; }; } Contact If you have any questions, comments, or suggestions on this documentation, please send them to the author using the form at https://ophideran.tchmachines.com/~netboot/secmail.html.