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/

Comments

author
DanielG599 made it! (author)2017-02-26

access webmin by typing this into your browser address bar:
https://your-server-IP:10000/
and now you can log in!


how do i know what is your-server-IP?

author
DanielG599 made it! (author)DanielG5992017-02-26

please please answer

author
DanielG599 made it! (author)DanielG5992017-03-12

oh i got it

author
DanielG599 made it! (author)2017-02-26

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

author
callumofawesome made it! (author)2011-02-22

how do i remove this???

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

author
DanielG599 made it! (author)DanielG5992017-02-26

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

author
Zephlon Arphanosh made it! (author)Zephlon Arphanosh2011-09-29

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

author
YudeeshS made it! (author)2015-03-11

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..

author
DanielG599 made it! (author)DanielG5992017-02-26

what does it say?

author
QaadirK made it! (author)2015-04-22

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

author
DanielG599 made it! (author)DanielG5992017-02-26

no

author
nik381 made it! (author)2016-03-17

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.

author
SeAN15 made it! (author)2015-06-26

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?

author
Resettechnologies made it! (author)2015-04-07

author
VijayanandB made it! (author)2015-01-24

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"

author
essudha.s made it! (author)2014-12-28

hi

Why choose old computer to make server?

author
RaahishK made it! (author)2014-12-20

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

author
RaahishK made it! (author)2014-12-20

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

author
RaahishK made it! (author)2014-12-20

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

author
RaahishK made it! (author)2014-12-20

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

author
RaahishK made it! (author)2014-12-20

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

author
RaahishK made it! (author)2014-12-20

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

author
philippevarldy made it! (author)2014-03-11

Hi guys,

I blessed just for being part of the forum today. What lead me to it is that I am looking for help. I want to operate my own IPTV, I have a PC with Ubuntu 13.0 somthing on it. I want to follow some steps like installing the webmin, but the installation cannot be completed.

author
philippevarldy made it! (author)2014-03-11

Hi guys,

I blessed just for being part of the forum today. What lead me to it is that I am looking for help. I want to operate my own IPTV, I have a PC with Ubuntu 13.0 somthing on it. I want to follow some steps like installing the webmin, but the installation cannot be completed.

author
xmozox made it! (author)2011-12-18

hello
after i add hostname for compter my computer dont do anything goes to a purple screen can any1 help

author
jgeorge13 made it! (author)2011-11-28

I installed Ubuntu 11.10 Server Edition. The install went pretty well with only a few speed bumps, but I'm having an issue with the command line "sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl"; Ubuntu gives me an error finding the package to install. I'm also getting an error locating the webmin package. I cannot install webmin because apparently it no longer exists at the sourceforge.com URL according to my Ubuntu server. I checked both of these command lines as well as the webmin download URL and re-entered all said command lines in the above instructions with zero success. Any idea as to why I'm having these issues?

author
z2daj made it! (author)z2daj2011-12-07

The URLs are most assuredly outdated. My recommendation would be to google the packages in order to get the up-to-date package information.

If you need help, I can look into as well, though with two majors and the end of semester approaching... it may be couple weeks or so before I am able to.

author
jbeatty1 made it! (author)2011-05-27

cool im a do this now :D

author
jeremycollins made it! (author)2009-07-19

I am having a little trouble with webmin and accessing my server. i installed webmin using the terminal commands you provided and it did not display any errors. The pc I want to use is connected via ethernet that is connected to a router. We have three pcs in the house, one running from an 802.11g wireless signal and the other are wired (ethernet). How do I get the ip for my server pc? I visited whatsmyip.org from my regular computer but it didn't work when accesing webmin. Also, from netopia (my router brand) I saw this note: From the LAN (Local Area Network), you will also be able to access these servers, but only using the internal private IP address. Access via the public IP address is not supported from a local ethernet connection. Does this mean I cannot set up a webserver? I would really appreciate your assistance. Thanks for the great tutorial...I just hope I can get it working right!

author
z2daj made it! (author)z2daj2011-01-29

*Nearly two years later...*

