0

My current setup

I am managing a download site where some files could be over 2 GB. I am using a plugin to forbid the download directory for user and serve files from another url. For example:

If files are located on example.com/files/file1.zip users download it from the url of example.com/download/5.

In my plugin i use a file path like /var/www/example.com/file/file1.zip

My main site is a Linode VPS with a small HDD space. And i am running out of space.

What i want

I want to buy at least 1 TB HDD dedicated server and only use it as a file storage/server.

But in my current setup how can i do that?

  • How can i keep my current setup?

  • How can i use the bandwidth of the second server and save the first one?

  • How will i link my files from main server in my plugin since they will be in remote location? (I am using the local path now, you can see above)

  • How will i protect the files on the second server?

  • Do i need to buy new domain name for secondary server to reach it or using just the IP address is fine?

  • 1
    Why not just use Amazon S3 or Google Cloud storage with signed, time expiring signed URLs? – EEAA Oct 21 '16 at 02:27
  • 2
    Honestly it sounds like you're well out of your depth here if you're asking questions like this. Perhaps consider hiring someone for an hour or two to help get you set out in the right direction. – EEAA Oct 21 '16 at 02:27
  • I think they will cost too much. Currently i have 20 GB of files and i see 150 GB of download monthly at least. When i have 1 TB of files how much it will be? With dedicated server on 1 TB i can get away with 9 Euro for month. But with Google Cloud Storage i don't know. – random373839 Oct 21 '16 at 02:31
  • Google Cloud Storage and Amazon Web Services both have very clear pricing pages for you to calculate this with. – ceejayoz Oct 21 '16 at 02:32
  • 1
    Well, either you need to expertise to manage a complex, multi-server application or you need the money to use something like S3. – EEAA Oct 21 '16 at 02:32
  • Or just mount the DocumentRoot via NFS.. – Orphans Oct 21 '16 at 06:11
  • Wouldn't it be very slow then? Servers are in different countries. – random373839 Oct 21 '16 at 06:29

1 Answers1

0

How can i keep my current setup?

Not sure what you mean by this. You're not keeping your current setup. You're changing it from a very simplistic single-server environment to a multi-server, multi-domain environment.

How can i use the bandwidth of the second server and save the first one?

Perhaps obviously, you serve the files directly to the client from the second server.

How will i link my files from main server in my plugin since they will be in remote location? (I am using the local path now, you can see above)

You modify your plugin to serve your clients the proper URL for the files, on the second server.

How will i protect the files on the second server?

You'll need to either have some sort of federated authentication mechanism between servers, or use dynamically-generated, time expiring, signed URLs.

Do i need to buy new domain name for secondary server to reach it or using just the IP address is fine?

You can use a subdomain.

Honestly, though. Just use Amazon S3 or Google Cloud storage. Put your data up there, then modify your application to issue signed URLs for the large files. Doing so will not only be much more reliable and high-performing, but there's also the very large benefit of you not needing to maintain two servers.

EEAA
  • 109,904
  • Modifying my plugin to serve the proper files on the second server it somewhat complicated because it can not give it remote urls to serve. It should a local path. In this situation maybe i need to mount the second server. In that situation though, i guess i will spend both bandwiths of the servers and – random373839 Oct 21 '16 at 02:51
  • will suffer speed lost. (one server is in France and the other is in England) – random373839 Oct 21 '16 at 02:52
  • Yes, you'll be charged outbound bandwidth for both servers. And the application will perform horribly. – EEAA Oct 21 '16 at 02:52
  • I've looked to the Google Cloud Storage and currently it is very pricey for me. Especially when i am not getting even a 0.01 cent from my site. I guess i will look for another plugin or will find a way to manually configure it. – random373839 Oct 21 '16 at 03:30