How do I set up a file server on a PC
May 3, 2007 3:44 PM   RSS feed for this thread Subscribe

How do I set up a file server on a PC w/ dynamicIP and a client web GUI?

I'd like like to set up a server on my PC with the following features and considerations in mind:

-Can be accessed by clients from a browser via http so I can use no-ip.com's redirect service since I have a dynamic IP. This service doesn't seem to work w/ FTP addresses.

-Has a nice GUI that allows for clients to full download directories in the hierarchy. Something similiar to net2ftp.com's interface would be nice.

-Allows for different users and groups w/ different privileges



I currently have bulletproof FTP server running, and since I already have it configured w/ all the accounts I tried to set this up as per above in the following manner: Run Mbedthis AppWeb web server to run a local instance of net2ftp client which I downloaded from their site. This would then make a local connection to bulletproof and then I'd have all of the above. Turns out this is very difficult for me. I have about 4 credits introductory java experience and years of informal computer tinkering under my belt, but basically no programing/html skills.

So after hours of trying to get this to work, I've made a little progress but I'm stuck now. So I'm either looking for a single program that can do all this out of the box or some instructions on how make the no-ip>appweb>local net2ftp>bulletproof thing work.

Thanks!
posted by Popcorn to computers & internet (21 comments total) 1 user marked this as a favorite
This sounds more complicated than it needs to be. How about a standard web server (Apache or IIS) with WebDAV enabled? People could use standard WebDAV clients to interact with your files through HTTP. Windows has WebDAV client functionality included in the Explorer shell, for example.
posted by me & my monkey at 4:09 PM on May 3, 2007


