In-Depth Setup Details on the Example FTP Server
Although we will setup your FTP Server for free, the following information is provided for those that are adventurous. These are the fundamental steps involved in setting up our Example FTP Server:
|
|
The following step is required to create the directories for the FTP area.
|
Telnet to theearchitect.com using the master account
create directories
mkdir /home/theearchitect/www/eg
mkdir /home/theearchitect/www/eg/proj1
change permissions
chmod 777 proj1
|
You will need to use your domain name in place of theearchitect.com
A global directory for the FTP Server
Directory for example project #1
This changes the permissions so that others can write to the directory
|
|
The following step is required to create the FTP Users.
|
With a Web browser login to Monster Controls
( http://theearchitect.com/monstercontrols/ )
Choose User Accounts option
Add/Edit User Accounts option
Add New User Name: eg1
Account Type: telnet
Mailbox Limit: 1 MB
Account Password: eg1
Directory: eg
Add New User Name: eg2
Account Type: telnet
Mailbox Limit: 1 MB
Account Password: eg2
Directory: eg
|
Create telnet accounts so that it is possible to create the link file, create and remove directories, and set permissions later. Note that Telnet accounts are automatically FTP accounts as well.
|
|
The following steps are required to create the link file to the proj1 directory and to create a directory for each user.
|
Telnet to theearchitect.com using account eg1
rm www
ln -s /home/theearchitect/www/eg/proj1 proj1
cd proj1
mkdir eg1
|
Remove the link to directory eg
Install link to proj1 directory
Make eg1 directory for this user
|
Telnet to theearchitect.com using account eg2
rm www
ln -s /home/theearchitect/www/eg/proj1 proj1
cd proj1
mkdir eg2
|
Remove the link to directory eg
Install link to proj1 directory
Make eg2 directory for this user
|
|
The following steps are required to control access from a Web browser.
|
Create file .htaccess
AuthType Basic
AuthName "FTP Example Server"
AuthUserFile /www/theearchitect/eg/.htpasswd
Require validuser
|
The .htaccess file controls access by the Apache Web server from a browser. The file tells Apache that only valid users are allowed and that valid users are defined by the file .htpasswd
|
FTP to theearchitect using the master account
Copy .htaccess to /home/theearchitect/www/eg
|
This simply copies the above file to the directory being protected.
|
Telnet to theearchitect.com using the master account
cd to /home/theearchitect/www/eg
htpasswd -c .htpasswd eg1
password = eg1
htpasswd .htpasswd eg2
password = eg2
|
The htpasswd command created a password file.
Use the -c option the first time to create the .htpasswd file.
|
|
The following step is required to create an index.htm file for the base directory.
|
A link to the proj1 directory for the eg1 account would be:
ftp://eg1:eg1@theearchitect.com/home/eg1/proj1/
The html code would be:
<A HREF="ftp://eg1:eg1@theearchitect.com/home/eg1/proj1/">
User eg1</A>
|
Normally a directory without an index.htm (or similar file) is not available from a web browser. We will be glad to modify our example php program for you. If you want to create your own index.htm, you could use links similar to this.
|