Turn an Old Computer Into a Web Server!

303,770

176

97

Posted in TechnologyWebsites

Introduction: Turn an Old Computer Into a Web Server!

wondering what to do with that network cable and that old computer you have collecting dust in your basement? well here's a little something that might be of some use to you.

Step 1: Prepare the Computer

i know, i know, but i know that there might be those who view this instructable who don't have an old computer....

anyway on to prepping the computer. your computer should have:
-at least 64MB of RAM (not too hard to get passed that these days)
-an intel or AMD processor (still not too hard)
-a cd-rom drive (still not hard)
-at least 600MB of space (you're going to want more than that since this is a server!)
-and the ability to boot from a CD
-an ethernet port

all in all, most of these requirements are easy to accomplish. since we will be using server edition for this install, this computer won't necessarily need 4GB RAM and a 500GB hard drive, though it would be nice...

Step 2: Get the Operating System

the operating system that we will be using is Ubuntu Server Edition 8.04. There are ways to achieve similar results with the desktop edition, but the GUI will take up a lot of memory and processing power.
you can download a cd image from this link:
http://www.ubuntu.com/getubuntu/download

make sure you choose "Server Edition" and select a mirror near you.
to burn the image, download an image burning software like MagicISO, or DVD Decrypter

or you could request free cds, but that takes time... 3-4 weeks to be exact...

Step 3: Install the Operating System

now here comes the fun part, make sure that your computer is hooked up to a router and has a live internet connection during this install, it will automatically detect and configure your network settings.

all you need to do really is put the cd of Ubuntu Server into the optical drive and boot from the cd in BIOS. it's different for all computers but you can normally access BIOS from the first boot-up screen (aka the first thing that pops onto the monitor once you press the power button) and pressing F12 or Delete on the keyboard

a few pictures were not taken, such as keyboard layout and proxy information, you should know what to put here...(proxy is blank for me)

look at the pics to see all the steps taken in the install.

images from: http://www.howtoforge.com/perfect-server-ubuntu8.04-lts-p2

after the installation of software, it will spit the cd back out, congratulations! you have just installed Ubuntu Server!

Step 4: Webmin

now here comes the boring part. since Ubuntu Server doesn't have a GUI (graphical user interface), everything is text-based. so, in order to have some good control over what goes on with your server, install Webmin (a web-based GUI).

once you log in with the username and password you set up, input these commands:

sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl

sudo wget http://prdownloads.sourceforge.net/webadmin/webmin_1.430_all.deb

sudo dpkg -i webmin_1.430_all.deb

and you now have webmin installed!

access webmin by typing this into your browser address bar:

https://your-server-IP:10000/

and now you can log in!

Step 5: Port Forwarding

now here is what you need to do in order to access your website from anywhere that has internet

open up your router's homepage by typing in the router's IP address (default is 192.168.1.1)

log in with user the username and pass (default is admin for both username and pass if you haven't changed it, consult router's documentation or google otherwise)

now go to the tab that says "Applications or Gaming" or "Port Forwarding" or something like that.

there will be a table-like form, you enter the applications name, the port-to-port forwarding, the protocol, and then your server's IP. for example: HTTP 80 80 TCP 192.168.1.xxx

enter these values:

HTTP 80 80 TCP serverIP
FTP 21 21 TCP/UDP serverIP
SSH 22 22 TCP serverIP

enable these forwards and then click "Save Settings" or "Save"

Step 6: Get a Free Domain Name

time to get a free domain name for your server. as of right now, your server IP address is your website, and who wants to keep remembering that?

a good free domain site is called http://www.no-ip.com/

they use your internet IP as a domain name. just make a new account and follow the on-screen instructions. it is really easy to set up

Step 7: Test Out Your Website!

whatever you assigned as your domain name at no-ip.com, enter that into your browser

you should see a It works! message in your browser window.
if not, try your server's IP address, if that doesn't work, then you must of done something wrong with the port forwarding...

Step 8: Permissions

now i know what you're thinking, how are you going to update your website if you can't access your server? here is the answer.

go your server once again and execute these commands:

sudo chown yourusername:www-data /var/www

sudo chmod 775 /var/www

you have just changed the folder "/var/www" 's permissions (/var/www is the root folder of your website).

now go to your main computer whether it's windows or mac, i haven't tried it on a mac but on windows this works fine. download a program called "WinSCP" and install it on your computer.
enter your domain name in the host name form and your server username and password in the username and password form

click connect

it should connect you to your server, and you should be able to see all the files on your server. go up a few directories until you see the var folder, enter the var folder and then the www folder

you can now copy new website material into those folders to update your website to make it cooler and more complex.

to remotely execute commands, use PuTTY, an SSH client program, google it and download it to your computer as well

Step 9: Other Thoughts...

this is one of many ways to configure an old computer to turn it into a webserver.

another Instructable which helped me get started a few moths ago was made by CalcProgrammer1

if you wish to see his instructable follow this link: https://www.instructables.com/id/Set-up-your-very-own-Web-server/?ALLSTEPS

if there is anything that i have missed, please feel free to comment

also, if everything works as it should, you have no need of a monitor or a keyboard anymore, which means that you can configure this computer to turn on automatically in BIOS at a given time, so essentially, you can store this server in a closet and not have to access it physically anymore. how great is that?!

my server is on variably...mon-fri 11-5 eastern time, check out my site
http://teknotixx.no-ip.org/

Share

    Recommendations

    • Spotless Contest

      Spotless Contest
    • Microcontroller Contest

      Microcontroller Contest
    • Space Challenge

      Space Challenge
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    97 Comments

    I'm using Windows 7 64-bit.

    I want to set my PC as server and also use it to Host my own website, can you Please tell what to do??

    Do you need to wipe the previous OS from the computer before installing the new Ubuntu OS? I am able to boot up in Ubuntu, but I am frozen at the language screen. Any suggestions?

    1 reply

    No, installing Ubuntu will wipe the previous OS on its own.

    also i cant add an ssh connection on my router...

    how do i remove this???

    I would really like to be able to have windows back on there

    2 replies

    download windows iso from google ---> burn it onto a disk ------> boot from cd -----> you have windows

    If you kept the disc that came with your Windows PC, all you have to do is put it in and re-install.

    hi dude....

    i'm having a problem on the line:

    sudo dpkg -i webmin_1.430_all.deb

    what should i do...??

    thanks in advance..

    1 reply

    Does this allow me to log into my computer from anywhere in the world?

    1 reply

    Thanks for great tutorial. To answer, to those who asked why turning old computer into web server - because of great exercise and utilising possibility to host web sites. As now days, a solid shared hosting plans runs on machines with dedicated 650mhz CPU and 256mb RAM that is sufficient for a 1 website like small business CMS, and with more system resources it is possible to do more. Another reason is saving a money and learning server technology. But, downside would be also more risks and downtime - if not all configuring set by standards, also with all present bots this would turn into non-stop maintenance and with practicing will lead into advancing web server administration.

    Can it just be any computer (as long as it has the minimum specs of your tutorial), and can I make an SQL Database on it?

    as mentioned above i installed open ssl package bt this below code isnt woring please help me as soon as possible "sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl"

    hi

    Why choose old computer to make server?

    Hello! I really liked the tutorial :)

    I wanted to ask you, that after setting up this server, if I want to securely password protect all the data, what should I do?

    Here is what I have in mind. Once the server is opened, the visitor is prompted to enter a username and password combination, and only then can he access the server.

    Help me out here!

    Thanks :D