Chapter 2 Installation
Table of Contents
In order to compile and install SmbFTPD, you need:
After download the SmbFTPD, please un-tar and change directory in it. Then you may compile by the following commands:
# ./configure # make
The configure command will detect your system environment and decide the compile options and features to install, such as IPv6 support, TCP Wrapper, or PAM, etc.
Other available options for configure:
# ./configure --help Optional Features: --with-mysql[=DIR] Users database is a MySQL database (default=no) --with-pgsql[=DIR] Users database is a PostgreSQL database (default=no) --with-ssl[=DIR] Enable SSL/TLS support (default=no) --with-iconv=[DIR] Enable codepage to unicode conversion for UTF-8 FTP (default=no) --prefix=PREFIX Install architecture-independent files in PREFIX [/usr/local]
If you would like to use MySQL virtual user function, please add the option --with-mysql. To use SSL/TLS, add --with-ssl.
After compile, if you have SSL/TLS support, you will need SSL certificate and private key. If you have installed Apache+SSL, you can use the its certificate, too. To generate certificate, please use the following commnad before install:
# make cert
We will generate a self signing certificate. Now you can install the SmbFTPD by the following commnad:
# make install
If you would like to cross compile, just set the path of CC in the environment:
# env CC=/usr/local/powerpc-linux/bin/powerpc-linux-gcc \ LD=/usr/local/powerpc-linux/bin/powerpc-linux-ld \ RANLIB=/usr/local/powerpc-linux/bin/powerpc-linux-ranlib \ ./configure --with-ssl --with-iconv # make # make cert # make install
After make install, we will install the smbftpd into /usr/local/sbin and install the smbftpd.conf and smbftpd_share.conf into /usr/local/etc/smbftpd/. If you are installing the SmbFTPD in Linux and the /etc/pam.d/ftpd does not exist, we will also install a ftpd PAM file (Pluggable Authentication Modules). Some OS, such as Fedora does not have PAM for ftpd. But smbftpd might need it.
If you would like to install smbftpd into other directory rather then /usr/local, you can add option --prefix=/path/to/your/dir when running configure.
Before starting the SmbFTPD, you should edit /usr/local/etc/smbftpd/smbftpd.conf. If not, you will use the default configuration which is usually ok. We will descript more about the configuration file in the next chapter.
There are two ways to use the FTP daemon: as an inetd-based service or in a daemon mode. The most common manner is to run the ftpd as the inetd-based service. In this case the internet "super-server" listens for connections, does access control and starts the server to handle the request. In the daemon mode, the ftpd itself accepts connections on the FTP port and forks children processes to handle them. This mode has the lower overhead and thus is useful on busy servers to reduce load.
There are two popular implementations of the "super-server": inetd and xinetd. The capabilities of inetd may vary in different operating systems: modern distributions of BSD systems usually use an enhanced version of this software as a default "super-server", but in other systems, include most Linux distributions, a simpler one is available.
The xinetd is a powerful replacement for inetd and it's used as the default internet "super-server" in a number of modern Linux distributions, but it's also available for some other operating systems, include most popular BSD ones.
In case of inetd you need to edit the /etc/inetd.conf file and to add something like this into it:
The xinetd configuration may be stored in the /etc/xinetd.conf file or in separate files (with the same syntax as xinetd.conf) with arbitrary names in the /etc/xinetd.d/ directory. If the xinetd.d/ directory exists, then xinetd.conf contains some defaults and xinetd.d/ contains configurations of individual services.
Next configuration may be recommended as a template:
In this example, the service is enable by default, so you need to change the "disable" flag from "no" to "yes" to disable the secure FTP server. After changing of the configuration, you need to force inetd or xinetd to re-read it. See also the documentation of the corresponding software for more information, in particular the inetd(8) and/or xinetd(8) man pages.
If you would like to run smbftpd as a standalone daemon just use the following command:
# /usr/local/sbin/smbftpd -D
For FreeBSD users, if you would like to run smbftpd at boot time, please edit the /etc/rc.conf and add the following line:
Than you can use the following command to start SmbFTPD:
# /usr/local/etc/rc.d/smbftpd.sh start
# /usr/local/etc/rc.d/smbftpd.sh stop
Here are available options you can use when starting smbftpd:
|Copyright © 2002-2021 Alex Wang from www.twbsd.org. All rights reserved.|