Dedicated servers are not for everyone, but when you need one why pay through the nose. I will show you how I did it for free.
|
|
As a web developer, I have been using Web Hosts for years and batted between free and paid ones and hit every bad link in the chain. I always wanted a dedicated machine, something I control but could not justify paying the monthly fee for one, so I set about setting up my own.
What you need
A decent speed broadband connection
A spare computer you can leave on
Access to port forwarding
The Computer
How powerful the computer is, the more it can handle. Generally the better the processor, hdd space and ram, the better the experience. Ignore anything to do with the GPU as this wont be utilised.
I actually use an old laptop “Compaq C700EM” which currently has no screen.
I would recommend as a rule of thumb, if you can't use it as a day to day machine, it's not going to be good for anything more than a basic website.
Here's what to do
1) Prepare the Computer
Download a Linux Distribution to install on the laptop, I recommend Xubuntu has its generally lightweight and has the GUI for if you need the GUI. http://xubuntu.org/getxubuntu/ .
Burn it to a CD or Live USB, boot the computer from it and follow the installation wizard, it's rather easy.
2) Connecting to the network
Connect to your network, where possible use an Ethernet cable to do so, as this gives better bandwidth and is more reliable than WiFI.
Once you're connected to the network, open up terminal and run ifconfig, this will let you get the network address of the server. For instance mine is 192.168.0.4.
3) Installing the LAMP Stack
In terminal, you can run simple commands to install the LAMP stack, LAMP is Linux + Apache Mysql and PHP. There are many ways to do this but I will point you to http://howtoubuntu.org/how-to-install-lamp-on-ubuntu for instructions on this.
4) Connecting from Another Computer
Once the lamp stack is installed, you can stop using the server computer now, so unplug anything you don't need ‘Monitor’, ‘Keyboard’ ect. Then go into the browser on your main computer and type in the network ip of your server. This will show a page such as “Hello World”; Since you can access it, you can now ssh into the server using the ip, user and password of the server in a program such as putty.
5) Connecting the Server to the WWW
You will probably want web access to your server, to do this you have to enable port forwarding on your router, you will need to google for instructions for your specific router.
Usually, you can access a web interface by opening 192.168.0.1 in the web browser.
The ports you need to forward are 80, 8080, 22, 20 to the ip of your server. This will allow HTTP FTP and SSH access.
Now when you access your External IP, you will be directed to your server. To find your IP use Google and ask “What is my ip?” this will give you your external IP.
From there you treat it as a normal Dedicated Server, you control it and need to do the usual pointing nameservers. If you IP is dynamic look at using dyndns to keep records updated.
Full Story |