Using Linux and old computers to do cool stuff. Vol. 1
As you all probably know, I am a systems technician for an IT outsourcing company, so I work in the computer field. Over the years I have become quite the Linux enthusiast and along the way I have learned how to do a lot of cool things for little or no cost. That concept is at the core of the open source community. The first thing I want to talk about it hosting your own web site. [note: if your website is going to generate a lot of traffic then this probably wont be good idea for you] Having a computer at your home of office that hosts your own personal or business website can save you a ton of $$$ over time. The average cost per year for a decent web hosting package can run you anywhere from $100 to $1000 depending on your needs as far as content updates and number of mailbox’s. NOTE: If you have more than ten mailbox’s with a lot of email and email addresses that already receive a lot of spam then I would not recommend this setup. If you are just staring a new blog or business, or you have a pretty static and small site that doesn’t get a lot of traffic and you are tired of the reoccurring cost then this might be just what you need.
First you will need to buy a domain name. I have a few, the main one being djskunkdiesel.com. You can buy a domain from godaddy.com pretty cheep now days. Be sure not to let them fool you into buying a hosting package because that is what we will be setting up in this tutorial. You DO want to make sure that your cart includes DNS hosting. We could set this up on the computer we are configuring, but I have learned over the years that it is better to have your DNS on “the cloud”. This way if your server is down for maintenance people will not get errors in their browser and you can even direct them to another site if you want. Also it is usually included for free when you buy a domain. If not then buy through godaddy. If you aren’t sure what DNS is then you should either abandon this tutorial now or go here and do some research. Some info on how to get in and make changes to your DNS can be found here. You will need to point traffic to your homemade Linux box by changing the ‘A record’ for your domain to point to it’s public IP address. You might also need to forward the proper ports in your router if you have one that is between you and the internet. Some good instructions on how to do that can be found here. If you don’t have a static IP from your ISP I would recommend calling them and finding out how much they would charge you to change your service package to one that includes a static IP. There are ways to setup DNS using a dynamic IP address, but I have found it much easier to just bite the bullet and get a static IP. I could explain it all to you, but I didn’t want this tutorial to be too terribly long. Besides, if you don’t have the ability to figure some things out on your own then go back to using windows. Or better yet, get yourself a mac. [can you smell my sarcasm?]
Next find an old computer with enough computing power for the job. A Pentium 4 that is 3.0ghz or better might do the job, but I recommend at least a Pentium 4 HT 2.4ghz or better. That way you have two cores working in your favor. Now make sure you have enough RAM. Anywhere from 512mb to 2gb should work. We don’t need any kind of fancy video card for this install since this thing will most likely be headless and not even have a monitor plugged in when we are done. From here we are going to setup our web-server with ISPconfig control panel. It is the best of the free web-based control panel suites that I have tried. It allows you to host multiple domains and as many email accounts as you like and it can manipulate MySQL and PHP which is what we need for Wordpress, along with webmail, ftp, and many of the other features you would normally pay your web host for. A good how to on setting this up with Ubuntu server can be found here. That should keep you busy for a bit! Now, if you successfully complete that, the core software of your server will be done! Let’s continue.
For the remainder of this tutorial I will refer to “yourdomainname.com”, please substitute with the actual domain name that you purchased. Mine would be djskunkdiesel.com.
Now we are ready to get Wordpress setup. The full version of Wordpress has many advantages over the free version that you have access to with a free wordpress account. This was the main reason I decided to host my own. Now before we can install Wordpress we have to get into the ISPconfig web interface on our server. Learning how to get into this was part of the install instructions I directed you to earlier, but to do so point your browser to http://yourdomainname.com:8080 and login with the admin account you setup during the install. If you are behind the same router as the box itself you might have to use it’s local internal IP address instead of it’s fully qualified domain name. If so it would be something like http://192.168.1.2:8080, but with the machines actual internal IP. From there goto “sites” and add in yourdomainname.com the only thing that is not a default option is under ‘php’ you want to choose ‘Fast-CGI’. Next over on the left click on ‘database’. We need to add a MySQL database for Wordpress to use. You can call it what you like, I called mine ‘wordpress’. If you are going to host multiple domains you might want to name it according to the domain that will be using it. For the database user you can use whatever name you want. I used ‘admin’. Make sure you give the user full rights to everything. This will install a MySQL database called ‘c0wordpress’ with an admin user of ‘c0admin’. We will need those to put into our Wordpress config file later. While you are in there you also need to create yourself an FTP account. On the left click on ‘FTP-User’, and from there add a user for yourdomainname.com and choose a username and password, we will need those later. There are a lot of cool features in ISPconfig if you wanna poke around in there, but this should be all you need, we will do the rest via ftp.
Next you will need to establish an FTP connection to your newly configured server. You can do this any number of ways. Hopefully if you are interested in Wordpress you have transferred files via ftp before. My favorite way is with a firefox plugin called FireFtp. It is a full featured ftp client that runs inside a tap of firefox. If you use firefox you can find it here. Otherwise just use whatever FTP client you are familiar with. Now you need to click and download the latest version of wordpress from here. Unzip it some place and then connect to your server via FTP with the username and password you created from inside ISPconfig earlier. For some reason ISPconfig puts the word ‘default’ directly in front of the username you specify. So for mine the username was ‘defaultadmin’. Sort of like the way it puts the ‘c0′ in front of your MySQL database name. I guess this helps it differentiate between ftp accounts you create there and ones you might create via SSH with the normal ftp administration. Anyway, once you are connected transfer everything inside the wordpress folder you unzipped into the /web folder that you see in your FTP session. Now you need to edit the ‘wp-config-sample.php’ file that was in that wordpress folder and change the lines that talk about your database name and username and password to make them represent the actual database username and password that we created while we were in ISPconfig earlier. Then save the file as ‘wp-config.php’ instead of ‘wp-config-sample.php’ and transfer it to the server. Now you should be able to goto “http://yourdomainname.com/wp-admin/install.php” and get a nice window that will ask if you want to install wordpress. Click on install and it should give you a temporary password for your wordpress admin account. Highlight and copy that to the clipboard or write it down. Then goto “http://yourdomainname.com/wp-admin” and log in with it and congrats! You have access to your wordpress. If you don’t know what to do from here you are screwed. I don’t have time to write a tutorial on web design using wordpress.
If you liked this tutorial stay tuned. The next two will be on how to use an old computer as a Linux media center and how to setup a Linux media server.