Self Hosted Cloud Data Server

I'm developing an application for Mac/Linux/Windows and it requires the app accessing a document that I change periodically. Therefore I need to be able to reliably host the document on a server that the app can access each time it runs. (This isn't DRM by the way, it's update information) 

I am looking at trying to host the files on my own network so I can control the hardware, control the access, and know the file will maintain the same address. 

My question is what is the best to accomplish this task? I haven't done anything along these lines thus far.

What steps do I have to take?  
What hardware would you recommend?  
If I were to tie it to a particular domain how would that work?  

Thanks,
Benjamin

Interesting question.

So your making an app, where multiple instances of this application running in distributed places, basically calls home and updates a file with various information (like total downloads for example).

The issue I see here is that if two instances try and update the file at the same time. Eg client 1 opens the file with x data. at the same time client 2 opens the same file with x data. Client 1s data is processed first and thus the file is saved with y data. meanwhile client 2 then processes but as it loaded the file before client 1 had updated it, when client 2 saves, client 1s data will no longer have taken affect.

This is just an issue with operating with files. Maybe calling to an SQL database would be better as it is designed to handle communications from several feeds at once.

All you need really is a basic server. So nothing too insane. If you plan on continuing with the file operation route, you will require a basic file/samba server. The server doesn't have to be powerful as all it is doing is providing files when requested.

As for an SQL server, as long as it is decent (as the processing now takes place on the server) no problems will arise.

Obviously you only need a file server if the clients are just reading the file and not making any ammendments to it.

 

If this is an app designed to run within the network, you don't have to worry about Domain Names. As it will be internal and can be called via NETbios names or the Private IP.

If you are planning on running it in the wild, a domain is adviced. As giving a public IP can be disasterous. Plus if this is run on a non-static IP (aka if your ISP doesn't designate a set IP for the duration of your lease) updating a domain service is much easier than updating the app and redistributing it.

The domain name will need to be registered with obviously a domain name provider of some description. And just using a stealth pointer to redirect any traffic back to your IP where the server is sat.

 

Thanks for the reply! 

The app does not need to alter any files, only read files. I may add a functionality for that in the future.. but that is unlikely.  

How would I go about setting up a file server then? As I mentioned above, I don't know too much about networking.. However, don't let that discourage you from using networking terms, for I do know some terms, and if need be, I can look them up.

What kinds of software would I require? 

What kind of connection do you have? Do you have a fixed IP?

If you don't have a fixed IP, you have to create your own DNS server by using a server you have access to that has a fixed IP (that can be done for free, just use one of those free domain hosting services or a server of a befriended business or something, it's only for DNS, so noone should really care and there is no security risk). That will route the incoming connections to your variable IP. If you have a fixed IP, you don't have to do that, then your domain will be linked to your IP, or you'll know what your IP is at all times and can put that in the app.

Then you need to set up a DMZ that routes the calls for a particular port that you configure your app for and a particular alias to one particular box, which can be virtual, but when there are a lot of connections, that's not always the most economic solution, but you can definitely start with a VM. Then you need to decide on the protocol. That can be something simple like SFTP, which is probably not such a bad thing if it's only a simple data file that just needs protection from data corruption or MIM, but there are other solutions. Let's say you have to secure a DMZ, update your own DNS tables and provide an SFTP server, that can all be done on one machine that is used as a firewall, a router, and runs a VM with a minimal distro that provides a basic SFTP server. And that machine doesn't even have to be that powerful. I would take something lean and mean like Vector Linux or another Slackware based minimal setup on a recycled PC, anything less than 6 years old or so, so that it's easy to configure and you always have an overview of what's happening, less is more for servers. Then change the alias to rout the reporting to your mail address, so that you get all the important warnings per e-mail if something goes wrong, and you use a specific e-mail account for that (gmail also takes care of that for free).

There are also units that can act as a cloud FTP server, like from WD, and they provide a DNS service, so that even if you have a variable IP, your device will always be found. I don't know how secure these things are, because I don't have one and have never played with one, but they are not expensive, and if you have a decent router with flashable firmware or really good firmware, it will probably have a DMZ function also, that allows you to route the domain of your cloud-enabled device to only that device, and isolate it from the rest of your network. I just prefer things that can be custom configured because they make me feel safer, but it might well be that those devices are enough, depending on how much calls for the file at once there are, and whether you want instant reporting or not.

Well a file server can be achieved quite easily. There are several options for doing so. 

You can use a windows environment such as server 2003, 2008 r2 or 2012. http://www.youtube.com/watch?v=QsGPqkobCs8

Or within a linux distro of your choice with Samba. https://www.linux.com/learn/tutorials/296391:easy-samba-setup

Or use a FreeBSD based option like Nas4Free. http://wiki.nas4free.org/doku.php?id=documentation:setup_and_user_guide:ftp-file_transfer_protocol

Any of these will do the same thing, its just a different kernel in each OS which will affect stability. Like Nas4Free is nice, but is more of a NAS based solution. Linux is good and free as well and windows is the option to go (if you have the license) if you prefer working in the windows environment.

As for Authentication, you can leave the FTP open (anonymous FTP) which leaves it open to obviously some securtiy issues. Or use a login that is programmed into the app. Be sure to set the FTP server to read-only as well to stop unwante remote changes.

As for the router/gateway, you'll just need to make sure port 21 is open and pointed to wards the private IP of the FTP server.

I did not yet handle any cloud data server but because i am IT too and working in Helsinki at some IT palvelut or IT services i feel interested about some possible answer about your question and it seem that i really need to study now a lot of cloud server.