Install WordPress on Ubuntu 10.04 Slicehost
14 Dec 2010Here is a quick step by step for setting up a new Slicehost slice and installing WordPress on that slice. In this example we will use a Ubuntu 10.04 (Lucid Lynx) 32-bit 256 MB slice. The first part is a condensed version of these instructions. The second part introduces a bash script that will install and configure a LAMP stack in order to run WordPress.
Part 1: Fire up and configure your new Slice!
Goto slicehost, sign up, and pick your slice by selecting “Ubuntu 10.04 LTS (lucid) 32-bit” from the Linux Distribution drop down menu. Wait for the slice to fire up and then when it is marked active in your control panel you can ssh into the slice using the root username and password.
First change the password of root
Add a new user and group. Follow the instructions on the screen.
Open visudo
Add this line to the bottom of the file:
On your LOCAL machine generate an ssh key
Copy this key to your new slicehost slice using scp on your LOCAL machine
Back on the SERVER – your new Slicehost slice, run the following commands. This simply moves your local machine public key to the authorized_keys file for demouser.
Make ssh more secure by editing /etc/ssh/sshd_config
and changing the following three properties:
- Port 30000 <-– change to a port of your choosing
- PermitRootLogin no
- PasswordAuthentication no
Load custom rules into your server iptables. The easiest thing to do is copy paste the Slicehost iptables rules to a new file /etc/iptables.up.rules
and then load these rules. Remember to open the port that you selected in the previous step for ssh.
Now run the following to update rules from the new file
You want to ensure that these rules are loaded on every instance boot. So create a new file /etc/network/if-pre-up.d/iptables
and add the following script into this file:
Run this to make the file executable
Reload SSHD
Now you can try logging in as the new user (demouser in this exampe) from your LOCAL machine
If all goes well, you can log out of root at this point and continue to use demouser going forward. If you do get locked out, Slicehost have a browser based console, which you can use to attempt to fix any issues with SSH.
In Part 2 we will prepare a bash script for installing WordPress.