In the spirit of blogging about useful Liferay configurations, I thought I would share with you another URL weight-loss secret, losing the :8080 on the end of your URL in Liferay. When you're done reading, you'll know how to turn http://localhost:8080/ into http://localhost/.
So, Jon, why does Liferay run on port 8080?
Well, dear reader, long ago in the early days of the internet the world wide web was being formed in the womb of giant UNIX servers, and websites were hosted from these machines through port 80, just as they are now. However, these UNIX servers held to a belief that the first thousand-something ports on any machine were very sacred, and that these ports should only be accessible to the user known as root, who was the greatest user of them all. So, when regular ol' Joe Bloggs needed a port to run his first web site but didn't have root's privileges, he took the inspiration of port 80 and the necessity of a port greater than 1023 and came up with port 8080. I suppose that Liferay continues this tradition in the same way that American's attempt to blow up the sky on Independence Day, supposing that just in case the computer can't use port 80 or the British should attack by rockets red glare, we're totally prepared.
But Jon, when I switch to port 80 won't I just have to write http://localhost:80/?
No, dear reader, because all web browsers already assume you're on port 80, because all the major websites that you visit daily, like google.com, facebook.com, and jonathantneal.com all run on port 80, thus removing the need to ever specify the port at all.
Okay Jon, I'm ready. How do I switch my Liferay portal to port 80?
Simple, dear reader, open up the tomcat folder that holds your local copy of Liferay; just make sure that Liferay isn't actually running when you do this. Inside the conf directory there's an XML file called server.xml; open it.
Search for the line that reads: Connector port="8080" protocol="HTTP/1.1"
Change 8080 to 80 so that it reads: Connector port="80" protocol="HTTP/1.1"
Save the file and start Liferay, then go to http://localhost/ because that's it; you've done it!
Wow Jon, that was easy, so, will Liferay ever run like this out of the box?
For that answer, dear reader, I would check the comment section below. There I am sure you will find an answer which doesn't compare Liferay with the colonial revolution.

