Quick Linux Port Redirect Tip

A lot of the time when I am deploying applications on Railo, you get the installer, and install a version of tomcat (for example) and then setup Railo and then finally install Apache or NGinx.

This has been working well for a while but what if you dont want that extra webserver layer? There are times where I don't see the point of setting up Apache since all it will be doing (in my case) is proxying from port 80 to port 8080.

There are a couple of things you can do:

  1. Try and change the port in tomcat by editing server.xml
  2. Use iptables to redirect the port without having to install anything else!

 

Recently I got into a Yak Shaving situation where having changed the port of Tomcat to port 80, meant that I need to change the user that Tomcat was going under (and I didn't want to do that!) so meant I had to do a bunch of other stuff and essentially meant that the only way out would be to install a web server. Which seemed overkill for the app (well, service) I wanted to deploy.

IPTABLES to the rescue!

After a quick trawl around the internet I found the solution, which was just to put some redirects in iptables.

sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080

sudo iptables -t nat -I OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8080

This achieves the goal I was looking for without the need to configure yet another service (that will need restarting when we do other changes etc)

What do you think? Useful?

Introducing my new company: CMD

Hello Internet! It gives me great pleasure to announce the start of my new company: CMD

Read more...

Running MongoDB from Sublime Text 2

For last night's presentation at the CFUG about MongoDB I was running the demos right from Sublime Text 2. This was mainly to be able to increase the font but I was asked how I did it. (I generally use either the mongo shell or RoboMongo which is awesome!)

Here you can see how it was running: 

The way I pulled this off was to create my own Build System called MongoDB:

Now that you have a blank Build system, all you need to do is enter the following:

Of course, replace the path to mongoDB with whatever the path to your installation of mongoDB is! And finally all you have to do is hit the cmd+B buttion and it will then send the path to the current file to mongo. 

I got this working for Sublime Text 2 but in Sublime Text 3 it didn't work as expect the code is not exactly the same. You have to change the build script to the code below:

I can send commands to MongoDB too but it doesn't display anything in the Results pane which is a shame. So if you get it working in Sublime Text 3 let me know! 

 

cf.Objective() Sessions and voting

Quick Quick! Go over to the cf.Objective() Trello board and vote for some of the session there! There are some awesome topics that are going through for next year's conference and you only have till the 11th to vote what will make the cut! 

I doubt my presentations will make it, but make sure you vote for some excellent talks covering a range of topics (not just CFML!) 

Do it or be a equilateral triangle!

 

https://trello.com/b/4M6JSoyL/cf-objective-call-for-speakers-2014

Presenting MongoDB at the UCFUG

It was my pleasure to be able to present to the largest turnout at the UKCFUG that we have had for a long time last night! 

Along with Grant Shepert from Mura we did a Google on Air to present MongoDB and "What is new in Mura 6.1", alas due to technical issues Grant couldn't join the Hangout and thus his portion of the video is missing but at least you can see my presentation for MongoDB

Enjoy!