Privoxy on Mac OS X Howto

by Andrew Watters

This is a tutorial for absolute beginners.

2014-02-01 -- Update: I finally upgraded to Mac OS X 10.9.1 (Mavericks) from 10.7.2 (Lion). Everything here stays the same, except that when you try to compile from Terminal, you will be prompted to download the C compiler if you don't already have it. That's a nice touch.

Step Zero: install Xcode and autoconf

Before doing anything else, make sure you have Xcode installed. Xcode is necessary to compile applications from source. It's currently available from the App Store for free. You need to reboot your computer after installing, FYI.

The latest version of Xcode does not include the command line tools that are required for this method to work. Before proceeding to the main steps, install autoconf (which includes autoheader and autoconf):

Open Terminal.

curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-2.68.tar.gz

tar -xzf autoconf-2.68.tar.gz

cd autoconf-2.68

./configure

make

sudo make install

Step One: create privoxy user and group

Open system preferences and select Users & Groups. Click the lock to make changes. Add a new user named "privoxy" with any password you like. I suggest "privoxy." You can make the user a "sharing only" user if you don't want it to appear in the login window-- your preference.

Add a new group named "privoxy" and add the newly created privoxy user to it.

Step Two: download privoxy

The latest source code can be found here.

Decompress the downloaded file.

Step Three: compile and install privoxy

Open Terminal.

cd ~/Downloads/privoxy*

autoheader

autoconf

./configure

make

sudo make install

Step Four: edit privoxy's config file

For instructions on using vim, my preferred editor, go here.

sudo vi /usr/local/etc/privoxy/config

Search for "enable-remote-toggle" until you see the appropriate line in the editor (the line without a "#" at the beginning). You will need to repeat the search several times.

/enable-remote-toggle

Keep hitting "/" and Enter until you get to the right line. Move the cursor over to the "0" and hit "x" to delete it. Hit "i" to insert and then "1" which will change the value of 0 to 1. This will let you turn privoxy on and off from its web interface.

Hit Escape and search for "enable-edit-actions" until you find the appropriate line in the file.

/enable-edit-actions

Change the value of 0 to 1, which will let you configure privoxy from its web interface.

Write the file and quit.

:wq

Step Five: set up a launch daemon

cd /Library/LaunchDaemons

sudo vi org.privoxy.plist

Hit "i" and paste the code in this file into your new file.

:wq

Change the owner of org.privoxy.plist to root:wheel.

sudo chown root:wheel org.privoxy.plist

Step Six: launch privoxy as user privoxy

sudo /usr/local/sbin/privoxy --user privoxy /usr/local/etc/privoxy/config

Confirm that privoxy is running.

ps -ax | grep privoxy

If you see the above, privoxy is running.

Step Seven: configure network settings to use privoxy

In System Preferences, open Network. Click the "Advanced" button in the lower right. Click the "Proxies" tab. Click the check boxes next to "Web Proxy (HTTP)" and "Secure Web Proxy (HTTPS)." Select Web Proxy and type in 127.0.0.1 with port 8118. Do the same for Secure Web Proxy. Click "OK" and then "Apply."

Step Eight: test and configure privoxy

Open your favorite ad-filled website in Safari and confirm that you see checkered boxes where ads would normally appear.

Open "http://p.p" in your browser.

Click "View & change the current configuration."

Edit as appropriate. Visit the privoxy website for detailed instructions on editing. By default no editing is required but you may want to add exceptions/trusted sites if they don't work with privoxy enabled.

Step Nine: confirm that the LaunchDaemon works

Go back to Terminal or restart your computer from the Apple menu.

sudo shutdown -r now

Log in normally. Open Terminal.

ps -ax | grep privoxy

Success!

Troubleshooting

If you followed the steps above exactly right, you should have no problems. If you do have problems, email me a detailed description of the problem and any screenshots that might help, and I'll do what I can to help you out. I'm no expert on privoxy, so hopefully the problem is not too serious!

The number one issue is probably going to be that you previously tried to install Privoxy using MacPorts or some other guide. In that case, you would already have a privoxy user created from the command line that is not visible in System Preferences. You can delete that user and group with the following commands:

sudo dscl . delete /groups/privoxy

sudo dscl . delete /users/privoxy

Once you've deleted the privoxy user (or _privoxy, depending on which online guide you followed), you can recreate the user and group from System Preferences and everything should work properly.

2011-12-02 07:53 PST

Home

top