Help for administrators
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 the users. To create the tables, execute the SQL query in the file "create_tables.sql". This can easily be done in PhpMyAdmin, the popular front-end to MySQL.
Next steps
1) 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 (requires a MySQL database). Since version 0.81, it is possible to restrict each user's daily data transfer volume and script execution time. By default the data transfer volume is set to 50 MB per day and the script execution time to 1000 seconds per day - but this may be changed. Both figures are logged per IP address, and per FTP server. Once the daily consumption limit is reached, you will still be able to browse FTP servers, but the transfer of data to/from the server will be blocked. If you need unrestricted access to net2ftp, contact your net2ftp Administrator or install net2ftp on your own web server.
- 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. 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.
- 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
5) In your php.ini file, register_globals can be set to "off" (this is more secure), but the application will off course also work if it is set to "on".
6) The files are transmitted using the BINARY mode by default. There is a list of file extensions (txt, php, ...) which are transmitted in ASCII mode. Edit this list if needed, it is located in /includes/filesystem.inc.php. Look for function ftpAsciiBinary.
Integration of net2ftp in an existing website
General tips and tricks
The overall architecture of net2ftp has been completely reviewed in version 0.90, to allow easy integration of net2ftp in other web-based PHP applications. The index.php file is a school example of how to integrate net2ftp:- Set the constants NET2FTP_APPLICATION_ROOTDIR and NET2FTP_APPLICATION_ROOTDIR_URL
- Include the net2ftp file main.inc.php
- Execute 5 net2ftp() calls to send the HTTP headers, print the Javascript code, etc.
- Check if an error occured to print out an error message.
Linking directly to a particular net2ftp page
It is possible to direct users to a particular net2ftp page (browse a particular directory, upload page, ...). Log in, go to the page you want to link to, and click on the Bookmark button: . The next page will show you the link to use; this link does not contain any login information (username or password). When the users click on the link, they will be prompted for their login information by a popup window.Mambo, Drupal and Xoops modules
Ready-made net2ftp modules for Mambo, Drupal and Xoops are provided with net2ftp version 0.90! Detailed installation instructions are given in the readme.txt file in the respective directories. In all cases you'll first need to install the standalone version of net2ftp, and then install the Mambo, Drupal or Xoops module. Read the instructions carefully, as each step is important.Web-based control panels
net2ftp has been integrated in the following control panels:- Zpanel: http://www.thezpanel.com/
- Web-cp (as of version 0.6): http://www.web-cp.net/demo.php
Known bugs and limitations
If your web server runs on Windows
If you can log in but you cannot see any directory or file in the Browse Screen, then it is probably caused by a filesystem permission problem on your web server.Quote from the PHP bug report database:
ftp_rawlist requires write permissions to the system's tempoarary directory.
IIS's default installation does not include this in the permissions for IUSR.
The bug is in system configuration, not PHP.
This was discussed in the following PHP bug reports:
http://bugs.php.net/bug.php?id=8874
http://bugs.php.net/bug.php?id=13720
http://bugs.php.net/bug.php?id=16057