Web server requirements
- Web server: any web server which can run PHP. The most popular one is Apache.
- PHP: at least version 4.2.3. net2ftp works under Safe Mode. One advanced feature requires PHP 5 (send raw FTP command).
- Disk space: 7.5 MB for net2ftp (less if you remove the plugins), and a few MB for the temporary files.
Installation procedure
1 - Unzip all the files on your computer, and upload them to your server.
2 - The /temp directory should be chmodded to 777 (you can use
net2ftp.com to do this).
3 - Set your settings in the settings.inc.php file; read "Next steps" below for more details.
4 - A database is only required if you want to log the actions of theusers. To create the tables, execute the SQL queries below (also in the"create_tables.sql" file). This can be done easily in
PhpMyAdmin, the popular front-end to MySQL.
复制内容到剪贴板
代码:
DROP TABLE IF EXISTS `net2ftp_logAccess`;
DROP TABLE IF EXISTS `net2ftp_log_access`;
CREATE TABLE `net2ftp_log_access` (`id` int(10) unsigned NOT NULL auto_increment,`date` date NOT NULL default '0000-00-00',`time` time NOT NULL default '00:00:00',`remote_addr` text NOT NULL,`remote_port` text NOT NULL,`http_user_agent` text NOT NULL,`page` text NOT NULL,`datatransfer` int(10) unsigned default '0',`executiontime` mediumint(8) unsigned default '0',`ftpserver` text NOT NULL,`username` text NOT NULL,`state` text NOT NULL,`state2` text NOT NULL,`screen` text NOT NULL,`directory` text NOT NULL,`entry` text NOT NULL,`http_referer` text NOT NULL,KEY `index1` (`id`)) TYPE=MyISAM;
DROP TABLE IF EXISTS `net2ftp_logError`;
DROP TABLE IF EXISTS `net2ftp_log_error`;
CREATE TABLE `net2ftp_log_error` (`date` date NOT NULL default '0000-00-00',`time` time NOT NULL default '00:00:00',`ftpserver` text NOT NULL,`username` text NOT NULL,`message` text NOT NULL,`backtrace` text NOT NULL,`state` text NOT NULL,`state2` text NOT NULL,`directory` text NOT NULL,`remote_addr` text NOT NULL,`remote_port` text NOT NULL,`http_user_agent` text NOT NULL,KEY `index1` (`date`,`time`,`ftpserver`(100),`username`(50))) TYPE=MyISAM;
DROP TABLE IF EXISTS `net2ftp_logConsumptionFtpserver`;
DROP TABLE IF EXISTS `net2ftp_log_consumption_ftpserver`;
CREATE TABLE `net2ftp_log_consumption_ftpserver`(`date` date NOT NULL default '0000-00-00',`ftpserver` varchar(255) NOT NULL default '0',`datatransfer` int(10) unsigned default '0',`executiontime` mediumint(8) unsigned default '0',PRIMARY KEY (`date`,`ftpserver`)) TYPE=MyISAM;
DROP TABLE IF EXISTS `net2ftp_logConsumptionIpaddress`;
DROP TABLE IF EXISTS `net2ftp_log_consumption_ipaddress`;
CREATE TABLE `net2ftp_log_consumption_ipaddress`(`date` date NOT NULL default '0000-00-00',`ipaddress` varchar(15) NOT NULL default '0',`datatransfer` int(10) unsigned default '0',`executiontime` mediumint(8) unsigned default '0',PRIMARY KEY (`date`,`ipaddress`)) TYPE=MyISAM;
DROP TABLE IF EXISTS `net2ftp_users`;
CREATE TABLE `net2ftp_users` (`ftpserver` varchar(255) NOT NULL default '0',`username` text NOT NULL,`homedirectory` text NOT NULL,KEY `index1` (`ftpserver`,`username`(50))) TYPE=MyISAM;Next steps
- Important settings in settings.inc.php:
- Enter an Admin panel password. If no password is entered, the Admin panel is not accessible.
- Turn logging on or off (requires a MySQL database).
- Choose if you want to set a daily consumption limit to restrict eachuser's daily data transfer volume and script execution time (requires aMySQL database). By default the data transfer volume is set to 50 MBper day and the script execution time to 1500 seconds per day - butthis may be changed. Both figures are logged per IP address, and perFTP server. Once the daily consumption limit is reached, the user willstill be able to browse FTP servers, but the transfer of data to/fromthe server will be blocked.
- Set authorizations in settings_authorizations.inc.php:
- Allow the users to connect to any FTP server, or only to a restricted list of FTP servers
- Ban certain FTP servers
- Ban certain IP addresses; users connecting from these addresses will not be able to use the website
- Allow the users to connect to any FTP server port, or only to one port
- Set the user home directories in the table net2ftp_users (using phpMyAdmin). This will direct a user to his home directory when he logs in, and also restrict the browsing to this directory. The other actions (rename, copy, ...) are not protected!! If you need tighter security, set the user permissions directly on the FTP server.
- A list of banned keywords can be entered. Directories and files containing these keywords can't be processed. Files can't be renamed if the new filename contains a banned keyword. This is to avoid net2ftp being used to upload Paypal and Ebay scams.
- To allow large file uploads and transfers, you may have to change these settings:
- in the file php.ini (directory C:\windows or /etc): upload_max_filesize, post_max_size, max_execution_time, memory_limit
- in the file php.conf (directory /etc/httpd/conf.d): LimitRequestBody
- Protect the /temp directory. If you use the Apache web server, the .htaccess file which is provided already does this.
- In your php.ini file, register_globals can be set to "off" (thisis more secure), but the application will off course also work if it isset to "on".
- The files are transmitted using the BINARY mode by default. Thereis a list of file extensions (txt, php, ...) which are transmitted inASCII mode. Edit this list if needed, it is located in/includes/filesystem.inc.php. Look for function ftpAsciiBinary.