2 File : doc/source/buildsource.sgml
4 Purpose : Entity included in other project documents.
6 Copyright (C) 2001-2018 Privoxy Developers https://www.privoxy.org/
9 ======================================================================
10 This file used for inclusion with other documents only.
11 ======================================================================
13 If you make changes to this file, please verify the finished
14 docs all display as intended.
16 This file is included into:
23 To build <application>Privoxy</application> from source,
24 <ulink url="http://www.gnu.org/software/autoconf/autoconf.html">autoconf</ulink>,
25 <ulink url="http://www.gnu.org/software/make/make.html">GNU make (gmake)</ulink>,
26 and, of course, a C compiler like
27 <ulink url="http://www.gnu.org/software/gcc/gcc.html">gcc</ulink> are required.
31 When building from a source tarball,
32 <!-- no longer available ...
33 <ulink url="http://cvs.sourceforge.net/cvstarballs/ijbswa-cvsroot.tar.gz">
34 nightly CVS tarball</ulink>),
36 first unpack the source:
40 tar xzvf privoxy-&p-version;<![%p-not-stable;[-beta]]><![%p-stable;[-stable]]>-src.tar.gz
41 cd privoxy-&p-version;<![%p-not-stable;[-beta]]><![%p-stable;[-stable]]>
45 To build the development version, you can get the source code by doing:
50 git clone https://www.privoxy.org/git/privoxy.git
54 This will create a directory named <filename><root-dir>/privoxy/</filename>,
55 which will contain the source tree.
59 Note that source code in Git is development quality, and may not be
60 stable or well tested.
64 You can also check out any <application>Privoxy</application>
65 <quote>branch</quote>, just exchange the <application>current</application>
66 name with the wanted branch name (Example: v_3_0_branch for the 3.0 cvs
71 It is strongly recommended to not run <application>Privoxy</application>
72 as root. You should configure/install/run <application>Privoxy</application> as
73 an unprivileged user, preferably by creating a <quote>privoxy</quote> user
74 and group just for this purpose. See your local documentation for the correct
75 command line to do add new users and groups (something like
76 <command>adduser</command>, but the command syntax may vary from platform
81 <filename>/etc/passwd</filename> might then look like:
84 <screen> privoxy:*:7777:7777:privoxy proxy:/no/home:/no/shell</screen>
87 And then <filename>/etc/group</filename>, like:
90 <screen> privoxy:*:7777:</screen>
93 Some binary packages may do this for you.
97 Then, to build from either unpacked tarball or CVS source:
103 ./configure # (--help to see options)
104 make # (the make from GNU, sometimes called gmake)
105 su # Possibly required
106 make -n install # (to see where all the files will go)
107 make -s install # (to really install, -s to silence output)</screen>
110 Using GNU <command>make</command>, you can have the first four steps
111 automatically done for you by just typing:
119 in the freshly downloaded or unpacked source directory.
123 To build an executable with security enhanced features so that
124 users cannot easily bypass the proxy (e.g. <quote>Go There Anyway</quote>), or
125 alter their own configurations, <command>configure</command> like this:
128 ./configure --disable-toggle --disable-editor --disable-force</screen>
130 Note that all of these options can also be disabled through the configuration file.
133 <emphasis>WARNING:</emphasis> If installing as root, the install will fail
134 unless a non-root user or group is specified, or a <literal>privoxy</literal>
135 user and group already exist on the system. If a non-root user is specified,
136 and no group, then the installation will try to also use a group of the same name
137 as <quote>user</quote>. If a group is specified (and no user), then the
138 support files will be installed as writable by that group, and owned by the
139 user running the installation.
143 <command>configure</command> accepts <literal>--with-user</literal> and
144 <literal>--with-group</literal> options for setting user and group ownership
145 of the configuration files (which need to be writable by the daemon). The
146 specified <emphasis>user must already exist</emphasis>. When starting
147 <application>Privoxy</application>, it must be run as this same user to
148 insure write access to configuration and log files!
152 Alternately, you can specify <literal>user</literal> and <literal>group</literal>
153 on the <command>make</command> command line, but be sure both already exist:
157 make -s install USER=privoxy GROUP=privoxy</screen>
160 The default installation path for <command>make install</command> is
161 <filename>/usr/local</filename>. This may of course be customized with
162 the various <command>./configure</command> path options. If you are doing
163 an install to anywhere besides <filename>/usr/local</filename>, be
164 sure to set the appropriate paths with the correct configure options
165 (<command>./configure --help</command>). Non-privileged users must of course
166 have write access permissions to wherever the target installation is going.
170 If you do install to <filename>/usr/local</filename>, the install will use
171 <literal>sysconfdir=$prefix/etc/privoxy</literal> by default. All other
172 destinations, and the direct usage of <literal>--sysconfdir</literal> flag
173 behave like normal, i.e. will not add the extra <filename>privoxy</filename>
174 directory. This is for a safer install, as there may already exist another
175 program that uses a file with the <quote>config</quote> name, and thus makes
176 <filename>/usr/local/etc</filename> cleaner.
180 If installing to <filename>/usr/local</filename>, the documentation will go
181 by default to <filename>$prefix/share/doc</filename>. But if this directory
182 doesn't exist, it will then try <filename>$prefix/doc</filename> and install
183 there before creating a new <filename>$prefix/share/doc</filename> just for
184 <application>Privoxy</application>.
188 Again, if the installs goes to <filename>/usr/local</filename>, the
189 <literal>localstatedir</literal> (ie: <filename>var/</filename>) will default
190 to <filename>/var</filename> instead of <literal>$prefix/var</literal> so
191 the logs will go to <filename>/var/log/privoxy/</filename>, and the pid file
192 will be created in <filename>/var/run/privoxy.pid</filename>.
196 <command>make install</command> will attempt to set the correct values
197 in <filename>config</filename> (main configuration file). You should
198 check this to make sure all values are correct. If appropriate,
199 an init script will be installed, but it is up to the user to determine
200 how and where to start <application>Privoxy</application>. The init
201 script should be checked for correct paths and values, if anything other than
202 a default install is done.
206 If install finds previous versions of local configuration files, most of
207 these will not be overwritten, and the new ones will be installed with a
208 <quote>new</quote> extension. default.action and default.filter
209 <emphasis>will be overwritten</emphasis>. You will then need
210 to manually update the other installed configuration files as needed. The
211 default template files <emphasis>will</emphasis> be overwritten. If you have
212 customized, local templates, these should be stored safely in a separate
213 directory and defined in <filename>config</filename> by the
214 <quote>templdir</quote> directive. It is of course wise to always back-up any
215 important configuration files <quote>just in case</quote>. If a previous
216 version of <application>Privoxy</application> is already running, you will
217 have to restart it manually.
221 For more detailed instructions on how to build Redhat RPMs,
222 Windows self-extracting installers, building on platforms with
223 special requirements etc, please consult the <ulink
224 url="https://www.privoxy.org/developer-manual/newrelease.html">developer manual</ulink>.
227 <!-- print for README only -->
228 <!-- Actually this is now in INSTALL -->
231 The simplest command line to start <application>Privoxy</application> is
232 <command>$path/privoxy --user=privoxy $path/etc/privoxy/config</command>.
233 See <command>privoxy --usage</command>, or the man page, for other options,