I had an old DELL 4300 lying around at home and thought it was about time I put it to some use by setting it up as a LAMP server to work on little PHP projects from home. Since it is quite a low spec machine I decided to go with Xubuntu on this one. The latest release is 9.10, but I use Ubuntu 9.04 on my laptop so thought I would go for the same version of Xubuntu for this one since I had the CD lying around within yards of the server-to-be anyway. I am not knocking Ubuntu 9.10, I upgraded my workstation at work to be running this version and it is great, although I haven't quite figured out the quirky behaviour surrounding the new UbuntuOne service, but that is another story.
First thing you will want to do is go to Xubuntu.org and get a release of Xubuntu. The following should work regardless of whether you decide on 9.10 or 9.04.
Get your old machine out and wire it up to the network, a monitor and a keyboard. Follow the installation steps for Xubuntu and once it is started for the first time you can log in. Here you will probably find that there are updates to get for the distro so just follow the prompts until the system stops quizzing you.
A little churnering and a couple of restarts later you will be ready to get started installing the server software.
Hit Alt+F2, enter 'xterm' and hit 'Run'. A terminal window will open. From here enter:
sudo apt-get install ssh
This will prompt you for your password and then install an SSH server on your machine. Brilliant! Make sure your server-to-be is set up with a static ip so you know how to find it easily. You can read a good guide here.
From here you can remove the keyboard and monitor from you server-to-be, hide it somewhere out of your better half's sight and go to your laptop or whatever you normally work on. I went to my laptop of course.
Connect to your server-to-be via SSH
ssh username@host
Now from here you can start installing other server software, starting with Apache, MySQL, PHP:
sudo tasksel install lamp-server
You will be prompted for your password then a blue screen will appear and begin downloading and installing. At some point you will be prompted to choose a new password for the root mysql user, don't forget this one.
That is it really. You are pretty much ready to go from here. Going to the servers IP address in your web browser should present you with a page saying 'It Works!' in large type.
Your document root is under /var/www . All you will find there is a file called index.html with the contents described above.
One other thing you may want that is not included in the default installation here is mod_rewrite. To activate this enter:
sudo a2enmod rewrite
then restart Apache
sudo /etc/init.d/apache2 restart
I use phpMyAdmin to work with MySQL databases. This tool has endless value and if you haven't already thought of it, I reccommend installing it:
sudo apt-get install phpmyadmin
During installation you will be prompted for the MySQL root users password as well as being asked to set up a new password for phpmyadmin.
Next you will need to include the configuration for phpmyadmin to be used with Apache. Open /etc/apache2/apache2.conf in vi
sudo vi /etc/apache2/apache2.conf
Add the following line to the end of the file:
Include /etc/phpmyadmin/apache.conf
Save :w and quit :q. Now restart Apache once more:
sudo /etc/init.d/apache2 restart
Browsing to yourserversip/phpmyadmin, you should be presented with the log in screen for phpMyAdmin.
You are up and running. Install you favourite version control system and you are away. Enjoy.
Remember, this is by no means a secure installation of a webserver and is only intended for use at home on your personal projects.
Comments
No comments yet...