How To Build A Linux Web Server With An Old Computer [Part 1]

Ads by Google

webserveroldpc1   How To Build A Linux Web Server With An Old Computer [Part 1]Interested in learning about Linux or running a home web server? Installing Linux on a spare old computer is a pretty easy thing to do these days with many consumer friendly distributions such as Ubuntu and Mint Linux. After getting up and running you will have a platform for hosting your website in-house either for development or to self-host a website.

This how-to article is broken down into 4 major steps: 1. Acquire an old computer, 2. Install Operating system, 3. Set up the application web server software (Apache, PHP, MySQL), and 4. Reaching the computer from the internet.

Acquire an Old Computer

Linux is a versatile operating system in that it can be run on the slowest of PCs, at least in command line mode. For simplicity’s sake, we are going to be running Ubuntu 10.10 “Maverick Meercat” which was just released and reviewed by Justin.

System Requirements

The Ubuntu 10.10 lists 256MB of RAM as the minimum amount it will work on. The installation itself takes up 3.3GB and then you want to leave space for the additional software and any files you need to work with, so I would peg that minimum at 10GB.

Ubuntu supports a wide variety of video cards, hard drives and other hardware; if you want to check before downloading the install disk, look at the Linux hardware compatibility list for both complete systems and individual components in your system to see if it will work. Before getting too caught up in this though, it is pretty quick and simple to test things out with a Live CD to make sure everything will work on your system.

Ads by Google

If you plan on running the server 24/7, make sure it is in a well-ventilated area. It is better to place it in an air-conditioned room during the summer as heat will be your system’s main enemy.

Install Ubuntu

ubuntuinstall   How To Build A Linux Web Server With An Old Computer [Part 1]

Installing Ubuntu is a cinch with the latest 10.10 installer. My favorite feature of the installer is that while you are still making choices about the installation, it is working to format and copy files over to your hard drive.

Head on over to the Ubuntu Desktop CD Download site to get the ISO file. These disk images have the latest versions of software so you should only have to do a minimum of upgrading after the install. Use the 64-bit version if your computer supports it or the 32-bit version otherwise. Burn the ISO to a CD or DVD, plug it into the drive of the computer and boot up.

If you need to change the BIOS settings to boot off of a CD then do so, or sometimes you need to press a key to select an alternative boot media. Boot off of the CD drive and select the “Install Ubuntu.” Generally speaking, we will be installing the least amount of software as possible for two reasons: the first is that the more software you install and services you run in the background, the slower your system will be. The second is that it also opens your system up to more potential security holes in the future.

Select “Download updates while installing” and “Install 3rd Party Software” and then “Erase and Use The Entire Disk”. Note that this will erase any other operating systems you have on this computer. Follow through the other options per your desired settings. I do not recommend encrypting your home folder. Reboot after the installation is complete.

ubuntuupdate   How To Build A Linux Web Server With An Old Computer [Part 1]

Upon reboot, your install is essentially complete! The first thing you need to do after an install, similar to a Windows machine, is to apply any updates. Go to System->Administration->Update Manager and “Install Updates”. You may need to reboot after installing any updates it has found.

You now have a fully-functional Ubuntu install.

Set Up Application Services

You have a number of options here, but since most websites run on a combination of Apache, MySQL and PHP, we are going to install those. This is similar to what we recommended installing on Windows.

These applications are installed via the Ubuntu Software Center. Launch the software center via System->Administration->Synaptic Package Manager. This is where we install the software we need.

Search for and install the following package names, each of which will include a number of prerequisites: apache2, php5, php5-mysql, and mysql-server. Apply the changes to install the packages.

apacheinstall   How To Build A Linux Web Server With An Old Computer [Part 1]

The packages will download and install shortly. The installer will prompt you for the MySQL “root” password. No reboot is necessary.

Test Your Web Server!

You can test your web server by opening the Firefox web browser on your server and heading to the URL http://127.0.0.1/.

