Today I'm hosting a Laravel v4 web application on a MacMini. Why a Mac? Because I created the application logic in Objective-C (leveraging my experience with iOS dev). Whether or not this was the right choice isn't the point of the question.
What I'm interested in knowing is how can I separate my web and application server. For instance, if I put my web server on Linode (or whatever) how do I go about communicating back and forth between the web server and the application server? Is there some sort of resource I can look to to understand how to do this?
Here's some assumptions I'm making:
There are three moving parts:
The gateway and the code must live on the same computer/server. The web server can live on a separate computer/server.
This means you'll need your Macintosh to run PHP-FPM, which can then listen for remote connects and send them to the PHP application.
Install php-fpm on your mac. Make sure it can listen for remote network connections. This is usually done in the www.conf
file in the listen
directory, you can listen for connections on the remote network interface (whatever IP address the computer is assigned).
Install Nginx or Apache and have it proxy FastCGI requests off to your macintosh server at the macintosh's IP address (the one you set up to listen to addresses in the step above).
You may need to ensure the firewalls at both ends allow incoming/outgoing connects on the networks being used to communicate to eachother.