Location: PHPKode > projects > net2ftp > help_files/03-administrator.html
<html>
<head>
<title>net2ftp help</title>
<link rel="stylesheet" type="text/css" href="../skin1-blue.css">
</head>

<body style="margin-left: 70px; margin-right: 70px;">

<div class="header21">Requirements</div>
<ul>
<li> Web server: any web server which can run PHP. The most popular one is <a href="http://httpd.apache.org" target="_blank">Apache</a>.</li>
<li> <a href="http://www.php.net" target="_blank">PHP</a>: at least version 4.2.3. net2ftp works under <a href="http://www.php.net/manual/en/features.safe-mode.php" target="_blank">Safe Mode</a>.</li>
<li> Disk space: 5 MB for net2ftp (2 MB if you remove the plugins), and a few MB for the temporary files.</li>
</ul>

<div class="header21">Installation procedure</div>
<br />
1 - Unzip all the files on your computer, and upload them to your server.<br /><br />
2 - The /temp directory should be chmodded to 777 (you can use <a href="http://www.net2ftp.com">net2ftp.com</a> to do this).<br /><br />
3 - Set your settings in the settings.inc.php file. (Read "Next steps" below for more details.)<br /><br />
4 - A database is only required if you want to log the actions of the users. To create the tables, execute the SQL queries below (also in the "create_tables.sql" file). This can be done easily in <a href="http://www.phpmyadmin.net/" target="_blank">PhpMyAdmin</a>, the popular front-end to MySQL.<br />
<br />
<textarea cols="70" rows="8" wrap="off">


#
# Table structure for table `net2ftp_logAccess`
#

DROP TABLE IF EXISTS net2ftp_logAccess;
CREATE TABLE net2ftp_logAccess (
  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,
  ftpserver text NOT NULL,
  username text NOT NULL,
  state text NOT NULL,
  state2 text NOT NULL,
  directory text NOT NULL,
  file text NOT NULL,
  http_referer text NOT NULL,
  KEY index1 (date,time,ftpserver(100),username(50))
) TYPE=MyISAM;
# --------------------------------------------------------

#
# Table structure for table `net2ftp_logConsumptionFtpserver`
#