itworks   How To Build A Linux Web Server With An Old Computer [Part 1]

You should see an “It works!” message meaning that your web server is running! Both Apache and MySQL will be running in the background and will start on bootup. Your web server is now essentially working and you can edit the files in /var/www and see the changes live on your website.

Part two of this series, to be published shortly, will go over how to upload files to your Linux web server; and how to access your web server both over your local network and via the internet. Check back to see how to complete your setup. The setup is pretty straight forward but there are always hiccups along the way.

Questions from new system administrators? Ask away in the comments and I’ll be sure to get back to you!

Ads by Google

29 Comments - Write a Comment

Reply

Gamaware

I think everything in this post is great except for the idea to use Ubuntu Desktop as the server I would recomend to use Open Suse (since it has more packages already available) or Ubuntu Server (sinces is designated completely for servers) but if the Idea is to learn how to set up a web server with no experience at all, Cent OS or Fedora is a good place to start, Ubuntu Desktop has a lot of apps that doesn’t necesarly need to be there to set up the server

this is just my opinion, but great job I love the posts

Reply

Dave Drager

I chose the desktop version because of the ease of use of the GUI. For someone not used to command line, I thought that would be the easiest way to get started – also familiarizing them with the Ubuntu system along the way.

I agree that there are a lot of apps that a server does not need, but in general ease of use it is the best place to start on linux.

Reply

Vance Denial

Why are you using the desktop version (which has a full and completely unnecessary GNOME implementation) rather than the server version?

Dave Drager

I chose the desktop version because of the ease of use of the GUI. For someone not used to command line, I thought that would be the easiest way to get started – also familiarizing them with the Ubuntu system along the way.

Reply

Gamaware

I think everything in this post is great except for the idea to use Ubuntu Desktop as the server I would recomend to use Open Suse (since it has more packages already available) or Ubuntu Server (sinces is designated completely for servers) but if the Idea is to learn how to set up a web server with no experience at all, Cent OS or Fedora is a good place to start, Ubuntu Desktop has a lot of apps that doesn’t necesarly need to be there to set up the server

this is just my opinion, but great job I love the posts

Dave Drager

I chose the desktop version because of the ease of use of the GUI. For someone not used to command line, I thought that would be the easiest way to get started – also familiarizing them with the Ubuntu system along the way.

I agree that there are a lot of apps that a server does not need, but in general ease of use it is the best place to start on linux.

Reply

Heri NXI

good practice to start into linux, don’t scare them with command line, nice guide article :)

Reply

Shubham

very nice article dave . Just one question . Can we use other distributions of linux such as Puppylinux or DSL to make a server? if yes then is the process same ?

Dave Drager

Steps are basically the same but each package might have a slightly different name. Also each distribution has different methods of distributing software, for example Fedora would use RPM.

Reply

Anonymous

looking forward to the next part

Dave Drager

Thanks – in part two I go over connectivity to the web.

Reply

Anonymous

The article should be titled “How To Build An Ubuntu Web Server…”- there’s a lot more to Linux than Ubuntu.

Dave Drager

Yes – but you will have to forgive me because writing an article covering all linux distributions and permutations would be near impossible! Just trying to get neophytes up and running on linux, and Ubuntu is probably the easiest way to get them started.

Reply

Kichaas2003

how to do it offline. ie with UBUNTU Desktop and Server CD ???

Dave Drager

You do not need to be online to do the install, when you are installing do not check off the “download updates” section.

Reply

Wanderson

I recommend a much, much easier process for setting up a web server on an older PC – which author did not specify as to hardware specifications.

I used a Dell P3-667mhz, with 384MB RAM, and 10GB HD. I installed ClearOS 5.2 – from http://www.clearfoundation.com – which is vanilla CentOS 5.x with considerable additional server configuration and server tools and has Apache/MySQL,PhP for Web, FTP, Windows Shares and much, much more already in packaged install. It even has browser admin GUI-type interface.

