The WONDERFUL Apache Server

So, I had a liferay server running on a Virtual Server on tomcat, then my boss announces that he’s not buying another server and I have to run PHP on it as well.

Fantastic APACHE comes to the rescue. Using virtual hosts it is not only possible to run PHP on a server but also forward domains off to a liferay server.

Ok all you have to do (it really is this simple), is to modify the https.conf file and restart apache.

Here’s some examples

1. Redirect to an external server

ProxyPass /
ProxyPassReverse /

(note this is NOT a redirect in fact but proxying the remote server – so you keep the same domain name! great!) BUT note that you could get the same effect by changing the A record on the domain in the DNS! But this is a great shortcut for placeholding until I have something to put there.

Proxying to a liferay server

ProxyPass /
ProxyPassReverse /

And finally running a local PHP/Apache combination

 DocumentRoot /var/www/
</VirtualHost> = the servers IP (don’t think I’d give out a real IP !)

Don’t forget to restart your APACHE server after doing the changes

/etc/init.d/apache2 restart

About Paul C

I am a Senior Java programmer/Web Technologies, Play in a band called Mandolin Monday, I have a cat and I live on a boat.

Posted on May 9, 2012, in Apache, Liferay. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: