]> git.sur5r.net Git - bacula/docs/blob - docs/manual/install.tex
Add data encryption chapter
[bacula/docs] / docs / manual / install.tex
1 %%
2 %%
3
4 \section*{Installing Bacula}
5 \label{_ChapterStart17}
6 \index[general]{Bacula!Installing }
7 \index[general]{Installing Bacula }
8 \addcontentsline{toc}{section}{Installing Bacula}
9
10 \subsection*{General}
11 \index[general]{General }
12 \addcontentsline{toc}{subsection}{General}
13
14 In general, you will need the Bacula source release, and if you want to run a
15 Windows client, you will need the Bacula Windows binary release. However,
16 Bacula needs certain third party packages (such as {\bf SQLite}, {\bf MySQL}, or
17 {\bf PostgreSQL}
18 to build properly depending on the options you specify. To simplify your task,
19 we have combined a number of these packages into two {\bf depkgs} releases
20 (Dependency Packages). This can vastly simplify your life by providing you
21 with all the necessary packages rather than requiring you to find them on the
22 Web, load them, and install them. 
23
24 \subsection*{Source Release Files}
25 \index[general]{Source Files}
26 \index[general]{Release Files}
27 \addcontentsline{toc}{subsection}{Source Release File}
28 Beginning with Bacula 1.38.0, the source code has been broken into
29 four separate tar files each corresponding to a different module in
30 the Bacula CVS. The released files are:
31
32 \begin{description}
33 \item [bacula-1.38.0.tar.gz]
34   This is the primary source code release for Bacula. On each
35   release the version number (1.38.0) will be updated.
36
37 \item [bacula-docs-1.38.0.tar.gz]
38   This file contains a copy of the docs directory with the
39   documents prebuild. English html directory, single html
40   file, and pdf file. The French and German translations
41   are in progress, but are not built.
42
43 \item [bacula-gui-1.38.0.tar.gz]
44   This file contains the non-core GUI programs. Currently,
45   it contains bacula-web, a PHP program for producing management
46   viewing of your Bacula job status in a browser; and bimagemgr
47   a browser program for burning CDROM images with Bacula Volumes.
48
49 \item [bacula-rescue-1.8.1.tar.gz]
50   This is the Bacula Rescue CDROM code. Note, the version number
51   of this package is not tied to the Bacula release version, so
52   it will be different.  Using this code, you can burn a CDROM
53   with your system configuration and containing a statically
54   linked version of the File daemon. This can permit you to easily
55   repartition and reformat your hard disks and reload your
56   system with Bacula in the case of a hard disk failure.
57
58 \item [winbacula-1.38.0.exe]
59   This file is the 32 bit Windows installer for installing
60   the Windows client (File daemon) on a Windows machine.
61
62 \end{description}
63
64 \label{upgrading1}
65 \subsection*{Upgrading Bacula}
66 \index[general]{Bacula!Upgrading }
67 \index[general]{Upgrading Bacula }
68 \addcontentsline{toc}{subsection}{Upgrading Bacula}
69
70 If you are upgrading from one Bacula version to another, you should first
71 carefully read the ReleaseNotes of all versions between your current version
72 and the version to which you are upgrading. If the Bacula catalog database has
73 been upgraded, you will either need to reinitialize your database starting
74 from scratch, or save an ASCII copy of your database, then proceed to upgrade
75 it. This is normally done after Bacula is build and installed by:
76
77 \begin{verbatim}
78 cd <installed-scripts-dir> (default /etc/bacula)
79 ./update_bacula_tables
80 \end{verbatim}
81
82 This update script can also be find in the Bacula source src/cats
83 directory.
84
85 If there are several database upgrades between your version and the
86 version to which you are upgrading, you will need to apply each database
87 upgrade script. For your convenience, you can find all the old upgrade scripts
88 in the {\bf upgradedb} directory of the source code. You will need to edit the
89 scripts to correspond to your system configuration. The final upgrade script,
90 if any, can be applied as noted above.
91
92 If you are upgrading from one major version to another, you will need to
93 replace all your components at the same time as generally the inter-daemon
94 protocol will change. However, within any particular release (e.g. version
95 1.32.x) unless there is an oversight or bug, the daemon protocol will not
96 change. If this is confusing, simply read the ReleaseNotes very carefully as
97 they will note if all daemons must be upgraded at the same time. 
98
99 Finally, please note that in general it is not necessary to do a 
100 {\bf make uninstall} before doing an upgrade. In fact, if you do so, you will 
101 most likely delete all your conf files, which could be disastrous.
102 The normal procedure during an upgrade is simply:
103 \begin{verbatim}
104 ./configure (your options)
105 make
106 make install
107 \end{verbatim}
108
109 In general none of your existing .conf or .sql files will be overwritten.
110
111 For additional information on upgrading, please see the \ilink{Upgrading Bacula
112 Versions}{upgrading} in the Tips chapter of this manual.
113
114
115 \subsection*{Dependency Packages}
116 \label{Dependency}
117 \index[general]{Dependency Packages }
118 \index[general]{Packages!Dependency }
119 \addcontentsline{toc}{subsection}{Dependency Packages}
120
121 As discussed above, we have combined a number of third party packages that
122 Bacula might need into the {\bf depkgs} and {\bf depkgs1} releases. You can,
123 of course, get the latest packages from the original authors. The locations of
124 where we obtained the packages are in the README file in each package.
125 However, be aware that the packages in the depkgs files have been tested by us
126 for compatibility with Bacula. 
127
128 Typically, a dependency package will be named {\bf depkgs-ddMMMyy.tar.gz} and
129 {\bf depkgs1-ddMMyy.tar.gz} where {\bf dd} is the day we release it, {\bf MMM}
130 is the abbreviated month (e.g. Jan), and {\bf yy} is the year. An actual
131 example is: {\bf depkgs-07Apr02.tar.gz}. To install and build this package (if
132 needed), you do the following: 
133
134 \begin{enumerate}
135 \item Create a {\bf bacula} directory, into which you will place  both the
136    Bacula source as well as the dependency package.  
137 \item Detar the {\bf depkg} into the {\bf bacula} directory.  
138 \item cd bacula/depkgs  
139 \item make 
140 \end{enumerate}
141
142 Although the exact composition of the dependency packages may change from time
143 to time, the current makeup is the following: 
144
145 \addcontentsline{lot}{table}{Dependency Packages}
146 \begin{longtable}{|l|l|l|l|}
147  \hline 
148 \multicolumn{1}{|c| }{\bf 3rd Party Package } & \multicolumn{1}{c| }{\bf
149 depkgs } & \multicolumn{1}{c| }{\bf depkgs1 } & \multicolumn{1}{c| }{\bf
150 depkgs-win32  } \\
151  \hline {SQLite } & \multicolumn{1}{c| }{X } & \multicolumn{1}{c| }{- } &
152 \multicolumn{1}{c| }{-  } \\
153  \hline {mtx } & \multicolumn{1}{c| }{X } & \multicolumn{1}{c| }{- } &
154 \multicolumn{1}{c| }{-  } \\
155  \hline {readline } & \multicolumn{1}{c| }{- } & \multicolumn{1}{c| }{X } &
156 \multicolumn{1}{c| }{-  } \\
157  \hline {pthreads } & \multicolumn{1}{c| }{- } & \multicolumn{1}{c| }{- } &
158 \multicolumn{1}{c| }{X  } \\
159  \hline {zlib } & \multicolumn{1}{c| }{- } & \multicolumn{1}{c| }{- } &
160 \multicolumn{1}{c| }{X  } \\
161  \hline {wxWidgets } & \multicolumn{1}{c| }{- } & \multicolumn{1}{c| }{- } &
162 \multicolumn{1}{c| }{X }
163 \\ \hline 
164
165 \end{longtable}
166
167 Note, some of these packages are quite large, so that building them can be a
168 bit time consuming. The above instructions will build all the packages
169 contained in the directory. However, when building Bacula, it will take only
170 those pieces that it actually needs. 
171
172 Alternatively, you can make just the packages that are needed. For example, 
173
174 \footnotesize
175 \begin{verbatim}
176 cd bacula/depkgs
177 make sqlite
178 \end{verbatim}
179 \normalsize
180
181 will configure and build only the SQLite package. 
182
183 You should build the packages that you will require in {\bf depkgs} and/or
184 {\bf depkgs1} prior to configuring and building Bacula, since Bacula will need
185 them during the build process. 
186
187 Even if you do not use SQLite, you might find it worthwhile to build {\bf mtx}
188 because the {\bf tapeinfo} program that comes with it can often provide you
189 with valuable information about your SCSI tape drive (e.g. compression,
190 min/max block sizes, ...). 
191
192 The {\bf depkgs-win32} package contains the source code for the pthreads,
193 zlib, and wxWidgets libraries used by the native Win32 client program.  It
194 will only be needed if you intend to build the Win32 client from source.
195
196 \subsection*{Supported Operating Systems}
197 \label{Systems}
198 \index[general]{Systems!Supported Operating }
199 \index[general]{Supported Operating Systems }
200 \addcontentsline{toc}{subsection}{Supported Operating Systems}
201
202 Please see the 
203 \ilink{ Supported Operating Systems}{SupportedOSes} section
204 of the QuickStart chapter of this manual. 
205
206 \subsection*{Building Bacula from Source}
207 \label{Building}
208 \index[general]{Source!Building Bacula from }
209 \index[general]{Building Bacula from Source }
210 \addcontentsline{toc}{subsection}{Building Bacula from Source}
211
212 The basic installation is rather simple. 
213
214 \begin{enumerate}
215 \item Install and build any {\bf depkgs} as noted above.  
216 \item Configure and install MySQL or PostgreSQL (if desired). 
217    \ilink{Installing and Configuring MySQL Phase I}{_ChapterStart} or  
218    \ilink{Installing and Configuring PostgreSQL Phase
219    I}{_ChapterStart10}.  If you are installing from rpms, and are
220    using MySQL, please be sure to install  {\bf mysql-devel}, so that the MySQL
221    header files are available  while compiling Bacula. In addition, the MySQL
222    client  library {\bf mysqlclient} requires the gzip compression library  {\bf
223    libz.a} or {\bf libz.so}. If you are using rpm packages,  these libraries are
224    in the {\bf libz-devel} package. On Debian  systems, you will need to load the
225    {\bf zlib1g-dev} package. If  you are not using rpms or debs, you will need to
226    find the  appropriate package for your system.  
227
228    Note, if you already have a running MySQL or PostgreSQL on your system, you 
229    can skip this phase provided that you have built the thread  safe libraries.
230    And you have already installed the additional  rpms noted above.  
231
232 \item As an alternative to MySQL and PostgreSQL, configure and install SQLite,
233     which is part of the {\bf depkgs}.  
234    \ilink{Installing and Configuring SQLite}{_ChapterStart33}. SQLite is
235    probably not suited to a fair size production environment because it
236    tends to be slow compared to MySQL and it has few or poor tools for
237    repairing database damage.
238      
239
240 \item Detar the Bacula source code preferably into the {\bf bacula}  directory
241    discussed above.  
242
243 \item {\bf cd} to the directory containing the source code.  
244
245 \item ./configure (with appropriate options as described below)  
246
247 \item Check the output of ./configure very carefully, especially  the Install
248    binaries and Install config directories.  If they are not correct,
249    please rerun ./configure until they  are. The output from ./configure is
250    stored in {\bf config.out}  and can be re-displayed at any time without
251    rerunning the  ./configure by doing {\bf cat config.out}.  
252
253 \item If after running ./configure once, you decide to change options  and
254    re-run it, that is perfectly fine, but before re-running it,  you should run: 
255
256
257 \footnotesize
258 \begin{verbatim}
259       make distclean
260 \end{verbatim}
261 \normalsize
262
263 so that you are sure to start from scratch and not have a  mixture of the two
264 options. This is because ./configure  caches much of the information. The {\bf
265 make distclean}  is also critical if you move the source directory from one 
266 machine to another. If the {\bf make distclean} fails,  just ignore it and
267 continue on.  
268
269 \item make  
270 \begin{verbatim}
271
272 \end{verbatim}
273    If you get errors while linking in the Storage daemon directory
274    (src/stored), it is probably because you have not loaded the static
275    libraries on your system.  I noticed this problem on a Solaris system.
276    To correct it, make sure that you have not added {\bf
277    {-}{-}enable-static-tools} to the {\bf ./configure} command.
278
279    If you skip this step ({\bf make}) and proceed immediately to the {\bf
280    make install} you are making two serious errors: 1.  your install will
281    fail because Bacula requires a {\bf make} before a {\bf make install}.
282    2.  you are depriving yourself of the chance to make sure there are no
283    errors before beginning to write files to your system directories.
284                                  
285
286 \item make install  
287    Please be sure you have done a {\bf make} before entering this command,
288    and that everything has properly compiled and linked without errors.
289
290
291 \item If you are new to Bacula, we {\bf strongly} recommend that you skip
292    the next step and use the default configuration files, then run the
293    example program in the next chapter, then come back and modify your
294    configuration files to suit your particular needs.
295
296 \item Customize the configuration files for each of the three daemons 
297    (Directory, File, Storage) and for the Console program.  For the details
298    of how to do this, please see \ilink{Setting Up Bacula Configuration
299    Files}{_ChapterStart16} in the Configuration chapter of this manual.  We
300    recommend that you start by modifying the default configuration files
301    supplied, making the minimum changes necessary.  Complete customization
302    can be done after you have Bacula up and running.  Please take care when
303    modifying passwords, which were randomly generated, and the {\bf Name}s
304    as the passwords and names must agree between the configuration files
305    for security reasons.  
306
307 \item Create the Bacula MySQL database and tables
308    (if using MySQL)
309       \ilink{Installing and Configuring MySQL Phase II}{mysql_phase2} or 
310       create the Bacula PostgreSQL database and tables  
311    \ilink{Installing and Configuring PostgreSQL Phase
312    II}{PostgreSQL_phase2} or alternatively  if you are using
313    SQLite  
314    \ilink{Installing and Configuring SQLite Phase II}{phase2}.  
315
316 \item Start Bacula ({\bf ./bacula start}) Note. the next chapter  shows you
317    how to do this in detail.  
318
319 \item Interface with Bacula using the Console program  
320
321 \item For the previous two items, please follow the instructions  in the 
322    \ilink{Running Bacula}{_ChapterStart1} chapter of  this manual,
323    where you will run a simple backup and do a  restore. Do this before you make
324    heavy modifications to the  configuration files so that you are sure that
325    Bacula works  and are familiar with it. After that changing the conf files 
326    will be easier.  
327
328 \item If after installing Bacula, you decide to "move it", that is  to
329    install it in a different set of directories, proceed  as follows:  
330
331 \footnotesize
332 \begin{verbatim}
333       make uninstall
334       make distclean
335       ./configure (your-new-options)
336       make
337       make install
338       
339 \end{verbatim}
340 \normalsize
341
342 \end{enumerate}
343
344 If all goes well, the {\bf ./configure} will correctly determine which
345 operating system you are running and configure the source code appropriately.
346 Currently, FreeBSD, Linux (RedHat), and Solaris are supported. MacOS X 10.3 is
347 reported to work with the Client only as long as readline support is disabled.
348
349
350 If you install Bacula on more than one system, and they are identical, you can
351 simply transfer the source tree to that other system and do a "make
352 install". However, if there are differences in the libraries or OS versions,
353 or you wish to install on a different OS, you should start from the original
354 compress tar file. If you do transfer the source tree, and you have previously
355 done a ./configure command, you MUST do: 
356
357 \footnotesize
358 \begin{verbatim}
359 make distclean
360 \end{verbatim}
361 \normalsize
362
363 prior to doing your new ./configure. This is because the GNU autoconf tools
364 cache the configuration, and if you re-use a configuration for a Linux machine
365 on a Solaris, you can be sure your build will fail. To avoid this, as
366 mentioned above, either start from the tar file, or do a "make distclean". 
367
368 In general, you will probably want to supply a more complicated {\bf
369 configure} statement to ensure that the modules you want are built and that
370 everything is placed into the correct directories. 
371
372 For example, on RedHat, one could use the following: 
373
374 \footnotesize
375 \begin{verbatim}
376 CFLAGS="-g -Wall" \
377   ./configure \
378     --sbindir=$HOME/bacula/bin \
379     --sysconfdir=$HOME/bacula/bin \
380     --with-pid-dir=$HOME/bacula/bin/working \
381     --with-subsys-dir=$HOME/bacula/bin/working \
382     --with-mysql=$HOME/mysql \
383     --with-working-dir=$HOME/bacula/bin/working \
384     --with-dump-email=$USER
385 \end{verbatim}
386 \normalsize
387
388 Note, the advantage of using the above configuration to start is that
389 everything will be put into a single directory, which you can later delete
390 once you have run the examples in the next chapter and learned how Bacula
391 works. In addition, the above can be installed and run as non-root. 
392
393 For the developer's convenience, I have added a {\bf defaultconfig} script to
394 the {\bf examples} directory. This script contains the statements that you
395 would normally use, and each developer/user may modify them to suit his needs.
396 You should find additional useful examples in this directory as well. 
397
398 The {\bf \verb:--:enable-conio} or {\bf \verb:--:enable-readline} options are useful because
399 they provide a command line history and editing capability for the Console
400 program. If you have included either option in the build, either the {\bf
401 termcap} or the {\bf ncurses} package will be needed to link. On most
402 systems, including RedHat and SuSE, you should include the ncurses package.
403 If Bacula's configure process finds the ncurses libraries, it will use
404 those rather than the termcap library.
405 On some systems, such as SuSE, the termcap library is not in the standard
406 library directory.  As a consequence, the option may be disabled or you may
407 get an error message such as:
408
409 \footnotesize
410 \begin{verbatim}
411 /usr/lib/gcc-lib/i586-suse-linux/3.3.1/.../ld:
412 cannot find -ltermcap
413 collect2: ld returned 1 exit status
414 \end{verbatim}
415 \normalsize
416
417 while building the Bacula Console. In that case, you will need to set the {\bf
418 LDFLAGS} environment variable prior to building. 
419
420 \footnotesize
421 \begin{verbatim}
422 export LDFLAGS="-L/usr/lib/termcap"
423 \end{verbatim}
424 \normalsize
425
426 The same library requirements apply if you wish to use the readline
427 subroutines for command line editing and history or
428  if you are using a MySQL library that requires encryption. If you need encryption,
429 you can either export the appropriate additional library options as shown
430 above or, alternatively, you can include them directly on the ./configure line
431 as in: 
432
433 \footnotesize
434 \begin{verbatim}
435 LDFLAGS="-lssl -lcyrpto" \
436    ./configure \
437       <your-options>
438 \end{verbatim}
439 \normalsize
440
441 On some systems such as Mandriva, readline tends to
442 gobble up prompts, which makes it totally useless. If this happens to you, use
443 the disable option, or if you are using version 1.33 and above try using {\bf
444 \verb:--:enable-conio} to use a built-in readline replacement. You will still need
445 either the termcap or the ncurses library, but it is unlikely that the {\bf conio}
446 package will gobble up prompts. 
447
448 readline is no longer supported after version 1.34.  The code within Bacula
449 remains, so it should be usable, and if users submit patches for it, I will
450 be happy to apply them.  However, due to the fact that each version of
451 readline seems to be incompatible with previous versions, and that there
452 are significant differences between systems, I can no longer afford to
453 support it.
454
455 \subsection*{What Database to Use?}
456 \label{DB}
457 \index[general]{What Database to Use? }
458 \index[general]{Use!What Database to }
459 \addcontentsline{toc}{subsection}{What Database to Use?}
460
461 Before building Bacula you need to decide if you want to use SQLite, MySQL, or
462 PostgreSQL. If you are not already running MySQL or PostgreSQL, you might
463 want to start by testing with SQLite. This will greatly simplify the setup for you
464 because SQLite is compiled into Bacula an requires no administration. It
465 performs well and is suitable for small to medium sized installations (maximum
466 10-20 machines). However, we should note that a number of users have
467 had unexplained database corruption with SQLite. For that reason, we
468 recommend that you install either MySQL or PostgreSQL for production
469 work.
470
471 If you wish to use MySQL as the Bacula catalog, please see the 
472 \ilink{Installing and Configuring MySQL}{_ChapterStart} chapter of
473 this manual. You will need to install MySQL prior to continuing with the
474 configuration of Bacula. MySQL is a high quality database that is very
475 efficient and is suitable for any sized installation. It is slightly more
476 complicated than SQLite to setup and administer because it has a number of
477 sophisticated features such as userids and passwords. It runs as a separate
478 process, is truly professional and can manage a database of any size. 
479
480 If you wish to use PostgreSQL as the Bacula catalog, please see the 
481 \ilink{Installing and Configuring PostgreSQL}{_ChapterStart10}
482 chapter of this manual. You will need to install PostgreSQL prior to
483 continuing with the configuration of Bacula. PostgreSQL is very similar to
484 MySQL, though it tends to be slightly more SQL92 compliant and has many more
485 advanced features such as transactions, stored procedures, and the such. It
486 requires a certain knowledge to install and maintain. 
487
488 If you wish to use SQLite as the Bacula catalog, please see 
489 \ilink{Installing and Configuring SQLite}{_ChapterStart33} chapter of
490 this manual. 
491
492 \subsection*{Quick Start}
493 \index[general]{Quick Start }
494 \index[general]{Start!Quick }
495 \addcontentsline{toc}{subsection}{Quick Start}
496
497 There are a number of options and important considerations given below
498 that you can skip for the moment if you have not had any problems building
499 Bacula with a simplified configuration as shown above. 
500       
501 If the ./configure process is unable to find specific libraries (e.g.    
502 libintl, you should ensure that the appropriate package is installed on
503 your system. Alternatively, if the package is installed in a non-standard
504 location (as far as Bacula is concerned), then there is generally an
505 option listed below (or listed with "./configure {-}{-}help" that will
506 permit you to specify the directory that should be searched. In other
507 cases, there are options that will permit you to disable to feature 
508 (e.g. {-}{-}disable-nls).
509
510 If you want to dive right into it, we recommend you skip to the next chapter,
511 and run the example program. It will teach you a lot about Bacula and as an
512 example can be installed into a single directory (for easy removal) and run as
513 non-root. If you have any problems or when you want to do a real installation,
514 come back to this chapter and read the details presented below. 
515
516 \subsection*{Configure Options}
517 \label{Options}
518 \index[general]{Options!Configure }
519 \index[general]{Configure Options }
520 \addcontentsline{toc}{subsection}{Configure Options}
521
522 The following command line options are available for {\bf configure} to
523 customize your installation. 
524
525 \begin{description}
526 \item [ {-}{-}sysbindir=\lt{}binary-path\gt{}]
527    \index[general]{{-}{-}sysbindir }
528    Defines where the Bacula  binary (executable) files will be placed during a
529    {\bf make  install} command.  
530
531 \item [ {-}{-}sysconfdir=\lt{}config-path\gt{}]
532    \index[general]{{-}{-}sysconfdir }
533    Defines where the Bacula configuration files should be placed during a
534    {\bf make install} command.
535
536 \item [ {-}{-}mandir=\lt{}path\gt{}]
537    \index[general]{{-}{-}mandir}
538    Note, as of Bacula version 1.39.14, the meaning of any path
539    specified is now changed to mean the top level man directory.
540    Previously the mandir specified the full path to where you
541    wanted the man files installed.
542    The man files will be installed in gzip'ed format under
543    mandir/man1 and mandir/man8 as appropriate.
544    For the install to succeed you must have {\bf gzip} installed
545    on your system.
546
547    By default, Bacula will install the Unix man pages in 
548    /usr/share/man/man1 and /usr/share/man/man8.  
549    If you wish the man page to be installed in
550    a different location, use this option to specify the path.
551    Note, the main HTML and PDF Bacula documents are in a separate
552    tar file that is not part of the source distribution.
553
554 \item [ {-}{-}datadir=\lt{}path\gt{}]
555    \index[general]{{-}{-}datadir}
556    If you translate Bacula or parts of Bacula into a different language
557    you may specify the location of the po files using the {\bf
558    {-}{-}datadir} option. You must manually install any po files as
559    Bacula does not (yet) automatically do so.
560
561
562 \item [ {-}{-}enable-smartalloc ]
563    \index[general]{{-}{-}enable-smartalloc }
564    This enables the inclusion of the Smartalloc orphaned buffer detection
565    code.  This option is highly recommended.  Because we never build
566    without this option, you may experience problems if it is not enabled.
567    In this case, simply re-enable the option.  We strongly recommend
568    keeping this option enabled as it helps detect memory leaks.  This
569    configuration parameter is used while building Bacula
570
571 \item [ {-}{-}enable-gnome ]
572    \index[general]{{-}{-}enable-gnome }
573    If you have GNOME installed on your computer including the
574    gnome development libraries, and you want to use the
575    GNOME GUI Console interface to Bacula, you must specify this option.
576    Doing so will build everything in the {\bf src/gnome-console} directory.
577
578 \item [ {-}{-}enable-wx-console ]
579    \index[general]{{-}{-}enable-wx-console }
580    If you have wxWidgets installed on your computer and you want to use the
581    wxWidgets GUI Console interface to Bacula, you must specify this option.
582    Doing so will build everything in the {\bf src/wx-console} directory.
583    This could also be useful to users who want a GUI Console and don't want
584    to install Gnome, as wxWidgets can work with GTK+, Motif or even X11
585    libraries.
586
587
588 \item [ {-}{-}enable-tray-monitor ]
589    \index[general]{{-}{-}enable-tray-monitor }
590    If you have GTK installed on your computer, you run a graphical
591    environment or a window manager compatible with the FreeDesktop system
592    tray standard (like KDE and GNOME) and you want to use a GUI to monitor
593    Bacula daemons, you must specify this option.  Doing so will build
594    everything in the {\bf src/tray-monitor} directory.
595
596 \item [ {-}{-}enable-static-tools]
597    \index[general]{{-}{-}enable-static-tools }
598    This option causes the linker to link the Storage daemon utility tools
599    ({\bf bls}, {\bf bextract}, and {\bf bscan}) statically.  This permits
600    using them without having the shared libraries loaded.  If you have
601    problems linking in the {\bf src/stored} directory, make sure you have
602    not enabled this option, or explicitly disable static linking by adding
603    {\bf \verb:--:disable-static-tools}.
604
605
606 \item [ {-}{-}enable-static-fd]
607    \index[general]{{-}{-}enable-static-fd }
608    This option causes the make process to build a {\bf static-bacula-fd} in
609    addition to the standard File daemon.  This static version will include
610    statically linked libraries and is required for the Bare Metal recovery.
611    This option is largely superseded by using {\bf make static-bacula-fd}
612    from with in the {\bf src/filed} directory.  Also, the {\bf
613    \verb:--:enable-client-only} option described below is useful for just
614    building a client so that all the other parts of the program are not
615    compiled.   
616      
617    When linking a static binary, the linker needs the static versions
618    of all the libraries that are used, so frequently users will 
619    experience linking errors when this option is used. The first 
620    thing to do is to make sure you have the static glibc library 
621    installed on your system. The second thing to do is the make sure
622    you do not specify {\bf {-}{-}openssl} or {\bf {-}{-}with-python}
623    on your ./configure statement as these options require additional
624    libraries. You may be able to enable those options, but you will
625    need to load additional static libraries.
626
627
628 \item [ {-}{-}enable-static-sd]
629    \index[general]{{-}{-}enable-static-sd }
630    This option causes the make process to build a {\bf static-bacula-sd} in
631    addition to the standard Storage daemon.  This static version will
632    include statically linked libraries and could be useful during a Bare
633    Metal recovery.
634
635    When linking a static binary, the linker needs the static versions
636    of all the libraries that are used, so frequently users will 
637    experience linking errors when this option is used. The first 
638    thing to do is to make sure you have the static glibc library 
639    installed on your system. The second thing to do is the make sure
640    you do not specify {\bf {-}{-}openssl} or {\bf {-}{-}with-python}
641    on your ./configure statement as these options require additional
642    libraries. You may be able to enable those options, but you will
643    need to load additional static libraries.
644
645  
646
647 \item [ {-}{-}enable-static-dir]
648    \index[general]{{-}{-}enable-static-dir }
649    This option causes the make process to build a {\bf static-bacula-dir}
650    in addition to the standard Director.  This static version will include
651    statically linked libraries and could be useful during a Bare Metal
652    recovery.
653
654    When linking a static binary, the linker needs the static versions
655    of all the libraries that are used, so frequently users will 
656    experience linking errors when this option is used. The first 
657    thing to do is to make sure you have the static glibc library 
658    installed on your system. The second thing to do is the make sure
659    you do not specify {\bf {-}{-}openssl} or {\bf {-}{-}with-python}
660    on your ./configure statement as these options require additional
661    libraries. You may be able to enable those options, but you will
662    need to load additional static libraries.
663
664
665 \item [ {-}{-}enable-static-cons]
666    \index[general]{{-}{-}enable-static-cons }
667    This option causes the make process to build a {\bf static-console} and
668    a {\bf static-gnome-console} in addition to the standard console.  This
669    static version will include statically linked libraries and could be
670    useful during a Bare Metal recovery.
671
672    When linking a static binary, the linker needs the static versions
673    of all the libraries that are used, so frequently users will 
674    experience linking errors when this option is used. The first 
675    thing to do is to make sure you have the static glibc library 
676    installed on your system. The second thing to do is the make sure
677    you do not specify {\bf {-}{-}openssl} or {\bf {-}{-}with-python}
678    on your ./configure statement as these options require additional
679    libraries. You may be able to enable those options, but you will
680    need to load additional static libraries.
681
682
683 \item [ {-}{-}enable-client-only]
684    \index[general]{{-}{-}enable-client-only }
685    This option causes the make process to build only the File daemon and
686    the libraries that it needs.  None of the other daemons, storage tools,
687    nor the console will be built.  Likewise a {\bf make install} will then
688    only install the File daemon.  To cause all daemons to be built, you
689    will need to do a configuration without this option.  This option
690    greatly facilitates building a Client on a client only machine.
691
692    When linking a static binary, the linker needs the static versions
693    of all the libraries that are used, so frequently users will 
694    experience linking errors when this option is used. The first 
695    thing to do is to make sure you have the static glibc library 
696    installed on your system. The second thing to do is the make sure
697    you do not specify {\bf {-}{-}openssl} or {\bf {-}{-}with-python}
698    on your ./configure statement as these options require additional
699    libraries. You may be able to enable those options, but you will
700    need to load additional static libraries.
701
702 \item [ {-}{-}enable-build-dird]
703    \index[general]{{-}{-}enable-build-dird }
704    This option causes the make process to build the Director and the
705    Director's tools. By default, this option is on, but you may turn
706    it off by using {\bf {-}{-}disable-build-dird} to prevent the
707    Director from being built.
708
709 \item [ {-}{-}enable-build-stored]
710    \index[general]{{-}{-}enable-build-stored }
711    This option causes the make process to build the Storage daemon.
712    By default, this option is on, but you may turn
713    it off by using {\bf {-}{-}disable-build-stored} to prevent the
714    Storage daemon from being built.
715
716
717 \item [ {-}{-}enable-largefile]
718    \index[general]{{-}{-}enable-largefile }
719    This option (default) causes  Bacula to be built with 64 bit file address
720    support if it  is available on your system. This permits Bacula to read and 
721    write files greater than 2 GBytes in size. You may disable this  feature and
722    revert to 32 bit file addresses by using  {\bf \verb:--:disable-largefile}.  
723
724 \item [ {-}{-}disable-nls]
725    \index[general]{{-}{-}disable-nls}
726    By default, Bacula uses the GNU Native Language Support (NLS) libraries. On
727    some machines, these libraries may not be present or may not function 
728    correctly (especially on non-Linux implementations). In such cases, you
729    may specify {\bf {-}{-}disable-nls} to disable use of those libraries.
730    In such a case, Bacula will revert to using English.
731
732 \item [ {-}{-}with-sqlite=\lt{}sqlite-path\gt{}]
733    \index[general]{{-}{-}with-sqlite }
734    This enables use of the SQLite version 2.8.x database. The {\bf sqlite-path} is not
735    normally  specified as Bacula looks for the necessary components in  a
736    standard location ({\bf depkgs/sqlite}). See 
737    \ilink{Installing and Configuring SQLite}{_ChapterStart33} chapter of
738     this manual for more details.  
739
740    See the note below under the {-}{-}with-postgresql item.
741
742 \item [ {-}{-}with-sqlite3=\lt{}sqlite3-path\gt{}]
743    \index[general]{{-}{-}with-sqlite3 }
744    This enables use of the SQLite version 3.x database.  The {\bf
745    sqlite3-path} is not normally specified as Bacula looks for the
746    necessary components in a standard location ({\bf depkgs/sqlite3}).  See
747    \ilink{Installing and Configuring SQLite}{_ChapterStart33} chapter of
748    this manual for more details.
749
750 \item [ {-}{-}with-mysql=\lt{}mysql-path\gt{}]
751    \index[general]{{-}{-}with-mysql }
752    This enables building of the Catalog services for Bacula.  It assumes
753    that MySQL is running on your system, and expects it to be installed in
754    the {\bf mysql-path} that you specify.  Normally, if MySQL is installed
755    in a standard system location, you can simply use {\bf {-}{-}with-mysql}
756    with no path specification.  If you do use this option, please proceed
757    to installing MySQL in the \ilink{Installing and Configuring
758    MySQL}{_ChapterStart} chapter before proceeding with the configuration.
759
760    See the note below under the {-}{-}with-postgresql item.
761
762 \item [ {-}{-}with-postgresql=\lt{}path\gt{}]
763    \index[general]{{-}{-}with-postgresql }
764    This provides an explicit path to the PostgreSQL libraries if Bacula
765    cannot find it by default.  Normally to build with PostgreSQL, you would
766    simply use {\bf {-}{-}with-postgresql}.
767
768    Note, for Bacula to be configured properly, you must specify one
769    of the four database options supported.  That is:
770    {-}{-}with-sqlite, {-}{-}with-sqlite3, {-}{-}with-mysql, or
771    {-}{-}with-postgresql, otherwise the ./configure will fail.
772
773 \item [ {-}{-}with-openssl=\lt{}path\gt{}]
774    This configuration option is necessary if you want to enable TLS (ssl),
775    which encrypts the communications within       
776    Bacula or if you want to use File Daemon PKI data encryption.
777    Normally, the {\bf path} specification is not necessary since
778    the configuration searches for the OpenSSL libraries in standard system
779    locations. Enabling OpenSSL in Bacula permits secure communications
780    between the daemons and/or data encryption in the File daemon.
781    For more information on using TLS, please see the
782    \ilink{Bacula TLS -- Communications Encryption}{CommEncryption} chapter
783    of this manual.
784    For more information on using PKI data encryption, please see the
785    \ilink{Bacula PKI -- Data Encryption}{DataEncryption}
786    chapter of this manual.
787
788
789
790 \item [ {-}{-}with-python=\lt{}path\gt{}]
791    \index[general]{{-}{-}with-python }
792    This option enables Bacula support for Python. If no path is 
793    supplied, configure will search the     
794    standard library locations for Python 2.2, 2.3, or 2.4. If it cannot
795    find the library, you will need to supply a path to your Python
796    library directory.  Please see the 
797    \ilink{Python chapter}{_ChapterStart60} for the details of using
798    Python scripting.
799
800 \item [ {-}{-}with-libintl-prefix=\lt{}DIR\gt{}]
801    \index[general]{{-}{-}with-libintl-prefix}
802    This option may be used to tell Bacula to search DIR/include and
803    DIR/lib for the libintl headers and libraries needed for Native
804    Language Support (NLS).
805
806 \item [ {-}{-}enable-conio]
807    \index[general]{{-}{-}enable-conio }
808    Tells Bacula to enable building the small, light weight readline
809    replacement routine.  It is generally much easier to configure than
810    readline, although, like readline, it needs either the termcap or
811    ncurses library.
812
813 \item [ {-}{-}with-readline=\lt{}readline-path\gt{}]
814    \index[general]{{-}{-}with-readline }
815    Tells Bacula where {\bf readline} is installed.  Normally, Bacula will
816    find readline if it is in a standard library.  If it is not found and no
817    {-}{-}with-readline is specified, readline will be disabled.  This
818    option affects the Bacula build.  Readline provides the Console program
819    with a command line history and editing capability and is no longer
820    supported, so you are on your own if you have problems.
821
822 \item [ {-}{-}enable-readline]
823    \index[general]{{-}{-}enable-readline }
824    Tells Bacula to enable readline support.  It is normally disabled due to the
825    large number of configuration  problems and the fact that the package seems to
826    change in incompatible  ways from version to version.  
827
828 \item [ {-}{-}with-tcp-wrappers=\lt{}path\gt{}]
829    \index[general]{{-}{-}with-tcp-wrappers }
830    \index[general]{TCP Wrappers}
831    \index[general]{Wrappers!TCP}
832    \index[general]{libwrappers}
833    This specifies that you  want TCP wrappers (man hosts\_access(5)) compiled in.
834    The path is optional since  Bacula will normally find the libraries in the
835    standard locations.  This option affects the Bacula build.  In specifying your
836    restrictions in the {\bf /etc/hosts.allow}  or {\bf /etc/hosts.deny} files, do
837    not use the {\bf twist}  option (hosts\_options(5)) or the Bacula process will
838    be terminated. Note, when setting up your {\bf /etc/hosts.allow}
839    or {\bf /etc/hosts.deny}, you must identify the Bacula daemon in
840    question with the name you give it in your conf file rather than the
841    name of the executable.
842    
843    For more information on configuring and testing TCP wrappers, please  see the 
844    \ilink{Configuring and Testing TCP Wrappers}{wrappers}  section
845    in the Security Chapter.  
846
847    On SuSE, the libwrappers libraries needed to link Bacula are
848    contained in the tcpd-devel package. On RedHat the package is named
849    tcp\_wrappers.
850
851 \item [ {-}{-}with-working-dir=\lt{}working-directory-path\gt{} ]
852    \index[general]{{-}{-}with-working-dir }
853    This option is mandatory and specifies a directory  into which Bacula may
854    safely place files that  will remain between Bacula executions. For example, 
855    if the internal database is used, Bacula will keep  those files in this
856    directory.  This option is only used to modify the daemon  configuration
857    files. You may also accomplish the same  thing by directly editing them later.
858    The working directory  is not automatically created by the install process, so
859    you  must ensure that it exists before using Bacula for the  first time. 
860
861 \item [ {-}{-}with-base-port=\lt{}port=number\gt{}]
862    \index[general]{{-}{-}with-base-port }
863    In order to run,  Bacula needs three TCP/IP ports (one for the Bacula 
864    Console, one for the Storage daemon, and one for the File daemon).  The {\bf
865    \verb:--:with-baseport} option will automatically assign three  ports beginning at
866    the base port address specified. You may  also change the port number in the
867    resulting configuration  files. However, you need to take care that the
868    numbers  correspond correctly in each of the three daemon configuration 
869    files. The default base port is 9101, which assigns ports 9101  through 9103.
870    These ports (9101, 9102, and 9103) have been  officially assigned to Bacula by
871    IANA.  This option is only used  to modify the daemon configuration files. You
872    may also accomplish  the same thing by directly editing them later. 
873
874 \item [ {-}{-}with-dump-email=\lt{}email-address\gt{}]
875    \index[general]{{-}{-}with-dump-email }
876    This option specifies  the email address where any core dumps should be set.
877    This option  is normally only used by developers.  
878
879 \item [ {-}{-}with-pid-dir=\lt{}PATH\gt{}  ]
880    \index[general]{{-}{-}with-pid-dir }
881    This specifies where Bacula should place the process id  file during
882    execution. The default is: {\bf /var/run}.  This directory is not created by
883    the install process, so  you must ensure that it exists before using Bacula
884    the  first time.  
885
886 \item [ {-}{-}with-subsys-dir=\lt{}PATH\gt{}]
887    \index[general]{{-}{-}with-subsys-dir }
888    This specifies where Bacula should place the subsystem lock  file during
889    execution. The default is {\bf /var/run/subsys}.  Please make sure that you do
890    not specify the same directory  for this directory and for the {\bf sbindir}
891    directory.  This directory is used only within the autostart scripts.  The
892    subsys directory is not created by the Bacula install,  so you must be sure to
893    create it before using Bacula. 
894
895 \item [ {-}{-}with-dir-password=\lt{}Password\gt{}]
896    \index[general]{{-}{-}with-dir-password }
897    This option allows you to specify the password used to  access the Directory
898    (normally from the Console program).  If it is not specified, configure will
899    automatically create a random  password.  
900
901 \item [ {-}{-}with-fd-password=\lt{}Password\gt{} ]
902    \index[general]{{-}{-}with-fd-password }
903    This option allows you to specify the password used to  access the File daemon
904    (normally called from the Director).  If it is not specified, configure will
905    automatically create a random  password.  
906
907 \item [ {-}{-}with-sd-password=\lt{}Password\gt{} ]
908    \index[general]{{-}{-}with-sd-password }
909    This option allows you to specify the password used to  access the Directory
910    (normally called from the Director).  If it is not specified, configure will
911    automatically create a random  password.  
912
913 \item [ {-}{-}with-dir-user=\lt{}User\gt{} ]
914    \index[general]{{-}{-}with-dir-user }
915    This option allows you to specify the Userid used to run the Director.  The
916    Director must be started as root, but doesn't need to run as root, and
917    after doing preliminary initializations, it can "drop" to the UserId
918    specified on this option.  
919    If you specify this option, you must
920    create the User prior to running {\bf make install}, because the
921    working directory owner will be set to {\bf User}.
922                        
923
924 \item [ {-}{-}with-dir-group=\lt{}Group\gt{} ]
925    \index[general]{{-}{-}with-dir-group }
926    This option allows you to specify the GroupId used to  run the Director. The
927    Director must be started as root, but  doesn't need to run as root, and  after
928    doing preliminary initializations, it can "drop"  to the GroupId specified
929    on this option. 
930    If you specify this option, you must
931    create the Group prior to running {\bf make install}, because the
932    working directory group will be set to {\bf Group}.
933
934 \item [ {-}{-}with-sd-user=\lt{}User\gt{} ]
935    \index[general]{{-}{-}with-sd-user }
936    This option allows you to specify the Userid used to  run the Storage daemon.
937    The Storage daemon must be started as root, but  doesn't need to run as root,
938    and  after doing preliminary initializations, it can "drop"  to the UserId
939    specified on this option. If you use this option,  you will need to take care
940    that the Storage daemon has access  to all the devices (tape drives, ...) that
941    it needs. 
942
943 \item [ {-}{-}with-sd-group=\lt{}Group\gt{} ]
944    \index[general]{{-}{-}with-sd-group }
945    This option allows you to specify the GroupId used to  run the Storage daemon.
946    The Storage daemon must be started as root, but  doesn't need to run as root,
947    and  after doing preliminary initializations, it can "drop"  to the GroupId
948    specified on this option. 
949
950 \item [ {-}{-}with-fd-user=\lt{}User\gt{} ]
951    \index[general]{{-}{-}with-fd-user }
952    This option allows you to specify the Userid used to  run the File daemon. The
953    File daemon must be started as root,  and in most cases, it needs to run as
954    root, so this option is  used only in very special cases,  after doing
955    preliminary initializations, it can "drop"  to the UserId specified on this
956    option. 
957
958 \item [ {-}{-}with-fd-group=\lt{}Group\gt{} ]
959    \index[general]{{-}{-}with-fd-group }
960    This option allows you to specify the GroupId used to  run the File daemon.
961    The File daemon must be started as root, and  in most cases, it must be run as
962    root, however,  after doing preliminary initializations, it can "drop"  to
963    the GroupId specified on this option. 
964
965 \end{description}
966
967 Note, many other options are presented when you do a {\bf ./configure
968 \verb:--:help}, but they are not implemented.
969
970 \subsection*{Recommended Options for most Systems}
971 \index[general]{Systems!Recommended Options for most }
972 \index[general]{Recommended Options for most Systems }
973 \addcontentsline{toc}{subsection}{Recommended Options for most Systems}
974
975 For most systems, we recommend starting with the following options: 
976
977 \footnotesize
978 \begin{verbatim}
979 ./configure \
980   --enable-smartalloc \
981   --sbindir=$HOME/bacula/bin \
982   --sysconfdir=$HOME/bacula/bin \
983   --with-pid-dir=$HOME/bacula/bin/working \
984   --with-subsys-dir=$HOME/bacula/bin/working \
985   --with-mysql=$HOME/mysql \
986   --with-working-dir=$HOME/bacula/working
987 \end{verbatim}
988 \normalsize
989
990 If you want to install Bacula in an installation directory rather than run it
991 out of the build directory (as developers will do most of the time), you
992 should also include the \verb:--:sbindir and \verb:--:sysconfdir options with appropriate
993 paths. Neither are necessary if you do not use "make install" as is the case
994 for most development work. The install process will create the sbindir and
995 sysconfdir if they do not exist, but it will not automatically create the
996 pid-dir, subsys-dir, or working-dir, so you must ensure that they exist before
997 running Bacula for the first time. See below for an example of how Kern does
998 it. 
999
1000 \subsection*{RedHat}
1001 \index[general]{RedHat }
1002 \addcontentsline{toc}{subsection}{RedHat}
1003
1004 Using SQLite: 
1005
1006 \footnotesize
1007 \begin{verbatim}
1008  
1009 CFLAGS="-g -Wall" ./configure \
1010   --sbindir=$HOME/bacula/bin \
1011   --sysconfdir=$HOME/bacula/bin \
1012   --enable-smartalloc \
1013   --with-sqlite=$HOME/bacula/depkgs/sqlite \
1014   --with-working-dir=$HOME/bacula/working \
1015   --with-pid-dir=$HOME/bacula/bin/working \
1016   --with-subsys-dir=$HOME/bacula/bin/working \
1017   --enable-gnome \
1018   --enable-conio
1019 \end{verbatim}
1020 \normalsize
1021
1022 or 
1023
1024 \footnotesize
1025 \begin{verbatim}
1026  
1027 CFLAGS="-g -Wall" ./configure \
1028   --sbindir=$HOME/bacula/bin \
1029   --sysconfdir=$HOME/bacula/bin \
1030   --enable-smartalloc \
1031   --with-mysql=$HOME/mysql \
1032   --with-working-dir=$HOME/bacula/working
1033   --with-pid-dir=$HOME/bacula/bin/working \
1034   --with-subsys-dir=$HOME/bacula/bin/working
1035   --enable-gnome \
1036   --enable-conio
1037 \end{verbatim}
1038 \normalsize
1039
1040 or finally, a completely traditional RedHat Linux install: 
1041
1042 \footnotesize
1043 \begin{verbatim}
1044 CFLAGS="-g -Wall" ./configure \
1045   --prefix=/usr \
1046   --sbindir=/usr/sbin \
1047   --sysconfdir=/etc/bacula \
1048   --with-scriptdir=/etc/bacula \
1049   --enable-smartalloc \
1050   --enable-gnome \
1051   --with-mysql \
1052   --with-working-dir=/var/bacula \
1053   --with-pid-dir=/var/run \
1054   --with-subsys-dir=/var/lock/subsys \
1055   --enable-conio
1056 \end{verbatim}
1057 \normalsize
1058
1059 Note, Bacula assumes that /var/bacula, /var/run, and /var/loc/subsys exist so
1060 it will not automatically create them during the install process. 
1061
1062 Note, with gcc (GCC) 4.0.1 20050727 (Red Hat 4.0.1-5) on
1063 an AMD64 CPU running 64 bit CentOS4, there is a compiler bug that generates
1064 bad code that causes Bacula to segment fault.  Typically you will see this
1065 in the Storage daemon first.  The solution is to compile Bacula ensuring
1066 that no optimization is turned on (normally it is -O2).
1067
1068 \subsection*{Solaris}
1069 \index[general]{Solaris }
1070 \addcontentsline{toc}{subsection}{Solaris}
1071
1072 To build Bacula from source, you will need the following installed on your
1073 system (they are not by default): libiconv, gcc 3.3.2, stdc++, libgcc (for
1074 stdc++ and gcc\_s libraries), make 3.8 or later. 
1075
1076 You will probably also need to: Add /usr/local/bin to PATH and Add
1077 /usr/ccs/bin to PATH for ar. 
1078
1079 \footnotesize
1080 \begin{verbatim}
1081 #!/bin/sh
1082 CFLAGS="-g" ./configure \
1083   --sbindir=$HOME/bacula/bin \
1084   --sysconfdir=$HOME/bacula/bin \
1085   --with-mysql=$HOME/mysql \
1086   --enable-smartalloc \
1087   --with-pid-dir=$HOME/bacula/bin/working \
1088   --with-subsys-dir=$HOME/bacula/bin/working \
1089   --with-working-dir=$HOME/bacula/working
1090 \end{verbatim}
1091 \normalsize
1092
1093 As mentioned above, the install process will create the sbindir and sysconfdir
1094 if they do not exist, but it will not automatically create the pid-dir,
1095 subsys-dir, or working-dir, so you must ensure that they exist before running
1096 Bacula for the first time.
1097
1098 Note, you may need to install the following packages to build Bacula
1099 from source:
1100 \footnotesize
1101 \begin{verbatim}
1102 SUNWbinutils,
1103 SUNWarc,
1104 SUNWhea,
1105 SUNWGcc,
1106 SUNWGnutls
1107 SUNWGnutls-devel
1108 SUNWGmake
1109 SUNWgccruntime
1110 SUNWlibgcrypt
1111 SUNWzlib
1112 SUNWzlibs
1113 SUNWbinutilsS
1114 SUNWGmakeS
1115 SUNWlibm
1116
1117 export 
1118 PATH=/usr/bin::/usr/ccs/bin:/etc:/usr/openwin/bin:/usr/local/bin:/usr/sfw/bin:/opt/sfw/bin:/usr/ucb:/usr/sbin
1119 \end{verbatim}
1120 \normalsize
1121
1122 \subsection*{FreeBSD}
1123 \index[general]{FreeBSD }
1124 \addcontentsline{toc}{subsection}{FreeBSD}
1125
1126 Please see: 
1127 \elink{The FreeBSD Diary}{http://www.freebsddiary.org/bacula.php} for a
1128 detailed description on how to make Bacula work on your system. In addition,
1129 users of FreeBSD prior to 4.9-STABLE dated Mon Dec 29 15:18:01 2003 UTC who
1130 plan to use tape devices, please see the 
1131 \ilink{Tape Testing Chapter}{FreeBSDTapes} of this manual for
1132 {\bf important} information on how to configure your tape drive for
1133 compatibility with Bacula. 
1134
1135 If you are using Bacula with MySQL, you should take care to compile MySQL with
1136 FreeBSD native threads rather than LinuxThreads, since Bacula is normally built
1137 with FreeBSD native threads rather than LinuxTreads. Mixing the two will
1138 probably not work. 
1139
1140 \subsection*{Win32}
1141 \index[general]{Win32 }
1142 \addcontentsline{toc}{subsection}{Win32}
1143
1144 To install the binary Win32 version of the File daemon please see the 
1145 \ilink{Win32 Installation Chapter}{_ChapterStart7} in this document. 
1146
1147 \subsection*{Windows Systems with CYGWIN Installed}
1148 \label{Win32}
1149 \index[general]{Windows Systems with CYGWIN Installed }
1150 \index[general]{Installed!Windows Systems with CYGWIN }
1151 \addcontentsline{toc}{subsection}{Windows Systems with CYGWIN Installed}
1152
1153 As of version 1.34, Bacula no longer uses CYGWIN for the Win32 File daemon.
1154 However, it is still built under a CYGWIN build environment -- though you
1155 can probably do it with VC Studio only.  If you wish to build the Win32
1156 File daemon from the source, you will need Microsoft C++ version 7.1.
1157 Details for building the Win32 FD are in the README.win32 file of the
1158 src/win32 directory.
1159
1160 Note, although most parts of Bacula build on Windows systems, the only part
1161 that we have tested and used is the File daemon. 
1162
1163 Finally, you should follow the installation instructions in the 
1164 \ilink{Win32 Installation}{_ChapterStart7} section of this document. 
1165
1166 \subsection*{Kern's Configure Script}
1167 \index[general]{Script!Kern's Configure }
1168 \index[general]{Kern's Configure Script }
1169 \addcontentsline{toc}{subsection}{Kern's Configure Script}
1170
1171 The script that I use for building on my "production" Linux machines is: 
1172
1173 \footnotesize
1174 \begin{verbatim}
1175 #!/bin/sh
1176 # This is Kern's configure script for Bacula
1177 CFLAGS="-g -Wall" \
1178   ./configure \
1179     --sbindir=$HOME/bacula/bin \
1180     --sysconfdir=$HOME/bacula/bin \
1181     --enable-smartalloc \
1182     --enable-gnome \
1183     --with-pid-dir=$HOME/bacula/bin/working \
1184     --with-subsys-dir=$HOME/bacula/bin/working \
1185     --with-mysql=$HOME/mysql \
1186     --with-working-dir=$HOME/bacula/bin/working \
1187     --with-dump-email=$USER \
1188     --with-smtp-host=mail.your-site.com \
1189     --with-baseport=9101
1190 exit 0
1191 \end{verbatim}
1192 \normalsize
1193
1194 Note that I define the base port as 9101, which means that Bacula will use
1195 port 9101 for the Director console, port 9102 for the File daemons, and port
1196 9103 for the Storage daemons. These ports should be available on all systems
1197 because they have been officially assigned to Bacula by IANA (Internet
1198 Assigned Numbers Authority). We strongly recommend that you use only these
1199 ports to prevent any conflicts with other programs. This is in fact the
1200 default if you do not specify a {\bf \verb:--:with-baseport} option. 
1201
1202 You may also want to put the following entries in your {\bf /etc/services}
1203 file as it will make viewing the connections made by Bacula easier to
1204 recognize (i.e. netstat -a): 
1205
1206 \footnotesize
1207 \begin{verbatim}
1208 bacula-dir      9101/tcp
1209 bacula-fd       9102/tcp
1210 bacula-sd       9103/tcp
1211 \end{verbatim}
1212 \normalsize
1213
1214 \subsection*{Installing Bacula}
1215 \index[general]{Bacula!Installing }
1216 \index[general]{Installing Bacula }
1217 \addcontentsline{toc}{subsection}{Installing Bacula}
1218
1219 Before setting up your configuration files, you will want to install Bacula in
1220 its final location. Simply enter: 
1221
1222 \footnotesize
1223 \begin{verbatim}
1224 make install
1225 \end{verbatim}
1226 \normalsize
1227
1228 If you have previously installed Bacula, the old binaries will be overwritten,
1229 but the old configuration files will remain unchanged, and the "new"
1230 configuration files will be appended with a {\bf .new}. Generally if you have
1231 previously installed and run Bacula you will want to discard or ignore the
1232 configuration files with the appended {\bf .new}. 
1233
1234 \subsection*{Building a File Daemon or Client}
1235 \index[general]{Client!Building a File Daemon or }
1236 \index[general]{Building a File Daemon or Client }
1237 \addcontentsline{toc}{subsection}{Building a File Daemon or Client}
1238
1239 If you run the Director and the Storage daemon on one machine and you wish to
1240 back up another machine, you must have a copy of the File daemon for that
1241 machine. If the machine and the Operating System are identical, you can simply
1242 copy the Bacula File daemon binary file {\bf bacula-fd} as well as its
1243 configuration file {\bf bacula-fd.conf} then modify the name and password in
1244 the conf file to be unique. Be sure to make corresponding additions to the
1245 Director's configuration file ({\bf bacula-dir.conf}). 
1246
1247 If the architecture or the O/S level are different, you will need to build a
1248 File daemon on the Client machine. To do so, you can use the same {\bf
1249 ./configure} command as you did for your main program, starting either from a
1250 fresh copy of the source tree, or using {\bf make\ distclean} before the {\bf
1251 ./configure}. 
1252
1253 Since the File daemon does not access the Catalog database, you can remove
1254 the {\bf \verb:--:with-mysql} or {\bf \verb:--:with-sqlite} options, then
1255 add {\bf \verb:--:enable-client-only}.  This will compile only the
1256 necessary libraries and the client programs and thus avoids the necessity
1257 of installing one or another of those database programs to build the File
1258 daemon.  With the above option, you simply enter {\bf make} and just the
1259 client will be built.
1260
1261 \label{autostart}
1262 \subsection*{Auto Starting the Daemons}
1263 \index[general]{Daemons!Auto Starting the }
1264 \index[general]{Auto Starting the Daemons }
1265 \addcontentsline{toc}{subsection}{Auto Starting the Daemons}
1266
1267 If you wish the daemons to be automatically started and stopped when your
1268 system is booted (a good idea), one more step is necessary. First, the
1269 ./configure process must recognize your system -- that is it must be a
1270 supported platform and not {\bf unknown}, then you must install the platform
1271 dependent files by doing: 
1272
1273 \footnotesize
1274 \begin{verbatim}
1275 (become root)
1276 make install-autostart
1277 \end{verbatim}
1278 \normalsize
1279
1280 Please note, that the auto-start feature is implemented only on systems
1281 that we officially support (currently, FreeBSD, RedHat/Fedora Linux, and
1282 Solaris), and has only been fully tested on Fedora Linux.
1283
1284 The {\bf make install-autostart} will cause the appropriate startup scripts
1285 to be installed with the necessary symbolic links.  On RedHat/Fedora Linux
1286 systems, these scripts reside in {\bf /etc/rc.d/init.d/bacula-dir} {\bf
1287 /etc/rc.d/init.d/bacula-fd}, and {\bf /etc/rc.d/init.d/bacula-sd}.  However
1288 the exact location depends on what operating system you are using.
1289
1290 If you only wish to install the File daemon, you may do so with: 
1291
1292 \footnotesize
1293 \begin{verbatim}
1294 make install-autostart-fd
1295 \end{verbatim}
1296 \normalsize
1297
1298 \subsection*{Other Make Notes}
1299 \index[general]{Notes!Other Make }
1300 \index[general]{Other Make Notes }
1301 \addcontentsline{toc}{subsection}{Other Make Notes}
1302
1303 To simply build a new executable in any directory, enter: 
1304
1305 \footnotesize
1306 \begin{verbatim}
1307 make
1308 \end{verbatim}
1309 \normalsize
1310
1311 To clean out all the objects and binaries (including the files named 1, 2, or
1312 3, which Kern uses as temporary files), enter: 
1313
1314 \footnotesize
1315 \begin{verbatim}
1316 make clean
1317 \end{verbatim}
1318 \normalsize
1319
1320 To really clean out everything for distribution, enter: 
1321
1322 \footnotesize
1323 \begin{verbatim}
1324 make distclean
1325 \end{verbatim}
1326 \normalsize
1327
1328 note, this cleans out the Makefiles and is normally done from the top level
1329 directory to prepare for distribution of the source. To recover from this
1330 state, you must redo the {\bf ./configure} in the top level directory, since
1331 all the Makefiles will be deleted. 
1332
1333 To add a new file in a subdirectory, edit the Makefile.in in that directory,
1334 then simply do a {\bf make}. In most cases, the make will rebuild the Makefile
1335 from the new Makefile.in. In some case, you may need to issue the {\bf make} a
1336 second time. In extreme cases, cd to the top level directory and enter: {\bf
1337 make Makefiles}. 
1338
1339 To add dependencies: 
1340
1341 \footnotesize
1342 \begin{verbatim}
1343 make depend
1344 \end{verbatim}
1345 \normalsize
1346
1347 The {\bf make depend} appends the header file dependencies for each of the
1348 object files to Makefile and Makefile.in. This command should be done in each
1349 directory where you change the dependencies. Normally, it only needs to be run
1350 when you add or delete source or header files. {\bf make depend} is normally
1351 automatically invoked during the configuration process. 
1352
1353 To install: 
1354
1355 \footnotesize
1356 \begin{verbatim}
1357 make install
1358 \end{verbatim}
1359 \normalsize
1360
1361 This not normally done if you are developing Bacula, but is used if you are
1362 going to run it to backup your system. 
1363
1364 After doing a {\bf make install} the following files will be installed on your
1365 system (more or less). The exact files and location (directory) for each file
1366 depends on your {\bf ./configure} command (e.g. gnome-console and
1367 gnome-console.conf are not installed if you do not configure GNOME. Also, if
1368 you are using SQLite instead of mysql, some of the files will be different). 
1369
1370 \footnotesize
1371 \begin{verbatim}
1372 bacula
1373 bacula-dir
1374 bacula-dir.conf
1375 bacula-fd
1376 bacula-fd.conf
1377 bacula-sd
1378 bacula-sd.conf
1379 bacula-tray-monitor
1380 tray-monitor.conf
1381 bextract
1382 bls
1383 bscan
1384 btape
1385 btraceback
1386 btraceback.gdb
1387 bconsole
1388 bconsole.conf
1389 create_mysql_database
1390 dbcheck
1391 delete_catalog_backup
1392 drop_bacula_tables
1393 drop_mysql_tables
1394 fd
1395 gnome-console
1396 gnome-console.conf
1397 make_bacula_tables
1398 make_catalog_backup
1399 make_mysql_tables
1400 mtx-changer
1401 query.sql
1402 bsmtp
1403 startmysql
1404 stopmysql
1405 wx-console
1406 wx-console.conf
1407 \end{verbatim}
1408 \normalsize
1409
1410 \label{monitor}
1411
1412 \subsection*{Installing Tray Monitor}
1413 \index[general]{Monitor!Installing Tray }
1414 \index[general]{Installing Tray Monitor }
1415 \addcontentsline{toc}{subsection}{Installing Tray Monitor}
1416
1417 The Tray Monitor is already installed if you used the {\bf
1418 \verb:--:enable-tray-monitor} configure option and ran {\bf make install}.
1419
1420 As you don't run your graphical environment as root (if you do, you should
1421 change that bad habit), don't forget to allow your user to read {\bf
1422 tray-monitor.conf}, and to execute {\bf bacula-tray-monitor} (this is not a
1423 security issue).
1424
1425 Then log into your graphical environment (KDE, Gnome or something else), run
1426 {\bf bacula-tray-monitor} as your user, and see if a cassette icon appears
1427 somewhere on the screen, usually on the task bar.
1428 If it doesn't, follow the instructions below related to your environment or
1429 window manager. 
1430
1431 \subsubsection*{GNOME}
1432 \index[general]{GNOME }
1433 \addcontentsline{toc}{subsubsection}{GNOME}
1434
1435 System tray, or notification area if you use the GNOME terminology, has been
1436 supported in GNOME since version 2.2. To activate it, right-click on one of
1437 your panels, open the menu {\bf Add to this Panel}, then {\bf Utility} and
1438 finally click on {\bf Notification Area}. 
1439
1440 \subsubsection*{KDE}
1441 \index[general]{KDE }
1442 \addcontentsline{toc}{subsubsection}{KDE}
1443
1444 System tray has been supported in KDE since version 3.1. To activate it,
1445 right-click on one of your panels, open the menu {\bf Add}, then {\bf Applet}
1446 and finally click on {\bf System Tray}. 
1447
1448 \subsubsection*{Other window managers}
1449 \index[general]{Managers!Other window }
1450 \index[general]{Other window managers }
1451 \addcontentsline{toc}{subsubsection}{Other window managers}
1452
1453 Read the documentation to know if the Freedesktop system tray standard is
1454 supported by your window manager, and if applicable, how to activate it. 
1455
1456 \subsection*{Modifying the Bacula Configuration Files}
1457 \index[general]{Modifying the Bacula Configuration Files }
1458 \index[general]{Files!Modifying the Bacula Configuration }
1459 \addcontentsline{toc}{subsection}{Modifying the Bacula Configuration Files}
1460
1461 See the chapter 
1462 \ilink{Configuring Bacula}{_ChapterStart16} in this manual for
1463 instructions on how to set Bacula configuration files.