I enabled MySQL and Web Server- with simple button click, then from browser on another PC on my network typed in server ipaddress. Voila! – a web page of ClearOS logo. Administration is a piece of cake – from browser, enter https://ipaddress:81 and you are at secure (SSL) admin login.

The most sophisticated, easy-to-use Web/other server setup and use I have experienced in more than twenty years as a technologist.

W. Anderson
wanderson@kimalcorp.org

Reply

Wanderson

I recommend a much, much easier process for setting up a web server on an older PC – which author did not specify as to hardware specifications.

I used a Dell P3-667mhz, with 384MB RAM, and 10GB HD. I installed ClearOS 5.2 – from http://www.clearfoundation.com – which is vanilla CentOS 5.x with considerable additional server configuration and server tools and has Apache/MySQL,PhP for Web, FTP, Windows Shares and much, much more already in packaged install. It even has browser admin GUI-type interface.

I enabled MySQL and Web Server- with simple button click, then from browser on another PC on my network typed in server ipaddress. Voila! – a web page of ClearOS logo. Administration is a piece of cake – from browser, enter https://ipaddress:81 and you are at secure (SSL) admin login.

The most sophisticated, easy-to-use Web/other server setup and use I have experienced in more than twenty years as a technologist.

W. Anderson
wanderson@kimalcorp.org

Dave Drager

Thanks for the link! Looks like a great way to get started with a Web Server.

Reply

Ken

Excellent article Dave!! I am fairly new to Linux and was able to follow through without a hitch. Looking forward to part 2.

Reply

Jormamakela

Another option is to use Slackware… even less resources, older computer… ;)

Dave Drager

Ah yes, good old slackware. The options are endless as so many platforms run Apache or other web servers!

Reply

Chrishill16

Dave, great article – currently following it to setup my server.

Just wondering… if i set my system up as described in the article, will i also be able to use it as a file server and stream movies from it? I’d also like to be able to grab files from it when I’m away from home, which I guess I could do with ftp?

Reply

Chrishill16

Dave, great article – currently following it to setup my server.

Just wondering… if i set my system up as described in the article, will i also be able to use it as a file server and stream movies from it? I’d also like to be able to grab files from it when I’m away from home, which I guess I could do with ftp?

Dave Drager

Yes, using the “share this folder” option in part 2 will allow you to enter your computer share on another computer, allowing you to stream movies from it using something like Boxee or another computer. FTP will work, but it is an insecure protocol, I would recommend using SSH or SCP to transfer files to/from the server remotely. Just make sure to forward the correct ports.

Chrishill16

Thanks for your help. I’ve got it all set up as the articles suggest and I’m able to connect to my server using dyndns.

How do I access files on the server (music, movies) from my Windows pc on the same network? I tried to add a new network location but that didn’t work. Ideally I want to be able to store all my music and movies on the server and access them from my pc – is this something to do with the shared folder?

Thanks again.

Dave Drager

You can open a window in explorer and type in the url of the server, for example: “\192.168.1.20″ or “\servername”. This should list the shares on your server and let you access them from Windows.

Reply

Chrishill16

Thanks for your help. I’ve got it all set up as the articles suggest and I’m able to connect to my server using dyndns.

How do I access files on the server (music, movies) from my Windows pc on the same network? I tried to add a new network location but that didn’t work. Ideally I want to be able to store all my music and movies on the server and access them from my pc – is this something to do with the shared folder?

Thanks again.

Reply

Dave Drager

You can open a window in explorer and type in the url of the server, for example: “\\192.168.1.20″ or “\\servername”. This should list the shares on your server and let you access them from Windows.

Reply

Webmasterintexas

I have Ubuntu already installed on this pc. Should I do a complete re-installation of whatever Linux version I want to use if I want to try that clear-OS? THank you for your comprehensible tutorial Dave, I am learning Linux after 10 years of Windows, and what a relief!

Your comment