Hosting Liferay for Personal Use

Ever wish you could avoid paying $50/month for a Java host for your personal Liferay portal?

Here's how I replaced the $50/month associated with a Java host: I used my home computer and internet connection, and a PHP/Apache server. I put the attached proxy.php and .htaccess files on a hosted PHP/Apache server:

In the proxy.php file, there are references to an IP address, which is my home network's IP address. The mechanism works as follows:

The client makes a request to server, e.g. http://example.com/web/guest/home, then Apache HTTP server cannot find /web/guest/home document and based on .htaccess configuration invokes proxy.php file. Well, proxy.php just takes /web/guest/home along with request parameters, sends them to my home's Liferay server, takes the response along with headers, and sends them to the client.

Voila. 

So how does it work?

The key part is the .htaccess file:

RewriteEngine On
RewriteBase /

DirectoryIndex index.html

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /proxy.php [L]

The source for the wonderful configuration above is as follows:

http://www.brainonfire.net/blog/apache-pitfall-errordocument-post/

With regard to the proxy.php script. I wrote that and I've tested it without any issue. There are some issues with document upload, etc. I hope to address these in the near future by replacing the proxy.php with a full-featured proxy.

Moyenne (0 Voter)
L'estimation moyenne est de 0.0 étoiles sur 5.
Commentaires