If you know the router's IP address, say 192.168.1.1 for example, and you have a DNS network, the router will automatically assign IP addresses to connected devices using this scheme 192.168.1.xx where 'xx' is the IP of the computer connected to the router. In most cases by default, the the IP addresses of connected devices begins at 101 and go on, as the router's address in this case would be 100.


Sorry for the late response! I never get e-mails when comments are posted, and I forgot all about this account!

With humble apologies,
-z2daj

author
x-treme made it! (author)2010-12-09

You can also use dot.tk, I prefer it over no-ip.com. Top-level domains > Sub-domains

author
harry599 made it! (author)2010-08-24

When we have to enter these: HTTP 80 80 TCP serverIP FTP 21 21 TCP/UDP serverIP SSH 22 22 TCP serverIP Do we have to copy it exactly or do we put the ip in the bit that says serverIP? Thanks Harry

author
Ian01 made it! (author)Ian012010-10-24

You put your server's local IP address there.

author
Lord_Drogoth made it! (author)2010-04-12

 I seem to be unable to do the first command of step 4 it gives me the same error every time. "E: Couldn't find package libnet-ssleay-per" If you could help me it would be much appreciated.

author
z2daj made it! (author)z2daj2010-04-12

 i know this sounds silly, but just make sure you typed everything right :D

i couldn't get anything to install at one point because of typos myself

author
Lord_Drogoth made it! (author)Lord_Drogoth2010-04-12

 I checked it several times for errors before I entered  it and type it all over again and check that errors and I still didn't catch anything wrong with it

author
z2daj made it! (author)z2daj2010-04-12

 hmm, just do sudo apt-get install perl and then continue on. If the dependency of the webmin package isn't fulfilled, it should automatically search and install it from the repository. Good Luck!

author
Lord_Drogoth made it! (author)Lord_Drogoth2010-04-12

 I'll try that thank you for your help and for the exceedingly speedy reply

author
digitrunner made it! (author)2010-03-09

Great instructible and great intro LOL, I know, I know, I know, I know I know, ... Aint No Sunshine When She's Gone by Bill Withers, brb have to go put the song on now to get it out of my head...:P

author
abadfart made it! (author)2009-05-15

dose anyone know prompt i don't

author
erikals made it! (author)erikals2010-02-24

Google 'unix tutorials'
UNIX is what all linux distributions use. It is included as part of Ubuntu, openSUSE and any other linux distribution.

author
octavian234 made it! (author)2009-08-25

your website doesnt work

author
Lance Mt. made it! (author)Lance Mt.2009-10-25

 lol nope. I'm also wondering if i can just keep it as a ip address?

author
iNORTON made it! (author)2009-09-20

I don't have ssh in the list of application names.... I have ftp...http...https...dns..smpt...pop3....telnet...ipsec...pptp...netmeeting...dcs-1000...dcs-2000/dcs-5300...i2eye..
I was wondering what I might substitute to be able to have the same config as you do.. I am using a d-link 2300 router...

author
jpr3 made it! (author)2009-09-04

THANKS for a great instructable. I've been wanting to do this for a long time - and I got it working in no time. You are great and Instructables is great! John

author
airsoftguy1310 made it! (author)2009-04-04

when i try and get webmin it says "E: Commad line option 'i' (from -i is not) know." plez hellp p.s. replace () with []

author
z2daj made it! (author)z2daj2009-05-25

did you do
sudo wget http://prdownloads.sourceforge.net/webadmin/webmin_1.470_all.deb

and then do

sudo dpkg -i webmin_1.470_all.deb

author
Stephen304 made it! (author)2009-04-11

What extras should one install for a basic server that will host php scripts and html pages with the possibility of a sql database? Do i need to check install lamp? Near the end of the install it has an extras thing, i don't know if i need any.

author
dpdonohue made it! (author)dpdonohue2009-08-05

yeah LAMP will do the trick perfectly

About This Instructable

291,718views

176favorites

License:

More by z2daj:Turn an old Computer into a web server!Net Sending on a Computer
Add instructable to: