0

Apologize if this particular problem has been answered already (a search didn't turn anything directly relevant up).

We are developers of a web app that is used to provide community commenting and "social" to our partners websites. Our app uses Javascript and HTML on the front end, PHP and mySQL on the back.

Currently we are running everything through our own servers, which is getting very expensive.

We would like to ask our partners if we can host the app through their servers, with them getting a discount to our monthly charge due to the bandwidth/cpu load they would help us share.

My question is, is there a way to host our app through our partner's web servers in such a way that we can offload most of the CPU time and bandwidth without exposing our source code?

I would greatly appreciate any ideas/help!!

Thank you very much all!

Mavorus
  • 119
  • 1
  • 2
  • 13
  • 1
    Encrypt php source: [Take a look in this posting][1] [1]: http://stackoverflow.com/questions/470409/can-i-encrypt-php-source-or-compile-it-so-others-cant-see-it-and-how – donald123 Jul 05 '12 at 09:11
  • possible duplicate of [Which is the best way to hide the PHP source code?](http://stackoverflow.com/questions/3777500/which-is-the-best-way-to-hide-the-php-source-code) – JJJ Jul 05 '12 at 09:12
  • 1
    If you can't trust the partner that much, I suggest you start looking for a new one. – JJJ Jul 05 '12 at 09:13

2 Answers2

2

If you also serve static or rarely changing content your clients could run a caching reverse proxy to remove some load from your servers without giving them any source code at all. But you need to implement caching headers for this to work properly.

You may want to look into nginx.

On second thought: Did you try to compile your scripts using facebooks Hip-Hop for PHP? First of all the script should perform way better, second of all, if you still had to outsource the hosting, you deploy a compiled program, no source code involved.

haggi
  • 461
  • 3
  • 5
  • Thanks for the comment haggi.. this sounds like a great solution to get rid of a large portion of the bandwidth problem.. CPU load will be equal or greater though, no? – Mavorus Jul 06 '12 at 00:00
  • Looking into Hip-Hop for php... a compiled solution sounds like a great idea. In that case they might be able to reverse engineer the binaries of course, but it would be difficult and probably not very cost-effective.. Awesome haggi! – Mavorus Jul 06 '12 at 00:03
  • Welcome :) In my experience the CPU load should also go down a little bit with reverse proxying. It really depends on how dynamic your content really is. – haggi Jul 06 '12 at 09:34
2

If you put the code on their server they can find out. So that won't be 100% working. Though you can make it difficult but it's still not great.

Most doable solution might be to separate parts of the application and share them. So: You give away a process (so source and other needed data) but it's only part of the total. That way no partner has your total solution but you do outsource the parts.

Luc Franken
  • 2,994
  • 1
  • 17
  • 14
  • This is a good idea as well.. looking into it. Thanks very much Luc! Will update this post after talking with our other devs. – Mavorus Jul 05 '12 at 23:59
  • You're welcome. You might think for example about: static assets hostings (could be even user-generated or uploaded). Processing of complex transactions/calculations. A step further if needed could be even parts of the database, generating views on them. Be cautious when doing this about your privacy policy and other legal issues which might arise. Your environment gets more complex, think about it before you start doing this so you are sure it is really an improvement. Complexity also comes at a cost. – Luc Franken Jul 06 '12 at 07:10