I see no reason for your FTP to not work with a dynamic dns service (I've certainly had it working before using dyndns.org). Are you sure you have the right port-forwarding arrangement on your firewall?

As for the nice gui for d/l-ing whole directories... I'd just use Apache, displaying directories, and leave it up to the client, but that's not really answering your requirement.

For different users and priveleges, .htaccess is your friend (though this may be invalid if you're using Windows, which you haven't indicated).
posted by pompomtom at 4:16 PM on May 3, 2007


Thanks for the tips, Me and My Monkey , but I must say most of the stuff you're saying is over my head. My use of acronyms may have misled you into thinking I know more than I do. If I'm going to use any other software aside from BPFTP, It really needs to be an out of the box thing with minimal configuration. I dont even understand all the jargon in the Mbedthis AppWeb user manual and I was essentially shooting blind when I was editing the config txt files.

Pompomtom, I forgot to indicate that I'm using XP home, I guess that is pretty relevant here. As w/ Monkey above, you're kinda scaring me with the Apache talk. The dyndns thing looks promising, though I probably should have mentioned that I'm looking for a free redirect service. Do you know if their WebHop Free web redirection thing has the ability to track my IP changes and redirect people form me.dyndns.com to ftp://me despite any IP changes?

Thanks for the info and sorry about my omitions in the OP.
posted by Popcorn at 5:08 PM on May 3, 2007


I should also add that, while I do require a free redirect service, I am fine with buying some new software provided it is easy to configure and has all the above features.
posted by Popcorn at 5:11 PM on May 3, 2007


dyndns.org do free redirects.

I'm guessing your FTP issue is with your firewall(s).
posted by pompomtom at 5:32 PM on May 3, 2007


If you could figure out how to set up BPFTP, you can figure out how to use Apache, I think. Don't be scared! Apache is easy to install on Windows. It's not quite as easy to configure, but there's copious documentation on how to do it. Basically, you have to edit a single text file (httpd.conf), and change a few lines within that file.

Web redirection services aren't going to redirect HTTP requests to FTP servers, I don't think. Also, FTP can be problematic for people to get to.
posted by me & my monkey at 6:59 PM on May 3, 2007


I havn't had any firewall problems yet, BPFTP worked fine alone WRT the firewall. With my attempt above, I'm able to get into my web server via anonymouse.org's proxy so it seems that the firewall is allowing external traffc to reach the local webserver (is that whay you call it?).

Where this opperation grinds to a halt, is when it hits this redirect page that I made. The only way I could figure to do this was to start with the default config on web server. This makes it so when you go to my IP you get a sample page that says "welcome to the sample page". I found this page in windows explorer, opened it in wordpad and replaced all the text with this code that I copied from the source of some web page:

(I deleted all the < 's so it would appear in the post)br>

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
html>
head>
title>Redirecting...
meta http-equiv="REFRESH" content="0;url=http://localhost/index.php">
BODY>
Redirecting...
/BODY>
/HTML>

Index.php is the file that seems to get the local instance of net2ftp moving. To install n2ftp I had to copy a bunch of files to the root directory of the local server. This is the same location as the index.html file that I converted to a redirect.

Long story short, I'm sure this is all really sloppy webdesign but it works locally in the following manner:

me.no-ip.com>index.html (redirect)>index.php (launches local net2ftp client)>login to bpftp via net2ftp no problem

When I do it through the proxy:
anonymouse>me.no-ip.com>index.html (redirect)>file not found

So, I think what is happening is that it is this config makes the client look for index.php on their computer, not mine. So what do I put in the redirect URL to make it go to my index.php (or just make the server make index.php the start page instead)?

Then, after that is sorted, I have to figure out how to get the net2ftp client to communicate w/ BPFTP locally, since if net2ftp communicates w/ BPFTP over the internet, that would defeat the purpose of the no-ip.com redirect.

The code below seems to be the relevant portion of the net2ftp config file. As you can see it is currently set to "localhost" I've also tried to do it with the 192... option but I changed that to 127.0.0.1 because it looked familar (I think this is what google desktop search use.)



// ----------------------------------------------------------------------------------
// Allowed FTP servers
// Either set it to ALL, or else provide a list of allowed servers
// This will automatically change the layout of the login page:
// - if ALL is entered, then the FTP server input field will be free text
// - if only 1 entry is entered, then the FTP server input field will not be shown
// - if more than 1 entry is entered, then the FTP server will have to be chosen from a drop-down list
// ----------------------------------------------------------------------------------

//$net2ftp_settings["allowed_ftpservers"][1] = "ALL";
$net2ftp_settings["allowed_ftpservers"][1] = "localhost";
//$net2ftp_settings["allowed_ftpservers"][2] = "192.168.1.1";
//$net2ftp_settings["allowed_ftpservers"][3] = "ftp.mydomain2.org";
posted by Popcorn at 7:19 PM on May 3, 2007


I havn't had any firewall problems yet

Right, but other people may not be able to access your FTP server from within their own firewalls, due to the way that FTP works. Typically, to solve that problem, you'd need to configure your FTP server to use passive mode (described in the previous link) and open additional firewall ports on your end. I just did this about two days ago with BPFTP, oddly enough.

meta http-equiv="REFRESH" content="0;url=http://localhost/index.php"

As I think you've figured out, this tells the client to request a URL on their own server rather than yours. You'd replace "localhost" with the fully-qualified name of your server (whatever you're setting in no-ip.com)

Then, after that is sorted, I have to figure out how to get the net2ftp client to communicate w/ BPFTP locally, since if net2ftp communicates w/ BPFTP over the internet, that would defeat the purpose of the no-ip.com redirect.

If both net2ftp and BPFTP are on your own machine, you can use 127.0.0.1 (your loopback IP address, which always points to your own machine) or localhost (the name that corresponds to your loopback IP address).

I still think this is way more complicated than setting up Apache and WebDAV, though.
posted by me & my monkey at 7:45 PM on May 3, 2007


Actually, I'm a little confused at this point. If net2ftp is acting as a proxy - people are only connecting to that - you shouldn't have to open FTP access to the outside world at all. If, on the other hand, net2ftp is sending a message back to the client's machine telling it to go to your FTP server, you will need to open the ports for FTP.
posted by me & my monkey at 7:47 PM on May 3, 2007


"If you could figure out how to set up BPFTP, you can figure out how to use Apache, I think. Don't be scared!"

Thats good to know, I thought it was more menacing. I would still prefer to make the existing attempt work in the interest of saving time.
posted by Popcorn at 7:50 PM on May 3, 2007


So I switched the redirect to point to the no-ip address and now people on the outside can get to the net2ftp login screen.

I changed the "allowed FTP servers" setting as follows:

//$net2ftp_settings["allowed_ftpservers"][1] = "ALL";
//$net2ftp_settings["allowed_ftpservers"][1] = "localhost";
//$net2ftp_settings["allowed_ftpservers"][2] = "192.168.1.1";
//$net2ftp_settings["allowed_ftpservers"][3] = "ftp.mydomain2.org";
$net2ftp_settings["allowed_ftpservers"][2] = "127.0.0.1";

With this setup (and with :21 appended to the 127..., same goes for ftp:// prepended), after you present credentials and hit login, you are asked if you want to download index.php. This looks to me like net2ftp is opening up appweb server and getting redirected to index.php. So it's getting confused b/c there are 2 servers at 1 IP

Also, in the same file, I tried to ban 127...:80 and seperatly, set it to allow only port 21 as opposed to all. I was thinking that it asked my computer for a server and it returned the http one so I figured these measures would make it ignore the http server and find the ftp. To no avail, same result: Client has the oppertunity to download index.php.

I'm confused. I've attached a bit more of the n2tp config file in case there is more relavant stuff that I'm missing.

I am one step closer though. Any ideas on how to get n2ftp to see BP instead of appweb?



< ?phpbr>
// -------------------------------------------------------------------------------
// | net2ftp: a web based FTP client |
// | Copyright (c) 2003-2007 by David Gartner -------------------------------------------------------------------------------
// | |
// | Enter your settings and preferences below. |
// | |
// | The structure of each line is like this: |
// | $net2ftp_settings["setting_name"] = "setting_value"; |
// | |
// | BE CAREFUL WHEN EDITING THE FILE: ONLY EDIT THE setting_value, AND DO NOT |
// | ERASE THE " OR THE ; CHARACTERS. |
// -------------------------------------------------------------------------------


// ----------------------------------------------------------------------------------
// Check the authorizations?
// Set to yes or no.
// ----------------------------------------------------------------------------------
$net2ftp_settings["check_authorization"] = "yes";


// ----------------------------------------------------------------------------------
// Allowed FTP servers
// Either set it to ALL, or else provide a list of allowed servers
// This will automatically change the layout of the login page:
// - if ALL is entered, then the FTP server input field will be free text
// - if only 1 entry is entered, then the FTP server input field will not be shown
// - if more than 1 entry is entered, then the FTP server will have to be chosen from a drop-down list
// ----------------------------------------------------------------------------------

//$net2ftp_settings["allowed_ftpservers"][1] = "ALL";
//$net2ftp_settings["allowed_ftpservers"][1] = "localhost";
//$net2ftp_settings["allowed_ftpservers"][2] = "192.168.1.1";
//$net2ftp_settings["allowed_ftpservers"][3] = "ftp.mydomain2.org";
$net2ftp_settings["allowed_ftpservers"][2] = "ftp://127.0.0.1:21";



// ----------------------------------------------------------------------------------
// Banned FTP servers
// Set the first entry to NONE, or enter a list of banned servers
// ----------------------------------------------------------------------------------

$net2ftp_settings["banned_ftpservers"][1] = "NONE";
//$net2ftp_settings["banned_ftpservers"][1] = "192.168.1.1";
//$net2ftp_settings["banned_ftpservers"][2] = "192.168.1.2";
//$net2ftp_settings["banned_ftpservers"][3] = "192.168.1.3";


// ----------------------------------------------------------------------------------
// Banned IP addresses
// Set the first entry to NONE, or enter a list of banned IP addresses
// ----------------------------------------------------------------------------------

$net2ftp_settings["banned_addresses"][1] = "NONE";
//$net2ftp_settings["banned_addresses"][1] = "192.168.1.1";
//$net2ftp_settings["banned_addresses"][2] = "192.168.1.2";
//$net2ftp_settings["banned_addresses"][3] = "192.168.1.3";
$net2ftp_settings["banned_addresses"][3] = "127.0.0.1:80";


// ----------------------------------------------------------------------------------
// Allowed FTP server port
// Set it either to ALL, or to a fixed number
// ----------------------------------------------------------------------------------

$net2ftp_settings["allowed_ftpserverport"] = "ALL";
//$net2ftp_settings["allowed_ftpserverport"] = "21";


// ----------------------------------------------------------------------------------
// Banned directory and filename keywords
// Set the first entry to NONE, or enter a list of banned keywords
// ----------------------------------------------------------------------------------

//$net2ftp_settings["banned_keywords"][1] = "NONE";
$net2ftp_settings["banned_keywords"][1] = "paypal";
$net2ftp_settings["banned_keywords"][2] = "ebay";
$net2ftp_settings["banned_keywords"][3] = "wachoviabank";
$net2ftp_settings["banned_keywords"][4] = "wellsfargo";
$net2ftp_settings["banned_keywords"][5] = "bankwest";
$net2ftp_settings["banned_keywords"][6] = "hsbc";
$net2ftp_settings["banned_keywords"][7] = "halifax-online";
$net2ftp_settings["banned_keywords"][8] = "lloydstsb";
$net2ftp_settings["banned_keywords"][9] = "egg.com";
posted by Popcorn at 8:25 PM on May 3, 2007


Also, is there anything I can do in BPFTP to make it reside at a different local IP that isn't mapped to the http server?
posted by Popcorn at 8:35 PM on May 3, 2007


I would still prefer to make the existing attempt work in the interest of saving time.

Honestly, I think it'll take longer than using Apache would, but I understand how you feel.

Any ideas on how to get n2ftp to see BP instead of appweb?

This might be a silly question, but is your web server configured to run PHP scripts? If it's not, that would explain why you're just getting prompted to download index.php.

Also, is there anything I can do in BPFTP to make it reside at a different local IP that isn't mapped to the http server?

The short answer is, probably not. You can bind multiple IP addresses to your machine, which would allow you to run different services on different addresses, but you're presumably only getting one public IP address from your network provider, so no one would be able to get to the other address unless you set up firewall rules to map both internal addresses to a single external address, which wouldn't accomplish anything for you. In any case, you don't need two IP addresses, because the external world will only be able to talk to your web server running net2ftp, which will talk directly to the FTP server for them. At least, that's my understanding about net2ftp; I've never used it.
posted by me & my monkey at 7:48 AM on May 4, 2007


This might be a silly question, but is your web server configured to run PHP scripts? If it's not, that would explain why you're just getting prompted to download index.php.

Doesn't the fact that this whole thing works when I access the server locally mean that appweb is configured to run php scripts?
posted by Popcorn at 2:25 PM on May 4, 2007


I would think so.

I just noticed something odd about your net2ftp config file:

//$net2ftp_settings["allowed_ftpservers"][1] = "ALL";
//$net2ftp_settings["allowed_ftpservers"][1] = "localhost";
//$net2ftp_settings["allowed_ftpservers"][2] = "192.168.1.1";
//$net2ftp_settings["allowed_ftpservers"][3] = "ftp.mydomain2.org";
$net2ftp_settings["allowed_ftpservers"][2] = "ftp://127.0.0.1:21";

The enabled line has a URL, while the other lines simply have hostnames or IP addresses. I don't know why that would cause a problem remotely but not locally, but I have no experience with appweb or net2ftp.
posted by me & my monkey at 3:03 PM on May 4, 2007


//$net2ftp_settings["allowed_ftpservers"][1] = "ALL";
//$net2ftp_settings["allowed_ftpservers"][1] = "localhost";
//$net2ftp_settings["allowed_ftpservers"][2] = "192.168.1.1";
//$net2ftp_settings["allowed_ftpservers"][3] = "ftp.mydomain2.org";
$net2ftp_settings["allowed_ftpservers"][2] = "127.0.0.1";

With this setup (and with :21 appended to the 127..., same goes for ftp:// prepended), after you present credentials and hit login, you are asked if you want to download index.php. This looks to me like net2ftp is opening up appweb server and getting redirected to index.php. So it's getting confused b/c there are 2 servers at 1 IP


As I mentioned above, this doesn't seem to matter.


Somthing else I noticed is that, when this multiserver clusterfuck is accessed from the outside, BPFTP is talking to the Net2ftp locally. Here's the the log from bpftp. It seems like net2ftp almost gets to the directorylist and then decides that it rather just give me a PHP file:

(000070) 5/4/2007 4:31:29 PM - (not logged in) (my.ip.add.ress) > connected to ip : my.ip.add.ress
(000070) 5/4/2007 4:31:29 PM - (not logged in) (my.ip.add.ress) > sending welcome message.
(000070) 5/4/2007 4:31:29 PM - (not logged in) (my.ip.add.ress) > 220 Max's FTP
(000070) 5/4/2007 4:31:29 PM - (not logged in) (my.ip.add.ress) > USER sweettits
(000070) 5/4/2007 4:31:29 PM - (not logged in) (my.ip.add.ress) > 331 Password required for sweettits.
(000070) 5/4/2007 4:31:29 PM - (not logged in) (my.ip.add.ress) > PASS ********
(000070) 5/4/2007 4:31:29 PM - Sweettits (my.ip.add.ress) > logged in.
(000070) 5/4/2007 4:31:29 PM - Sweettits (my.ip.add.ress) > 230 User Sweettits logged in.
(000070) 5/4/2007 4:31:29 PM - Sweettits (my.ip.add.ress) > CWD
(000070) 5/4/2007 4:31:29 PM - Sweettits (my.ip.add.ress) > asked to change directory : 'D:\files\ -> D:\files\' --> Access allowed.
(000070) 5/4/2007 4:31:29 PM - Sweettits (my.ip.add.ress) > 250 CWD command successful. "/" is current directory.
(000070) 5/4/2007 4:31:29 PM - Sweettits (my.ip.add.ress) > PWD
(000070) 5/4/2007 4:31:29 PM - Sweettits (my.ip.add.ress) > 257 "/" is current directory.
(000070) 5/4/2007 4:31:29 PM - Sweettits (my.ip.add.ress) > PORT my,ip,add,ress,17,100
(000070) 5/4/2007 4:31:29 PM - Sweettits (my.ip.add.ress) > 200 Port command successful.
(000070) 5/4/2007 4:31:29 PM - Sweettits (my.ip.add.ress) > LIST -a
(000070) 5/4/2007 4:31:29 PM - Sweettits (my.ip.add.ress) > 150 Opening data connection for directory list.
(000070) 5/4/2007 4:31:29 PM - Sweettits (my.ip.add.ress) > 226 Transfer ok
(000070) 5/4/2007 4:31:29 PM - Sweettits (my.ip.add.ress) > QUIT
(000070) 5/4/2007 4:31:29 PM - Sweettits (my.ip.add.ress) > 221 Bye bye ...
(000070) 5/4/2007 4:31:29 PM - Sweettits (my.ip.add.ress) > disconnected. (00:00:00)


This is driving me nuts! So close but yet so far away! Thanks again for slogging through this with me!
posted by Popcorn at 3:42 PM on May 4, 2007


It seems like net2ftp almost gets to the directorylist and then decides that it rather just give me a PHP file

Can you get PHP to log errors, then see what shows up in the log?
posted by me & my monkey at 4:27 PM on May 4, 2007


Is this the PHP log below?
Also, there is a text file in the server temp directory that says the following:
"Don't forget to chmod this directory to 777 (all permissions)."
I've not done this b/c I dont know what it means. Is this relevant?



LOG:
default:2 main Configuration for Mbedthis AppWeb
default:2 main --------------------------------------------
default:2 main Host: computer
default:2 main CPU: i386
default:2 main OS: WIN
default:2 main Version: 2.1.0.2
default:2 main BuildType: RELEASE
default:2 main Started at: Fri May 04 17:51:50 2007
default:2 main Log rotation count: 0
default:2 main --------------------------------------------
default:2 main Set log level for all modules to 2
default:2 main Document Root for Main Server:
"C:/appWeb/web"
default:2 main Module search path:
"./bin ../bin ../bin/Debug ../bin/Release"
default:2 main Activating module (Loadable) auth
default:2 main Activating module (Loadable) cgi
default:2 main Activating module (Loadable) dir
default:2 main Activating module (Loadable) egi
default:2 main Activating module (Loadable) esp
default:2 main Activating module (Builtin) dir
default:2 main Activating module (Loadable) put
default:2 main Activating module (Loadable) php5
default:2 main Activating module (Loadable) ssl
default:2 main Activating module (Loadable) openSsl
default:2 main Activating module (Loadable) copy
default:2 main Activating module (Loadable) upload
default:2 main Add authHandler
default:2 main Add dirHandler
default:2 main Add putHandler
default:2 main Add egiHandler for ".egi"
default:2 main Add cgiHandler for ".cgi .cgi-nph .bat .cmd .pl .py"
default:2 main Add espHandler for ".esp .asp"
default:2 main Add php5Handler for ".php"
default:2 main Add copyHandler
default:2 main Add uploadHandler
upload:2 main Upload directory: c:/tmp
default:2 main Add copyHandler
default:2 main Document Root for 127.0.0.1:4443:
"C:/appWeb/web"
httpServer:2 main ServerName set to: my.ip.add.ress
default:2 main Starting host named: my.ip.add.ress
default:2 main Starting host named: 127.0.0.1:4443
default:2 main Listening for HTTP on my.ip.add.ress:80
default:2 main Listening for HTTP on 127.0.0.1:80
default:2 main Listening for HTTPS on my.ip.add.ress:4443
default:2 main Listening for HTTPS on 127.0.0.1:4443
default:2 main HTTP services are ready with 4 pool threads
default:2 main MPR: instructed to terminate
default:2 main Stopping HTTP services.
default:2 main Stopping MPR services.
default:2 main MPR: instructed to terminate
default:2 main Unloaded all modules

- End -
posted by Popcorn at 4:58 PM on May 4, 2007


Is this the PHP log below?

No, that's appweb's log. You'll have to enable PHP logging, and tell it where to put its log file, I think - I'm not a PHP developer. The link I posted previously should explain how to do this.

Also, there is a text file in the server temp directory that says the following:
"Don't forget to chmod this directory to 777 (all permissions)."
I've not done this b/c I dont know what it means. Is this relevant?


It's not relevant, since you're running on Windows; it's a Unix command. If you haven't customized permissions on Windows, the directory in question will be available to everyone in all likelihood.
posted by me & my monkey at 9:11 PM on May 4, 2007


It seems to be working fine now, the proxy doesn't work. But when I had someone actually try to access it remotely, it worked fine. Thanks for all the help!
posted by Popcorn at 3:10 AM on May 5, 2007


A bit of follow up for those that may come across this thread.

One of the main reasons I used the net2ftp on an http server in the first place was b/c I thought no-ip couldn't redirect to ftp as it only would let me add an IP as the redirect address, not a URL. So when I'd go to me.noip.com, it would, by default send me to http://my.ip.add.ress.

It turns out that if you type ftp://me.no-ip.com you get sent to ftp://my.ip.add.ress.

I'm kicking myself a bit, but I did learn a lot about the difference between a URL and an Domain.
posted by Popcorn at 12:54 AM on May 6, 2007


« Older Is there any truth to the myth...   |   I wish to move to a new positi... Newer »
This thread is closed to new comments.