1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
5 <title>Installation</title>
6 <meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.79">
7 <link rel="HOME" title="Privoxy 3.0.30 User Manual" href="index.html">
8 <link rel="PREVIOUS" title="Introduction" href="introduction.html">
9 <link rel="NEXT" title="What's New in this Release" href="whatsnew.html">
10 <link rel="STYLESHEET" type="text/css" href="../p_doc.css">
11 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
12 <link rel="STYLESHEET" type="text/css" href="p_doc.css">
14 <body class="SECT1" bgcolor="#EEEEEE" text="#000000" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <div class="NAVHEADER">
16 <table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
18 <th colspan="3" align="center">Privoxy 3.0.30 User Manual</th>
21 <td width="10%" align="left" valign="bottom"><a href="introduction.html" accesskey="P">Prev</a></td>
22 <td width="80%" align="center" valign="bottom"></td>
23 <td width="10%" align="right" valign="bottom"><a href="whatsnew.html" accesskey="N">Next</a></td>
26 <hr align="left" width="100%">
29 <h1 class="SECT1"><a name="INSTALLATION" id="INSTALLATION">2. Installation</a></h1>
30 <p><span class="APPLICATION">Privoxy</span> is available both in convenient pre-compiled packages for a wide range
31 of operating systems, and as raw source code. For most users, we recommend using the packages, which can be
32 downloaded from our <a href="https://sourceforge.net/projects/ijbswa/" target="_top">Privoxy Project Page</a>.</p>
33 <p>Note: On some platforms, the installer may remove previously installed versions, if found. (See below for your
34 platform). In any case <span class="emphasis"><i class="EMPHASIS">be sure to backup your old configuration if it is
35 valuable to you.</i></span> See the <a href="whatsnew.html#UPGRADERSNOTE">note to upgraders</a> section below.</p>
37 <h2 class="SECT2"><a name="INSTALLATION-PACKAGES" id="INSTALLATION-PACKAGES">2.1. Binary Packages</a></h2>
38 <p>How to install the binary packages depends on your operating system:</p>
40 <h3 class="SECT3"><a name="INSTALLATION-DEB" id="INSTALLATION-DEB">2.1.1. Debian and Ubuntu</a></h3>
41 <p>DEBs can be installed with <tt class="LITERAL">apt-get install privoxy</tt>, and will use <tt class=
42 "FILENAME">/etc/privoxy</tt> for the location of configuration files.</p>
45 <h3 class="SECT3"><a name="INSTALLATION-PACK-WIN" id="INSTALLATION-PACK-WIN">2.1.2. Windows</a></h3>
46 <p>Just double-click the installer, which will guide you through the installation process. You will find the
47 configuration files in the same directory as you installed <span class="APPLICATION">Privoxy</span> in.</p>
48 <p>Version 3.0.5 beta introduced full <span class="APPLICATION">Windows</span> service functionality. On
49 Windows only, the <span class="APPLICATION">Privoxy</span> program has two new command line arguments to
50 install and uninstall <span class="APPLICATION">Privoxy</span> as a <span class="emphasis"><i class=
51 "EMPHASIS">service</i></span>.</p>
52 <div class="VARIABLELIST">
56 <p><tt class="REPLACEABLE"><i>--install</i></tt>[:<tt class="REPLACEABLE"><i>service_name</i></tt>]</p>
57 <p><tt class="REPLACEABLE"><i>--uninstall</i></tt>[:<tt class="REPLACEABLE"><i>service_name</i></tt>]</p>
61 <p>After invoking <span class="APPLICATION">Privoxy</span> with <b class="COMMAND">--install</b>, you will need
62 to bring up the <span class="APPLICATION">Windows</span> service console to assign the user you want
63 <span class="APPLICATION">Privoxy</span> to run under, and whether or not you want it to run whenever the
64 system starts. You can start the <span class="APPLICATION">Windows</span> services console with the following
65 command: <b class="COMMAND">services.msc</b>. If you do not take the manual step of modifying <span class=
66 "APPLICATION">Privoxy's</span> service settings, it will not start. Note too that you will need to give Privoxy
67 a user account that actually exists, or it will not be permitted to write to its log and configuration
71 <h3 class="SECT3"><a name="INSTALLATION-MAC" id="INSTALLATION-MAC">2.1.3. Mac OS X</a></h3>
72 <p>Installation instructions for the OS X platform depend upon whether you downloaded a ready-built
73 installation package (.pkg or .mpkg) or have downloaded the source code.</p>
76 <h4 class="SECT3"><a name="OS-X-INSTALL-FROM-PACKAGE" id="OS-X-INSTALL-FROM-PACKAGE">2.1.4. Installation from
77 ready-built package</a></h4>
78 <p>The downloaded file will either be a .pkg (for OS X 10.5 upwards) or a bzipped .mpkg file (for OS X 10.4).
79 The former can be double-clicked as is and the installation will start; double-clicking the latter will unzip
80 the .mpkg file which can then be double-clicked to commence the installation.</p>
81 <p>The privoxy service will automatically start after a successful installation (and thereafter every time your
82 computer starts up) however you will need to configure your web browser(s) to use it. To do so, configure them
83 to use a proxy for HTTP and HTTPS at the address 127.0.0.1:8118.</p>
84 <p>To prevent the privoxy service from automatically starting when your computer starts up, remove or rename
85 the file <tt class="LITERAL">/Library/LaunchDaemons/org.ijbswa.privoxy.plist</tt> (on OS X 10.5 and higher) or
86 the folder named <tt class="LITERAL">/Library/StartupItems/Privoxy</tt> (on OS X 10.4 'Tiger').</p>
87 <p>To manually start or stop the privoxy service, use the scripts startPrivoxy.sh and stopPrivoxy.sh supplied
88 in /Applications/Privoxy. They must be run from an administrator account, using sudo.</p>
89 <p>To uninstall, run /Applications/Privoxy/uninstall.command as sudo from an administrator account.</p>
92 <h4 class="SECT3"><a name="OS-X-INSTALL-FROM-SOURCE" id="OS-X-INSTALL-FROM-SOURCE">2.1.5. Installation from
94 <p>To build and install the Privoxy source code on OS X you will need to obtain the macsetup module from the
95 Privoxy Sourceforge CVS repository (refer to Sourceforge help for details of how to set up a CVS client to have
96 read-only access to the repository). This module contains scripts that leverage the usual open-source tools
97 (available as part of Apple's free of charge Xcode distribution or via the usual open-source software package
98 managers for OS X (MacPorts, Homebrew, Fink etc.) to build and then install the privoxy binary and associated
99 files. The macsetup module's README file contains complete instructions for its use.</p>
100 <p>The privoxy service will automatically start after a successful installation (and thereafter every time your
101 computer starts up) however you will need to configure your web browser(s) to use it. To do so, configure them
102 to use a proxy for HTTP and HTTPS at the address 127.0.0.1:8118.</p>
103 <p>To prevent the privoxy service from automatically starting when your computer starts up, remove or rename
104 the file <tt class="LITERAL">/Library/LaunchDaemons/org.ijbswa.privoxy.plist</tt> (on OS X 10.5 and higher) or
105 the folder named <tt class="LITERAL">/Library/StartupItems/Privoxy</tt> (on OS X 10.4 'Tiger').</p>
106 <p>To manually start or stop the privoxy service, use the Privoxy Utility for Mac OS X (also part of the
107 macsetup module). This application can start and stop the privoxy service and display its log and configuration
109 <p>To uninstall, run the macsetup module's uninstall.sh as sudo from an administrator account.</p>
112 <h3 class="SECT3"><a name="INSTALLATION-FREEBSD" id="INSTALLATION-FREEBSD">2.1.6. FreeBSD</a></h3>
113 <p>Privoxy is part of FreeBSD's Ports Collection, you can build and install it with <tt class="LITERAL">cd
114 /usr/ports/www/privoxy; make install clean</tt>.</p>
118 <h2 class="SECT2"><a name="INSTALLATION-SOURCE" id="INSTALLATION-SOURCE">2.2. Building from Source</a></h2>
119 <p>The most convenient way to obtain the <span class="APPLICATION">Privoxy</span> source code is to download the
120 source tarball from our <a href="https://sourceforge.net/projects/ijbswa/files/Sources/" target="_top">project
121 download page</a>, or you can get the up-to-the-minute, possibly unstable, development version from <a href=
122 "https://www.privoxy.org/" target="_top">https://www.privoxy.org/</a>.</p>
123 <p>To build <span class="APPLICATION">Privoxy</span> from source, <a href=
124 "http://www.gnu.org/software/autoconf/autoconf.html" target="_top">autoconf</a>, <a href=
125 "http://www.gnu.org/software/make/make.html" target="_top">GNU make (gmake)</a>, and, of course, a C compiler
126 like <a href="http://www.gnu.org/software/gcc/gcc.html" target="_top">gcc</a> are required.</p>
127 <p>When building from a source tarball, first unpack the source:</p>
128 <table border="0" bgcolor="#E0E0E0" width="100%">
131 <pre class="SCREEN"> tar xzvf privoxy-3.0.30-beta-src.tar.gz
132 cd privoxy-3.0.30-beta</pre>
136 <p>To build the development version, you can get the source code by doing:</p>
137 <table border="0" bgcolor="#E0E0E0" width="100%">
140 <pre class="SCREEN"> cd <root-dir>
141 git clone https://www.privoxy.org/git/privoxy.git</pre>
145 <p>This will create a directory named <tt class="FILENAME"><root-dir>/privoxy/</tt>, which will contain
147 <p>Note that source code in Git is development quality, and may not be stable or well tested.</p>
148 <p>It is strongly recommended to not run <span class="APPLICATION">Privoxy</span> as root. You should
149 configure/install/run <span class="APPLICATION">Privoxy</span> as an unprivileged user, preferably by creating a
150 <span class="QUOTE">"privoxy"</span> user and group just for this purpose. See your local documentation for the
151 correct command line to do add new users and groups (something like <b class="COMMAND">adduser</b>, but the
152 command syntax may vary from platform to platform).</p>
153 <p><tt class="FILENAME">/etc/passwd</tt> might then look like:</p>
154 <table border="0" bgcolor="#E0E0E0" width="100%">
157 <pre class="SCREEN"> privoxy:*:7777:7777:privoxy proxy:/no/home:/no/shell</pre>
161 <p>And then <tt class="FILENAME">/etc/group</tt>, like:</p>
162 <table border="0" bgcolor="#E0E0E0" width="100%">
165 <pre class="SCREEN"> privoxy:*:7777:</pre>
169 <p>Some binary packages may do this for you.</p>
170 <p>Then, to build from either unpacked tarball or Git checkout:</p>
171 <table border="0" bgcolor="#E0E0E0" width="100%">
174 <pre class="SCREEN"> autoheader
176 ./configure # (--help to see options)
177 make # (the make from GNU, sometimes called gmake)
178 su # Possibly required
179 make -n install # (to see where all the files will go)
180 make -s install # (to really install, -s to silence output)</pre>
184 <p>Using GNU <b class="COMMAND">make</b>, you can have the first four steps automatically done for you by just
186 <table border="0" bgcolor="#E0E0E0" width="100%">
189 <pre class="SCREEN"> make</pre>
193 <p>in the freshly downloaded or unpacked source directory.</p>
194 <p>To build an executable with security enhanced features so that users cannot easily bypass the proxy (e.g.
195 <span class="QUOTE">"Go There Anyway"</span>), or alter their own configurations, <b class=
196 "COMMAND">configure</b> like this:</p>
197 <table border="0" bgcolor="#E0E0E0" width="100%">
200 <pre class="SCREEN"> ./configure --disable-toggle --disable-editor --disable-force</pre>
204 <p>Note that all of these options can also be disabled through the configuration file.</p>
205 <p><span class="emphasis"><i class="EMPHASIS">WARNING:</i></span> If installing as root, the install will fail
206 unless a non-root user or group is specified, or a <tt class="LITERAL">privoxy</tt> user and group already exist
207 on the system. If a non-root user is specified, and no group, then the installation will try to also use a group
208 of the same name as <span class="QUOTE">"user"</span>. If a group is specified (and no user), then the support
209 files will be installed as writable by that group, and owned by the user running the installation.</p>
210 <p><b class="COMMAND">configure</b> accepts <tt class="LITERAL">--with-user</tt> and <tt class=
211 "LITERAL">--with-group</tt> options for setting user and group ownership of the configuration files (which need
212 to be writable by the daemon). The specified <span class="emphasis"><i class="EMPHASIS">user must already
213 exist</i></span>. When starting <span class="APPLICATION">Privoxy</span>, it must be run as this same user to
214 insure write access to configuration and log files!</p>
215 <p>Alternately, you can specify <tt class="LITERAL">user</tt> and <tt class="LITERAL">group</tt> on the <b class=
216 "COMMAND">make</b> command line, but be sure both already exist:</p>
217 <table border="0" bgcolor="#E0E0E0" width="100%">
220 <pre class="SCREEN"> make -s install USER=privoxy GROUP=privoxy</pre>
224 <p>The default installation path for <b class="COMMAND">make install</b> is <tt class="FILENAME">/usr/local</tt>.
225 This may of course be customized with the various <b class="COMMAND">./configure</b> path options. If you are
226 doing an install to anywhere besides <tt class="FILENAME">/usr/local</tt>, be sure to set the appropriate paths
227 with the correct configure options (<b class="COMMAND">./configure --help</b>). Non-privileged users must of
228 course have write access permissions to wherever the target installation is going.</p>
229 <p>If you do install to <tt class="FILENAME">/usr/local</tt>, the install will use <tt class=
230 "LITERAL">sysconfdir=$prefix/etc/privoxy</tt> by default. All other destinations, and the direct usage of
231 <tt class="LITERAL">--sysconfdir</tt> flag behave like normal, i.e. will not add the extra <tt class=
232 "FILENAME">privoxy</tt> directory. This is for a safer install, as there may already exist another program that
233 uses a file with the <span class="QUOTE">"config"</span> name, and thus makes <tt class=
234 "FILENAME">/usr/local/etc</tt> cleaner.</p>
235 <p>If installing to <tt class="FILENAME">/usr/local</tt>, the documentation will go by default to <tt class=
236 "FILENAME">$prefix/share/doc</tt>. But if this directory doesn't exist, it will then try <tt class=
237 "FILENAME">$prefix/doc</tt> and install there before creating a new <tt class="FILENAME">$prefix/share/doc</tt>
238 just for <span class="APPLICATION">Privoxy</span>.</p>
239 <p>Again, if the installs goes to <tt class="FILENAME">/usr/local</tt>, the <tt class=
240 "LITERAL">localstatedir</tt> (ie: <tt class="FILENAME">var/</tt>) will default to <tt class="FILENAME">/var</tt>
241 instead of <tt class="LITERAL">$prefix/var</tt> so the logs will go to <tt class=
242 "FILENAME">/var/log/privoxy/</tt>, and the pid file will be created in <tt class=
243 "FILENAME">/var/run/privoxy.pid</tt>.</p>
244 <p><b class="COMMAND">make install</b> will attempt to set the correct values in <tt class="FILENAME">config</tt>
245 (main configuration file). You should check this to make sure all values are correct. If appropriate, an init
246 script will be installed, but it is up to the user to determine how and where to start <span class=
247 "APPLICATION">Privoxy</span>. The init script should be checked for correct paths and values, if anything other
248 than a default install is done.</p>
249 <p>If install finds previous versions of local configuration files, most of these will not be overwritten, and
250 the new ones will be installed with a <span class="QUOTE">"new"</span> extension. default.action and
251 default.filter <span class="emphasis"><i class="EMPHASIS">will be overwritten</i></span>. You will then need to
252 manually update the other installed configuration files as needed. The default template files <span class=
253 "emphasis"><i class="EMPHASIS">will</i></span> be overwritten. If you have customized, local templates, these
254 should be stored safely in a separate directory and defined in <tt class="FILENAME">config</tt> by the
255 <span class="QUOTE">"templdir"</span> directive. It is of course wise to always back-up any important
256 configuration files <span class="QUOTE">"just in case"</span>. If a previous version of <span class=
257 "APPLICATION">Privoxy</span> is already running, you will have to restart it manually.</p>
258 <p>For more detailed instructions on how to build Redhat RPMs, Windows self-extracting installers, building on
259 platforms with special requirements etc, please consult the <a href=
260 "https://www.privoxy.org/developer-manual/newrelease.html" target="_top">developer manual</a>.</p>
262 <h3 class="SECT3"><a name="WINBUILD-CYGWIN" id="WINBUILD-CYGWIN">2.2.1. Windows</a></h3>
264 <h4 class="SECT4"><a name="WINBUILD-SETUP" id="WINBUILD-SETUP">2.2.1.1. Setup</a></h4>
265 <p>Install the Cygwin utilities needed to build <span class="APPLICATION">Privoxy</span>. If you have a 64
266 bit CPU (which most people do by now), get the Cygwin setup-x86_64.exe program <a href=
267 "https://cygwin.com/setup-x86_64.exe" target="_top">here</a> (the .sig file is <a href=
268 "https://cygwin.com/setup-x86_64.exe.sig" target="_top">here</a>).</p>
269 <p>Run the setup program and from View / Category select:</p>
270 <table border="0" bgcolor="#E0E0E0" width="100%">
273 <pre class="SCREEN"> Devel
282 mingw64-i686-gcc-core
287 libxslt: GNOME XSLT library (runtime)
303 <p>If you haven't already downloaded the Privoxy source code, get it now:</p>
304 <table border="0" bgcolor="#E0E0E0" width="100%">
307 <pre class="SCREEN"> mkdir <root-dir>
309 git clone https://www.privoxy.org/git/privoxy.git</pre>
313 <p>Get the source code (.zip or .tar.gz) for tidy from <a href="https://github.com/htacg/tidy-html5/releases"
314 target="_top">https://github.com/htacg/tidy-html5/releases</a>, unzip into <root-dir> and build the
316 <table border="0" bgcolor="#E0E0E0" width="100%">
319 <pre class="SCREEN"> cd <root-dir>
320 cd tidy-html5-x.y.z/build/cmake
321 cmake ../.. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIB:BOOL=OFF -DCMAKE_INSTALL_PREFIX=/usr/local
322 make && make install</pre>
326 <p>If you want to be able to make a Windows release package, get the NSIS .zip file from <a href=
327 "https://sourceforge.net/projects/nsis/files/NSIS%203/" target=
328 "_top">https://sourceforge.net/projects/nsis/files/NSIS%203/</a> and extract the NSIS directory to <tt class=
329 "LITERAL">privoxy/windows</tt>. Then edit the windows/GNUmakefile to set the location of the NSIS executable
331 <table border="0" bgcolor="#E0E0E0" width="100%">
334 <pre class="SCREEN"># Path to NSIS
335 MAKENSIS = ./nsis/makensis.exe</pre>
341 <h4 class="SECT4"><a name="WINBUILD-BUILD" id="WINBUILD-BUILD">2.2.1.2. Build</a></h4>
342 <p>To build just the Privoxy executable and not the whole installation package, do:</p>
343 <table border="0" bgcolor="#E0E0E0" width="100%">
346 <pre class="PROGRAMLISTING"> cd <root-dir>/privoxy
347 ./windows/MYconfigure && make</pre>
351 <p>Privoxy uses the <a href="https://en.wikipedia.org/wiki/GNU_build_system" target="_top">GNU Autotools</a>
352 for building software, so the process is:</p>
353 <table border="0" bgcolor="#E0E0E0" width="100%">
356 <pre class="PROGRAMLISTING"> $ autoheader # creates config.h.in
357 $ autoconf # uses config.h.in to create the configure shell script
358 $ ./configure [options] # creates GNUmakefile
359 $ make [options] # builds the program</pre>
363 <p>The usual <tt class="LITERAL">configure</tt> options for building a native Windows application under
365 <table border="0" bgcolor="#E0E0E0" width="100%">
368 <pre class="LITERALLAYOUT"> --host=i686-w64-mingw32
371 --enable-static-linking
373 --disable-dynamic-pcre</pre>
377 <p>You can set the <tt class="LITERAL">CFLAGS</tt> and <tt class="LITERAL">LDFLAGS</tt> envars before running
378 <tt class="LITERAL">configure</tt> to set compiler and linker flags. For example:</p>
379 <table border="0" bgcolor="#E0E0E0" width="100%">
382 <pre class="PROGRAMLISTING"> $ export CFLAGS="-O2" # set gcc optimization level
383 $ export LDFLAGS="-Wl,--nxcompat" # Enable DEP
384 $ ./configure --host=i686-w64-mingw32 --enable-mingw32 --enable-zlib \
385 > --enable-static-linking --disable-pthread --disable-dynamic-pcre
386 $ make # build Privoxy</pre>
390 <p>See the <a href="../developer-manual/newrelease.html#NEWRELEASE-WINDOWS" target="_top">Developer's
391 Manual</a> for building a Windows release package.</p>
396 <h2 class="SECT2"><a name="INSTALLATION-KEEPUPDATED" id="INSTALLATION-KEEPUPDATED">2.3. Keeping your Installation
398 <p>If you wish to receive an email notification whenever we release updates of <span class=
399 "APPLICATION">Privoxy</span> or the actions file, <a href=
400 "https://lists.privoxy.org/mailman/listinfo/privoxy-announce" target="_top">subscribe to our announce mailing
401 list</a>, privoxy-announce@lists.privoxy.org.</p>
402 <p>In order not to lose your personal changes and adjustments when updating to the latest <tt class=
403 "LITERAL">default.action</tt> file we <span class="emphasis"><i class="EMPHASIS">strongly recommend</i></span>
404 that you use <tt class="LITERAL">user.action</tt> and <tt class="LITERAL">user.filter</tt> for your local
405 customizations of <span class="APPLICATION">Privoxy</span>. See the <a href="actions-file.html">Chapter on
406 actions files</a> for details.</p>
409 <div class="NAVFOOTER">
410 <hr align="left" width="100%">
411 <table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
413 <td width="33%" align="left" valign="top"><a href="introduction.html" accesskey="P">Prev</a></td>
414 <td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">Home</a></td>
415 <td width="33%" align="right" valign="top"><a href="whatsnew.html" accesskey="N">Next</a></td>
418 <td width="33%" align="left" valign="top">Introduction</td>
419 <td width="34%" align="center" valign="top"> </td>
420 <td width="33%" align="right" valign="top">What's New in this Release</td>