Debian Codegraph @

INSTALL

raw
1
2 ProFTPD 1.2 Installation Instructions
3 =======================================
4
5 ------------
6 Introduction
7 ------------
8
9 ProFTPD is designed to be configured for compilation on the target system by
10 a single shell script, named 'configure', located in the top-level directory
11 of the source distribution. This script, originally generated by the GNU
12 autoconf tool, will analyze your system and create a 'config.h' file that
13 *should* allow ProFTPD to compile cleanly. On some systems it may be necessary
14 to give certain options to configure or to tweak manually one or both of the
15 config.h and the top-level Makefile files produced by configure.
16
17 ProFTPD is designed to be very flexible, which necessarily leads to extra
18 compile-time and run-time configuration complexity. The configure script
19 also can be used to customize your build, setting compile-time options
20 based on command line options that you provide. In particular, optional
21 software modules to be compiled into ProFTPD may be chosen this way.
22
23 In addition to those set by the configure script, the file 'include/options.h'
24 contains a number of easily tweakable compile-time options which will affect
25 ProFTPD's operation. These options are never modified by the configure script.
26 Each option is documented in the header file itself. Changing these values
27 is rarely needed, and most can be overridden at run-time by directives in the
28 proftpd.conf configuration file.
29
30 Note that a sample RPM spec file has been included in contrib/dist/rpm/.
31
32 NOTE TO PACKAGE MAINTAINERS:
33 Please, do NOT remove the ELF .comment and .note sections.
34
35 If you install ProFTPD on a slightly uncommon (or really new or old) platform,
36 please consider recording and sharing your experience.
37
38
39 ------------------
40 Build Requirements
41 ------------------
42
43 o ANSI/ISO C89/C90 C compiler, e.g. GNU gcc
44 o GNU make, though most system makes should work
45 o ANSI C and POSIX run-time libraries
46 o BSD sockets API
47 o Disk space: ~4.5 MB to unpack, 6-8 MB to build, ~2 MB to install
48
49
50
51 -------------------------
52 Installation Instructions
53 -------------------------
54
55 0. Plan your installation.
56 Please, read through all the installation steps before starting.
57 There are many compile-time customizations that you may wish to make,
58 particularly regarding user authentication. Read through README.modules
59 and the other README.* and contrib/README.* files.
60
61 Note that the following modules are included by default and need not
62 be added explicitly: mod_auth, mod_core, mod_log, mod_ls, mod_site,
63 mod_auth_unix and mod_xfer. Also, if PAM is detected by configure,
64 the mod_auth_pam module will be included automatically. However, it has
65 been reported that some systems still require it to be added explicitly.
66
67 You may need to specify the shared library search path on your system.
68 See your system and compiler documentation. Frequently, the -R or -rpath
69 options are used for this operation. Be especially careful to set the
70 path on AIX systems. See README.AIX.
71
72 Hint: if your configure command line becomes long or complicated,
73 you might try storing it in a sh script file, say '.configcmd'.
74
75
76 1. Configure the software.
77 Run the GNU autoconf 'configure' script in the top level directory to
78 create config.h and all the Makefiles. In addition to configuring
79 ProFTPD to compile on your system, you can use this step to customize
80 some parameters of or add optional features to ProFTPD. There are many
81 configuration options. To use the default values, you would simply run:
82
83 $ ./configure
84
85 By default the ProFTPD files will be installed as user 'root' and the
86 first group with gid 0 listed in /etc/group, usually 'root' or 'wheel'.
87 If you wish to install using a different user or group ownership, set
88 the install_user and install_group environment variables before running
89 configure. Using a Bourne-ish style shell (e.g. sh, ksh, bash), you can
90 do this on the command line like this:
91
92 $ install_user=root install_group=wheel ./configure
93
94 Similarly, as is typical with GNU autoconf scripts, settings for the
95 compilation system can be made, such as the compiler:
96
97 $ ./configure CC=gcc CFLAGS='-O -g'
98
99 Other options can be given to configure as command line arguments.
100 All available arguments can be listed by running './configure --help'.
101
102 By default proftpd and ftpshut are installed in /usr/local/sbin/,
103 ftpcount and ftpwho in /usr/local/bin/, the configuration file in
104 /usr/local/etc/, and the man pages in /usr/local/man/man?/. Further,
105 /usr/local/var/proftpd/ is used to hold the runtime scoreboard file.
106 See the "Directory and file names" section of the './configure --help'
107 output for the arguments to change these defaults. For instance,
108 to place all these directories under /usr/ rather than /usr/local/,
109 you could use:
110
111 $ ./configure --prefix=/usr
112
113 Or, to place the configuration file in /etc/ and the runtime state
114 files in /var/proftpd/, you would use:
115
116 $ ./configure --sysconfdir=/etc --localstatedir=/var/proftpd
117
118 Optional ProFTPD modules can be included using '--with-modules=LIST',
119 where 'LIST' is a colon-separated list of module names. This applies
120 only to optional modules, such as those found in the contrib/ directory
121 (the core modules in the modules/ directory are either mandatory or
122 included by default). For example, if you wish to include both the
123 readme and LDAP modules, you would use:
124
125 $ ./configure --with-modules=mod_readme:mod_ldap
126
127 Some operating systems require you to use either '--enable-autoshadow'
128 or '--enable-shadow' if you wish to use the system's shadow password
129 file for user authentication. Using autoshadow allows proftpd to work
130 with either shadow or traditional password files.
131
132 If you wish to use SQL for user authentication, you must specify mod_sql
133 and one SQL backend module, either mod_sql_mysql or mod_sql_postgres.
134 Further, the backend module must be specified *later* in the module list,
135 e.g. '--with-modules=mod_sql:mod_sql_postgres'. Otherwise, compilation
136 will succeed, but SQL authentication will not work.
137
138 Be aware that if you ever need to rerun the configure script, you first
139 should run 'make distclean'.
140
141
142 2. Verify correct configure operation.
143 Watch the output of the configure script. After configure has run,
144 you may wish to inspect the config.h file to make sure configure didn't
145 make any wrong "guesses" for your platform.
146
147
148 3. Compile the software.
149 Run 'make' from the top-level directory. On some systems (e.g. BSDI),
150 you may need to use GNU make (often 'gmake' or 'gnumake') instead of
151 the default system make. Watch the output of the compile process and
152 make sure no errors occur. On some platforms (notably AIX and IRIX)
153 you may see some compilation or link warnings. These generally can
154 be ignored.
155
156
157 4. Test the software.
158 As of ProFTPD 1.2.0, there are no automated regression tests.
159 However, you are encouraged to perform your own ad-hoc, manual tests.
160
161 Note that you can start proftpd directly from your shell prompt, but do
162 remember that it must run as root for all functions to operate properly.
163 Nonetheless, many operations can be verified without root privileges.
164 An alternate configuration file can be specified using the '-c' command
165 line switch. In the configuration file, the TCP ports may be changed
166 from the standard default ftp (21) and ftp-data (20) ports, and an
167 alternate passwd file may be specified. Since such a daemon will not be
168 able to change its uid, you also must specify the user and group names
169 to match those used to start the daemon.
170
171 To demonstrate this process, a set of example config files have been
172 included in the sample-configurations subdirectory.
173
174 % sh sample-configurations/PFTEST.install
175 Sample test files successfully installed in /tmp/PFTEST.
176 % ./proftpd -n -d 5 -c /tmp/PFTEST/PFTEST.conf
177
178 Then, in another window, connect to the unprivileged port. PFTEST.conf
179 uses port 2021, and PFTEST.passwd defines a user "proftpd" with password
180 "proftpd". Using the traditional Unix ftp client, it might look something
181 like this:
182
183 % ftp -n -d
184 ftp> open <hostname> 2021
185 ftp> user proftpd
186 ---> USER proftpd
187 331 Password required for proftpd.
188 Password: [proftpd]
189 ---> PASS proftpd
190 230 User proftpd logged in.
191 ftp>
192
193 The supplied PFTEST.passwd is in traditional Unix format. Your system
194 may use a different file format, so you may have to create your own.
195 Further, you may have to use another method to insert your user and group
196 names into the PFTEST.conf file, if the PFTEST.install script fails.
197
198 If you encounter any problems, be sure to see the "Troubleshooting" and
199 "Help" sections below.
200
201
202 5. Package the software.
203 As of ProFTPD 1.2.0, no packaging procedures are provided other than
204 the inclusion of an RPM spec file in the contrib/dist/rpm/ directory.
205
206
207 6. Install the software.
208 Note: this and the following steps likely require root privileges.
209 Unless a system specific installation package was created, e.g. an RPM,
210 run 'make install' from the top-level build directory. This installs
211 the ProFTPD executables, man pages, and a basic configuration file,
212 copied from 'sample-configurations/basic.conf'. The full path to the
213 configuration file will be '/usr/local/etc/proftpd.conf', unless it was
214 changed in Step 1.
215
216 If an installation package was created, install the ProFTPD package
217 according to procedures appropriate for that packaging system.
218
219
220 7. Modify the proftpd configuration file.
221 If the User and Group specified in proftpd.conf do not exist on your
222 system proftpd WILL NOT RUN. Edit and modify proftpd.conf as needed.
223 Many systems have the group "nobody" instead of the group "nogroup".
224 Decide how you want to run proftpd, either started by inetd (or xinetd)
225 or as a standalone daemon. Then edit the proftpd.conf file and change
226 the ServerType directive to match your choice, either "ServerType inetd"
227 or "ServerType standalone". The "basic.conf" config file, installed by
228 'make install' in Step 4, has a default setting of "standalone".
229
230
231 8. Modify the inetd superserver configuration file.
232 Edit /etc/inetd.conf and then send the inetd process the -HUP signal,
233 so that it will reread the updated configuration file. On some systems
234 there are other mechanisms to tell inetd to reread its configuration file,
235 e.g. 'refresh -s inetd' on AIX. Check your system documentation to see
236 what command is appropriate.
237
238 If proftpd is to be run from inetd, find the line in /etc/inetd.conf
239 that looks something like:
240
241 ftp stream tcp nowait root /usr/sbin/in.ftpd in.ftpd
242
243 And replace it with:
244
245 ftp stream tcp nowait root /usr/local/sbin/proftpd proftpd
246
247 Or, if the tcp wrappers package is installed on your system, you may
248 use a line something like:
249
250 ftp stream tcp nowait root /usr/sbin/tcpd /usr/local/sbin/proftpd
251
252 If proftpd is to be run in standalone mode, you should comment out any
253 ftp line in the /etc/inetd.conf file by inserting a '#' at the beginning
254 of the line. Then signal the inetd process to reread /etc/inetd.conf.
255
256 If your system is using xinetd instead of inetd then either edit
257 your /etc/xinetd.conf file or add a proftpd file in /etc/xinetd.d/
258
259 service ftp
260 {
261 flags = REUSE
262 socket_type = stream
263 instances = 50
264 wait = no
265 user = root
266 server = /usr/sbin/proftpd
267 bind = <the-ip-you-wish-to-bind-to>
268 log_on_success = HOST PID
269 log_on_failure = HOST
270 }
271
272 More information can be found in the FAQ and Userguide and in the
273 xinetd documentation for your system
274
275
276 9. Modify the system boot scripts.
277 If running in standalone mode, you probably will want to edit your boot
278 scripts to start proftpd at boot time. For systems that use SysV-style
279 individual startup scripts, the source distribution includes an example
280 init script, "contrib/dist/rpm/proftpd.init.d".
281
282
283 10. Create the runtime state directory.
284 In order for the MaxClients and MaxClientsPerHost directives and the
285 ftpwho and ftpcount utilities to work, proftpd must have a scoreboard
286 file. The default is '/usr/local/var/proftpd/proftpd.scoreboard', though
287 it may have been changed in the configuration process in Step 1.
288 The default location also can be overridden at run-time by using the
289 ScoreboardFile directive in the proftpd.conf configuration file.
290 If the indicated file does not exist, it will be created when the daemon
291 starts up. If you have installed from an installation package, the
292 installation scripts may have created the default directory.
293
294
295 11. Verify operation.
296 Once proftpd either has been configured to be started by inetd or has
297 been started in standalone mode, try ftp'ing to your system to make
298 sure that everything works. As before, if you run into any problems,
299 see the "Troubleshooting" and "Help" sections below.
300
301
302 12. Customize the proftpd configuration file.
303 If you wish to add anonymous ftp or otherwise create a more sophisticated
304 ftp configuration, read more about configuring ProFTPD:
305
306 Configuration Examples: sample-configurations/*.conf
307 Configuration Reference: doc/Configuration.html
308 Documentation: http://www.proftpd.org/docs/
309 FAQ: http://www.proftpd.org/docs/faq/linked/faq.html
310
311 Note that some systems will require special system-specific preparation
312 of the anonymous ftp and any other chroot directories. PLEASE NOTE
313 that the configuration directives "PersistentPasswd", "RequireValidShell",
314 and "UseFtpUsers" may require special attention.
315
316 To check the syntax of a new or modified configuration file, you may
317 run 'proftpd -t -c <new_conf_file>' from the command line.
318
319 You can test the runtime function of your configuration file without
320 interfering with a running server, by running a separate test server
321 on a different port. Specify the port to use with the "Port" directive
322 in the configuration file, but don't forget to restore the port setting
323 before installing the new configuration file for the production server.
324
325
326 Good luck!
327
328
329
330 ---------------
331 Troubleshooting
332 ---------------
333
334 This section is far from comprehensive. See the FAQ and other resourses
335 for further assistance.
336
337
338 T1. Compile time problems are often easy to sort out by giving the right
339 options and search paths to the compiler. However, at other times they
340 can be rather difficult to debug. Problems often result from header
341 file or C preprocessor macro name conflicts. A few packages have been
342 known to install conf.h headers in /usr/local/include. Occasionally,
343 one must resort to looking at the preprocessor output. Consult your
344 compiler documentation for how to do this, though a command similar
345 to `cc -E file.c` often works.
346
347 Some common error messages include:
348
349 o "symbol ap_signal undefined in main.o"
350 This usually means that the fnmatch.h header is including
351 the Apache ap_config.h header, though proftpd does not link
352 with the Apache library. This mostly happens on Solaris 8,
353 though a similar problem has been reported on Red Hat 6.0
354 systems with the <hsregex.h> header.
355
356
357 T2. If you encounter run-time problems, first check your syslog messages.
358 The proftpd daemon logs all the error conditions that it encounters,
359 including problems parsing the configuration file. Authentication related
360 messages are logged using the syslog facility "auth" or, if available,
361 "authpriv". All other messages use the syslog "daemon" facility, unless
362 redirected by the "-n" command line switch or by the SyslogFacility or
363 SystemLog directives. Check your syslogd.conf to see what syslogd does
364 with these messages.
365
366 Some common error messages include:
367
368 o "inet_create_connection() failed: Operation not permitted"
369 This usually means that proftpd was not started as root.
370
371 o "bind: unable to bind to port" or "Address already in use"
372 This usually means that another process, either inetd, xinetd or
373 another standalone ftp server, is already using the ftp port.
374
375 o "Fatal: Socket operation on non-socket"
376 This usually means that proftpd.conf ServerType directive is
377 configured for inetd rather than standalone mode.
378
379 o "received: PASS (hidden)"
380 "ProFTPD terminating (signal 11)"
381 This usually means that shadow passwd file support is required
382 but was not compiled in. Try starting the build over at Step 1,
383 adding either '--enable-autoshadow' or '--enable-shadow' to
384 the configure command line.
385
386 If users can not login and your system uses PAM authentication, you may
387 need to configure PAM to work for FTP. For further details, consult your
388 system PAM documentation. If you have installed from a package, hopefully
389 this was done automatically. On Linux systems, the following may work:
390
391 % cp -p contrib/dist/rpm/ftp.pamd /etc/pam.d/ftp
392
393 If your client sees something like "server error 500, server shut down",
394 that probably means that you have a stale /etc/shutmsg file, which you
395 should delete.
396
397
398 T3. You can generate additional debugging messages by starting the proftpd
399 daemon with the "-d N" command line option, where N ranges from 1 to 10,
400 with higher values increase the number of debugging messages. If you are
401 running the daemon standalone, you also may wish to use the "-n" option,
402 which will keep the daemon from disassociating from your terminal and
403 cause all messages to display directly on your terminal rather than
404 being syslogged.
405
406
407 T4. If you encounter problems not readily diagnosed by the error messages,
408 you might check for a newer ProFTPD release at the official distribution
409 sites to see if your problem has already been fixed. Reading the
410 ChangeLog file in each new distribution is often the fastest way to
411 see what bugs have been fixed.
412
413
414 T5. If your system has a system call trace utility, you may wish to use it
415 to diagnose what is failing. Often this method is useful to spot a
416 file open failures, including shared libraries.
417
418 Some system call trace utilities:
419 o truss (Solaris, SVR4 derivatives, Unixware, AIX5L, FreeBSD)
420 o trace (SunOS 4.x)
421 o tusc (HP/UX 11.x: ftp://ftp.cup.hp.com/dist/networking/tools/)
422 trace
423 http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/trace-1.6/
424 http://devresource.hp.com/devresource/Tools/ToolLibrary.html#perfhp
425 o syscalls, trace (AIX 4.x); sctrace
426 o par (IRIX)
427 o alpha-trace (Digital Unix: ftp://ftp.mrc-lmb.cam.ac.uk/pub/jkb/)
428 o ktrace/kdump (FreeBSD, OpenBSD, NetBSD)
429 o strace, ktrace/kdump, ltrace (Linux)
430
431
432 T6. Another diagnostic technique is to monitor the FTP protocol communication
433 between the proftpd server and the ftp client. Many ftp clients have a
434 debug or trace option. Though requiring detailed knowledge of the FTP
435 protocol, telnet can be used to connect and directly converse with the
436 proftpd server. Lastly, the FTP converstation can be traced using a
437 network monitoring tool, such as tcpdump, ethereal, snoop or netsnoop.
438
439
440 T7. Further debugging probably will require the use of a debugger,
441 which may require recompiling proftpd with debugging symbols.
442 Consult your compiler and debugger documentation.
443
444
445
446 ----
447 Help
448 ----
449
450 H1. Before asking for help on the mailing list, look through the available
451 documentation, including the FAQ and the searchable archives of the
452 mailing lists. Not only are many common questions answered in those
453 documents, but they will often yield answers faster than a question
454 sent to the mailing list.
455
456 See the "Resources" section below for documentation pointers and links.
457
458
459 H2. When posting to the mailing list, try to be clear and concise, but give
460 enough information to enable people to help. Merely stating something
461 like "It doesn't work. Help!" is unlikely to elicit any useful answers.
462 Describe your problem as completely as possible, including what you think
463 is wrong, what behavior you expect, and any relevant error log messages
464 or debug output. Unless the problem occurs with the base proftpd.conf
465 file or a minimal derivative, it may be useful to include part or all of
466 your proftpd.conf file.
467
468 So, at a minimum, you should include:
469 o OS type and version (e.g. `uname -a`)
470 o ProFTPD extended version info (`proftpd -V` and `proftpd -vv`)
471 o ProFTPD module list (`proftpd -l`)
472
473 The following may help to further identify compilation information,
474 especially if you are installing a vendor supplied package rather than
475 building from sources yourself:
476 o `what proftpd` or `ident proftpd`
477
478 And still more compilation information may be available if your system
479 uses the ELF object file format:
480 o `objdump -f proftpd` or `dump -v -f proftpd`
481 or `elfdump -v -f proftpd`
482 o `objdump -j .comment proftpd` or `dump -n .comment proftpd`
483 or `elfdump -n .comment proftpd`
484 o `mcs -p proftpd`
485 o `objdump -j .note proftpd` or `dump -v -n .note proftpd`
486 or `elfdump -v -n .note proftpd` or `mcs -p -n .note proftpd`
487
488
489 H3. Please, please, do NOT use the bug reporting system for compilation or
490 configuration problems and questions. Those should be sent to the
491 mailing list.
492
493 In order conserve development resources, please only submit bug reports
494 when you have reasonable confidence that there is an actual code bug,
495 a portability problem, or problems with the build and compilation system.
496 Even then, please first search the bug system to see if your bug has been
497 reported already. If it has, use your own best judgement about adding
498 comments to the existing report, especially either to confirm the bug's
499 existence or to provide additional diagnostic and debugging information.
500
501 For some more suggestions about reporting bugs, see:
502 http://bugs.proftpd.org/bugwritinghelp.html
503
504
505
506 ---------
507 Resources
508 ---------
509
510 R1. Basics.
511
512 Various Subjects: README.*, contrib/README.*
513 Configuration Ref: doc/Configuration.html
514 Config/Problem FAQ: doc/faq.html
515
516 WWW: http://www.proftpd.org
517 FTP: ftp://ftp.proftpd.org/distrib/
518 Mirror Site List: http://www.proftpd.org/wwwmirror.html
519
520
521 R2. ProFTPD Documentation Project.
522 Documents include a Configuration Reference, draft User Guide, and FAQ.
523 Formats include linked and single HTML files, PostScript, PDF and text.
524
525 Note that this Configuration Reference may refer to a newer code base
526 than you are using. So, referring to doc/Configuration.html file in
527 your source distribution may be less confusing.
528
529 (main): http://sourceforge.net/projects/pdd
530
531
532 R3. E-Mail Lists.
533
534 End User List
535 (submissions): [email protected]
536 (subscribe): [email protected]
537 (archives): http://sourceforge.net/mailarchive/forum.php?forum_name=proftp-user
538
539 Developer List
540 (submissions): [email protected]
541 (subscribe): [email protected]
542 (archives): http://sourceforge.net/mailarchive/forum.php?forum_name=proftp-devel
543
544 Announcement List
545 (subscribe): [email protected]
546 (archives): ttp://sourceforge.net/mailarchive/forum.php?forum_name=proftp-announce
547
548 Security Reports: [email protected]
549
550
551 R4. Bug Tracking System (Bugzilla).
552
553 Bug Reports/Patches: http://bugs.proftpd.org
554 [email protected]
555
556
557 R5. CVS Repositories.
558
559 Anonymous CVS: cvs.proftp.sourceforge.net
560 (instructions): http://www.proftpd.org/cvs.html
561 CVS tarballs: ftp://ftp.stikman.com/pub/proftpd/
562 ftp://ftp.linuxceptional.com/proftpd/
563
564 Development CVS: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/proftp/proftpd/
565
566
567 R6. Statement about proftpd.org and proftpd.net.
568
569 The www.proftpd.org and www.proftpd.net sites now should be effectively
570 mirrors of one another. The official proftpd site is www.proftpd.org,
571 however www.proftpd.net will remain in operation at a physically remote
572 location in order to provide redundancy.
573