Moved to SliceHost

After a year of using a GoDaddy VPS to host my websites, I've made the switch to Slicehost. It's not that I was unhappy with GoDaddy, but I didn't realize another option existed for inexpensive VPS hosting with root access. After a friend of mine recommended Slicehost I decided to take the plunge and so far, I couldn't be happier. Slicehost takes a minimalist approach to VPS hosting. When setting up your account you basically only need to make two decisions:

  1. Plan - How much Memory/Storage/Bandwidth you need
  2. Distro - Which Linux Distribution do you want to run

For me, the basic 256MB Memory / 10GB Storage / 100GB Monthly Bandwidth option seemed the best fit and I really liked the large selection of Linux distristributions available. Most Hosting companies only give you the option of RedHat/CentOS or Fedora if they give you a choice at all, so to see Distros like Debian, Ubuntu, Gentoo and Arch on the list was a refreshing and welcome change. The other reason I say Slicehost takes a minimalist approach is because they don't offer any of the standard web based control panels for server administration such as cPanel or Plesk. The contol panel they do offer has only a few options such as rebooting your server and DNS control. The Slicehost control panel does offer one very nice option which gives you the ability to log into your server through an ajax based web page. This web based console access doesn't use the network to access your server so it can be used as a lifeline if you misconfigure the network settings or firewall on your server. Once you have selected your account settings and paid for the slice, Slicehost will create your VPS. It only took 2 minutes for the server to be provisioned. This was very impressive to me. It took a total of about 5 minutes from when I entered my account selections to actually being logged into my new server. Provisioning isn't the only thing Slicehost does quickly. The new server has roughly the same hardware specs as my previous server at GoDaddy and the Slicehost server runs circles around the GoDaddy VPS both in terms of processing speed and network response time. I've only been with Slicehost for a short while, but I would highly recommend them to anyone who needs a Linux server and doesn't want or need things like cPanel. I'll write more about Slicehost after I've been with them for more time, but unless something changes for the worse I will recommend them highly for VPS hosting.

Create a Simple VPN Using SSH and Gnome Proxy Settings

Are you one of those people who worries about someone sniffing your wireless traffic at a coffee shop? Well fear not, because today I'm going to show you how to set up a quick and dirty VPN to secure your packets (and get around those pesky web filters too).

Here's what you'll need:

  • A dynamic DNS account set up and pointed to your home broadband connection
  • A computer at home running an OpenSSH server with the SSH port forwarded to said computer
  • A laptop with the OpenSSH client installed and running Gnome desktop (any recent distro will do)

The dynamic DNS setup is outside the scope of this tutorial, but episode 90 of Systm on Revision3 will show you how to configure it if you don't already know.

In this example, we'll be using Ubuntu Linux, but all the commands (with the exception of the command to install OpenSSH server) will work on all recent distros.

First you need to install OpenSSH server on your home computer. Make sure you have strong passwords set for all user accounts on this machine.

sudo apt-get install ssh

Next, set up port forwarding on your router to pass all traffic on port 22 to the computer on which you just installed OpenSSH server. That's it for your home computer.

Using your laptop, connect to an untrusted or filtered internet connection in your favorite bar or coffee shop. Now you can quickly and easily establish a secure connection back to your home ISP using the following steps:

Open a terminal window and enter in the following command:

ssh -D 9999 user@your.dyndnsaddress.com

Where user is the user name to log in to your home computer. This sets up an SSH socks proxy connection to your home computer on port 9999 of your local machine.

Finally, Click System -> Preferences -> Network Proxy and enter the following settings: Proxy Settings

Once this is set all applications that use Gnome Proxy Settings will automatically use the proxy connection. Your packets are now safely encrypted all the way to your home internet connection.

Enjoy!

Run Your Own Instant Messaging Server

Today we are going to install the Openfire XMPP server on CentOS 5.x. Openfire is extremely flexible and powerful and can be easily integrated into an existing IT infrastructure. It is written in Java, has tons of plugins and is released under the GPL so it can be freely modified and redistributed.

Note :: you will need to have MySQL installed before installing Openfire

First, download the CentOS RPM from the Ignite Realtime website. At the time of the writing the current version is 3.6.2, but you may want to check the site for an newer version.

wget http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire-3.6.2-1.i386.rpm

Then simply install the RPM file

rpm -ihv openfire-3.6.2-1.i386.rpm

A MySQL database must be created for the openfire service. The following commands will log in to mysql as the root user and create a database openfire. Then create a user openfire , grant the user all privileges to the new database and set the users password. The final command flush privileges; simply reloads the user privileges for MySQL to ensure the new user has the access we have set up.

mysql -u root -p
create database openfire;
grant all on openfire.* to openfire@localhost identified by 'password';
flush privileges;
exit

Next, start the openfire service

/etc/init.d/openfire start

Note :: if you want openfire to start automatically when the server boots, run the following command:

chkconfig --add openfire

Once the service has been started, open a web browser and navigate to http://192.168.x.x:9090 where 192.168.x.x is the ip address of your server running openfire.

The installer is fairly self explanatory, choose your language and domain name.

On the Database Settings screen choose Standard Database Connection and click continue

Here we will use the information from the database we set up previously:
Database Driver Presets: MySQL
JDBC Driver Class: com.mysql.jdbc.Driver
Database URL: jdbc:mysql://localhost:3306/openfire
Username: openfire
Password: password

Next, choose default under Profile Settings and create your administrator account.

Note :: port 5222 must be available to all clients in order to connect

That's it. Now you can create users and connect any XMPP Instant Messaging client to your server.

There are a ton of options in the administration console so dig in and have fun!