H-Sphere FTP is based on ProFTPd server and installed on Web boxes as
hsphere-ftp-<version>-<build> package, where
<version> is ProFTPd version, and <build> is
this package's build number.
ProFTPd binary is /hsphere/shared/sbin/proftpd.
Please refer to the original ProFTPd site for Configuration
Directive List.
There are two kinds of FTP:
- User FTP: When a new user account is created, its user is provided with
the FTP account and thus may download/upload files from/to the user's home directory
(/hsphere/local/home/{user_name}) by FTP using his name and password.
- Virtual (anonymous) FTP: a service provided only for dedicated IP accounts, enables to
create virtual accounts to download/upload files from/to virtual account directories that are
located within the account home directory, and provides anonymous access to the public
directory.
User FTP
Log File
When a user uploads or downloads data, the corresponding record is made in the log files:
/hsphere/local/var/proftpd/xferlog - FTP log
/hsphere/local/var/proftpd/tls.log - TLS/SSL log ( in H-Sphere 3.1)
Configuration
/hsphere/shared/config/ftpd - FTP configuration directory
/hsphere/shared/config/ftpd/proftpd.conf - FTP configuration file
/hsphere/shared/config/ftpd/proftpd.conf.shared - FTP subaccounts' configuration file
/hsphere/local/config/ftpd/lservers/web_<Shared_IP>.conf - configuration files of logical servers' vitrual hosts
/hsphere/local/config/ftpd/sites - users' vitrual hosts
Read how to make changes into FTP config files.
Download/Upload Permissions
User can download and upload files from his document
root directory (/hsphere/local/home/{user_name}/{domain_name}) after he logs in
by FTP entering his login name ({user_name}) and password:
ftp user_name@domain_name
User FTP Traffic Calculation
Cron runs the /hsphere/shared/scripts/cron/ftp_anlz_user.pl
script on everyday basis for collecting user FTP traffic.
ftp_anlz_user.pl parses the /hsphere/local/var/proftpd/xferlog
FTP log file and writes FTP traffic statistics
into the /hsphere/local/var/statistic/dd.mm.YYYY.gst.txt.
The TrafficLoader Java class utility is launched by cron to process
FTP traffic statistics and load it to the system database. TrafficLoader also calls the
/hsphere/shared/scripts/xfer_cat.pl to gzip outdated statistics files
and move them into the loaded directory where they are stored as
dd.mm.YYYY.gst.txt.gz archives.
Virtual FTP
Log File
For each virtual account, its own configuration file is located in the
/hsphere/local/var/proftpd/logs/ directory. File format: {vhost_id}.ftp.log.
For example, wwwuser has virtual FTP enabled for the test.psoft virtual
host, and vhost_id=1208 is the virtual host identifier. When the virtual FTP
user test3 connects by FTP to the virtual host (ftp test3@test.psoft), he
would be allowed to download and upload (if permissions to write are set to that
virtual host) from /hsphere/local/home/wwwuser/1208 directory for downloads and
/hsphere/local/home/wwwuser/1208/incoming directory for uploaded files. The log
records would be added to /hsphere/local/var/proftpd/logs/1208.ftp.log
The same is true for anonymous FTP account. If this option is enabled for the
test.psoft virtual host, any user may connect by FTP using anonymous login
and any email as a password, and all his downloads would go to
/hsphere/local/home/wwwuser/1208 directory, uploads to the
/hsphere/local/home/wwwuser/1208/incoming subdirectory.
Configuration
Configuration directory is /hsphere/local/config/ftpd.
The sites subdirectory contains configuration files {vhost_id}.conf. These files are
generat ed by H-Sphere when the new virtual FTP server is created, by parsing the
/hsphere/local/home/cpanel/shiva/shiva-templates/common/ftp/ftp.config template where
the structure of virtual host configuration is set.
The sites/index.conf file contains the inclusions of the {vhost_id}.conf files.
The sites/{vhost_id}.passwd files contain information on the following accounts:
- {web_user_name} - name of the web user under which account this virtual host is
enabled. Thus, user may log on by his name and password to connect by FTP to the
virtual host FTP directory.
- {anonymous} - if anonymous FTP is switched on, anonymous connection may be
installed by the outsider.
- the list of virtual FTP users with their base64-encoded passwords.
/hsphere/local/config/ftpd/proftpd.conf - configuration file. It includes the
user FTP configuration file and sites/index.conf file.
Virtual FTP Traffic Calculation
Cron runs the /hsphere/shared/scripts/cron/ftp_anlz.pl
script daily to collect virtual FTP traffic statistics.
The script parses the virtual FTP log files and writes traffic statistics into
the timestamp-named /hsphere/local/var/statistic/dd.mm.YYYY.ftp.txt
.
The TrafficLoader Java class utility is launched by cron to process
anonymous FTP traffic statistics and load it to the system database. TrafficLoader also calls the
/hsphere/shared/scripts/xfer_cat.pl to gzip outdated statistics files
and move them into the loaded directory where they are stored as
dd.mm.YYYY.ftp.txt.gz archives.
FTP Over SSL/TLS ( in H-Sphere 3.1)
H-Sphere 3.1 implements FTP over SSL/TLS by adding
mod_tls module. If client software supports TLS, encryption is used, if not - FTP client operates in ordinary mode.
The /hsphere/local/config/ftpd/scripts/ftp-sharedssl.sh script which runs after installing the FTP software creates
virtual configs from the /hsphere/local/config/ftpd/lsrv.conf.tmpl template for each shared IP -
/hsphere/local/config/ftpd/lservers/web_<Shared_IP>.conf that take proftpd configuration from the
lservers directory.
ftp-sharedssl.sh script runs also after each restarting of the FTP server, and all virtual hosts are regenerated anew.
|