DROP TABLE IF EXISTS net2ftp_logConsumptionFtpserver;
CREATE TABLE net2ftp_logConsumptionFtpserver (
  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;
# --------------------------------------------------------

#
# Table structure for table `net2ftp_logConsumptionIpaddress`
#

DROP TABLE IF EXISTS net2ftp_logConsumptionIpaddress;
CREATE TABLE net2ftp_logConsumptionIpaddress (
  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;
# --------------------------------------------------------

#
# Table structure for table `net2ftp_logError`
#

DROP TABLE IF EXISTS net2ftp_logError;
CREATE TABLE net2ftp_logError (
  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;
# --------------------------------------------------------

#
# Table structure for table `net2ftp_logLogin`
#

DROP TABLE IF EXISTS net2ftp_logLogin;
CREATE TABLE net2ftp_logLogin (
  date date NOT NULL default '0000-00-00',
  time time NOT NULL default '00:00:00',
  ftpserver text NOT NULL,
  username 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;

</textarea><br />

<br /><br />

<div class="header21">Next steps</div>
<ul>
<li> Important settings in settings.inc.php:
	<ul>
	<li> Enter an Admin panel password. If no password is entered, the Admin panel is not accessible.</li>
	<li> Turn logging on or off (requires a MySQL database).</li>
	<li> 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.</li>
	</ul>
</li>
<li> Set authorizations in settings_authorizations.inc.php:
	<ul>
	<li> Allow the users to connect to any FTP server, or only to a restricted list of FTP servers</li>
	<li> Ban certain FTP servers</li>
	<li> Ban certain IP addresses; users connecting from these addresses will not be able to use the website</li>
	<li> Allow the users to connect to any FTP server port, or only to one port</li>
	<li> Set the default login directory -- this is not restrictive, users can get out of it</li>
	<li> Set the default root directory per user -- this is restrictive, users cannot get out of it when they are using net2ftp. However, this is not a secure method of restricting the access; it is much safer to set this on the FTP server itself</li>
	</ul>
</li>
<li> To allow large file uploads and transfers, you may have to change these settings:
	<ul>
	<li> in the file php.ini (directory C:\windows or /etc): upload_max_filesize, post_max_size, max_execution_time, memory_limit</li>
	<li> in the file php.conf (directory /etc/httpd/conf.d): LimitRequestBody</li>
	</ul>
</li>
<li> Protect the /temp and the /admin directories. If you use the Apache web server, use .htaccess and .htpasswd files to do this -- sample files are provided (username admin, password net2ftp).
	<ul>
	<li> .htaccess file: set the path to the .htpasswd file</li>
	<li> .htpasswd file: enter a list of usernames and encrypted passwords (the admin panel can be used to generate encrypted passwords)</li>
	</ul>
</li>
<li> 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".</li>
<li> 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.</li>
<li> When a file is edited in the textarea, and transferred using the ASCII mode, net2ftp replaces CR-LF by LF. This is because some FTP servers replace LF by CR-LF. This is done in file /includes/filesystem.inc.php, in the function ftp_writefile.  (CR = Carriage Return = ASCII character 13. LF = Line Feed = ASCII character 10.)</li>
</ul>

<br /><br />

<div class="header21">Integration of net2ftp in an existing website</div>

<div class="header31">Integrating the login form</div>

<br /><u>If your website runs PHP</u>: in your existing script, include the PHP file "net2ftp_loginform.inc.php" and use the function "net2ftp_loginform()" to print the net2ftp login form -- see the file example_login_page.php.
This will provide all functionality: the PHP function will read the net2ftp settings files and adjust the form automatically.
For example, if only a list of FTP servers are allowed, the FTP server textbox will be changed a dropdown box.

<br /><br />

<u>If your website does not run PHP</u>: simply copy the login form HTML -- see the file example_login_form.html.
This will provide basic client-side functionality: the login form + the Javascript function which checks if the username and password are entered.

<br /><br />

<div class="header31">Linking directly to a particular net2ftp page</div>

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: <img src="../images/actions/nuvola/bookmark.png" />.
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.

<br /><br />

<div class="header31">Integrating the other pages</div>

If you not only want to integrate the login form, but also all the other pages, you will have to change the code in html.inc.php.
This is where the HTML start and end output is generated: header, link to stylesheets, ...

<br /><br />

<div class="header21">net2ftp in other applications</div>

<div class="header31">Xoops</div>

net2ftp version 0.80 has been ported to Xoops.
<ul>
	<li> Thread on the Xoops forum: <a href="http://www.xoops.org/modules/newbb/viewtopic.php?topic_id=22708&forum=29">http://www.xoops.org/modules/newbb/viewtopic.php?topic_id=22708&forum=29</a></li>
	<li> Download page: <a href="http://www.bassmanthemes.x8r.com/modules/mydownloads/">http://www.bassmanthemes.x8r.com/modules/mydownloads/</a></li>
</ul>

<br /><br />

<div class="header31">Mambo</div>

net2ftp Mambo component: <a href="http://mamboforge.net/projects/com-net2ftp/">http://mamboforge.net/projects/com-net2ftp/</a>.

<br /><br />

<div class="header31">Web-based control panels</div>

<ul>
	<li> Zpanel: <a href="http://www.thezpanel.com/">http://www.thezpanel.com/</a></li>
	<li> Web-cp (as of version 0.6): <a href="http://www.web-cp.net/demo.php">http://www.web-cp.net/demo.php</a></li>
</ul>

<br /><br />

<div class="header21">Known bugs and limitations</div>

<ul>

<li> There is a bug in the PHP FTP function ftp_get() which causes end-of-line characters to be wrongly translated.
As a result, \r\n becomes \r on Windows when using the ASCII mode.
There is a workaround: on the net2ftp login screen, the BINARY mode is chosen by default.
Refer to <a href="http://bugs.php.net/bug.php?id=27633">http://bugs.php.net/bug.php?id=27633</a> for more details.
<br />UPDATE 2004-12-13: A patch has been posted for this bug on the PHP internals mailing list. 
</li>

<li> 
You've entered a username/password in settings.inc.php. When you want to access the Admin panel, a popup asks you for your username/password. 
Even if you fill something in, the popup keeps coming a few times, and then you get an error message.
<br /><br />
This problems only occurs if PHP is run as CGI module; it does not occur when PHP is run as Apache module. 
Technically speaking, for some reason **outside of net2ftp**, the $_SERVER['PHP_AUTH_USER'] and $_ENV['REMOTE_USER'] variables are not filled in.
<br /><br />
There is a workaround: create a .htaccess file in the /net2ftp directory with the following code<br /><br />
<textarea cols="60" rows="5">
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]
</IfModule>
</textarea><br /><br />
This will ensure that another variable ($HTTP_AUTHORIZATION) would be filled in.
If this workaround doesn't work for you, there is nothing else that can be done within net2ftp.
</li>

<li> Symlinks are not yet handled well. 
Currently, they are displayed on the Browse Screen, but you can't do anything with it except clicking on the name.
If the symlink points to a directory, you will be directed to that directory -- but if it points to a file, net2ftp will redirect you to the root directory of the FTP server...
</li>

<li> The root directory authorizations can currently only be set per user -- not per user and FTP server.
This limitation will be solved in one of the next versions.
</li>

</ul>

<div class="header21">Notes regarding Windows servers</div>

<div class="header31">IF YOUR WEB SERVER RUNS ON WINDOWS</div>
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.<br /><br />

<u>Quote from the PHP bug report database:</u><br />
<i>
ftp_rawlist requires write permissions to the system's tempoarary directory. <br />
IIS's default installation does not include this in the permissions for IUSR.<br /> 
The bug is in system configuration, not PHP.<br />
</i><br />

This was discussed in the following PHP bug reports:<br />
<a href="http://bugs.php.net/bug.php?id=8874"  target="_blank">http://bugs.php.net/bug.php?id=8874</a><br />
<a href="http://bugs.php.net/bug.php?id=13720" target="_blank">http://bugs.php.net/bug.php?id=13720</a><br />
<a href="http://bugs.php.net/bug.php?id=16057" target="_blank">http://bugs.php.net/bug.php?id=16057</a><br /><br />

<div class="header31">IF YOUR FTP SERVER IS THE IIS FTP SERVER</div>
In the FTP server's configuration, set it for UNIX style directory listings rather than MSDOS style listings.

<br /><br />

<div class="header21">Beta functions</div>

Beta functions can be turned on or off in settings.inc.php. 
This is to be able to give you a feeling of where the development is going, without putting live production environments at risk.
If you want to join the development team, read the <a href="04-developer.html">Developer</a> section.
<br /><br /><br /><br />

</body>
</html>
Return current item: net2ftp