by Andrew Watters
This is a tutorial for absolute beginners.
2015-10-17 -- Update: if you upgrade to Mac OS X 10.11 (El Capitan), you have to recompile and reinstall Privoxy. Follow steps two through the end below.
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):
curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-2.68.tar.gz
tar -xzf autoconf-2.68.tar.gz
sudo make install
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.
The latest source code can be found here.
Decompress the downloaded file.
sudo make install
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.
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.
Change the value of 0 to 1, which will let you configure privoxy from its web interface.
Write the file and quit.
sudo vi org.privoxy.plist
Hit "i" and paste the code in this file into your new file.
Change the owner of org.privoxy.plist to root:wheel.
sudo chown root:wheel org.privoxy.plist
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.
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."
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.
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
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