Enroll Course

100% Online Study
Web & Video Lectures
Earn Diploma Certificate
Access to Job Openings
Access to CV Builder



Online Certification Courses

How To Build A Linux Web Server With An Old Computer

How to Build a Linux Web Server With an Old Computer. 

How to Make Your Own Web Server With Linux

To build a Linux web server that can be run from home, you’ll need the hardware and an operating system. In addition, web server software should be installed, and a means of accessing the server from the internet set up.

We can break that down into four easy steps you can follow to build your own Linux webserver.

  1. Find an old/unwanted computer
  2. Install a Linux operating system
  3. Set up the application web server software (Apache, PHP, MySQL)
  4. Reach the server from the internet

Let’s get started.

1. Find an Old Computer for Your Linux Web Server

Before choosing a computer to use as a web server, you’ll need to know the minimum requirements of the OS. While Ubuntu is popular, it isn’t lightweight enough. Instead, Lubuntu 19.04 is a stronger option. This is a lighter alternative to Ubuntu, built on the same code.

Lubuntu System Requirements

Lubuntu 19.04 has a minimum requirement of:

  1. 512MHz dual-core processor or better (1GHz recommended, as opposed to 2GHz for Ubuntu)
  2. 4GB system memory
  3. 25GB of free hard drive space
  4. Choice of 32-bit (for older PCs) and 64-bit versions

2. Install a Linux Operating System

Installing Lubuntu is straightforward. Simply grab the ISO file and write it to DVD or a USB flash device, to begin.

These disk images have the latest versions of software, so only a small upgrade should be required after installation. Use the 64-bit version if your computer supports it or the 32-bit version otherwise.

When you’re ready, insert the installation media on your computer and reboot. If you need to change the BIOS settings to boot from the optical drive or USB, then do so. In some cases, a boot media selection menu can be opened.

With the installation media booted, select Install Lubuntu. When prompted, select Download updates while installing and Install 3rd Party Software and then Erase and Use the Entire Disk.

Upon reboot, check for updates. Go to System > Administration > Update Manager > Install Updates. You may need to reboot after installing any updates it has found.

3. Install Linux Web Server Software

While alternatives are available, most websites run on a combination of Apache, MySQL, and PHP (known as LAMP). All three tools can be installed via the Software Center. Launch this 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 various prerequisites: apache2, php5, php5-mysql, and mysql-server. Apply the changes to install the packages.

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

You can alternatively install these tools in the command line. Open a Terminal then:

sudo apt install lamp-server^ -y

Finding the Server’s Local IP Address

While the server is functional, it needs to be visible to the outside world. As such, it is important to keep the server up to date with all regular patches.

First, find the server’s local IP address and set it to something you will later be able to reference. You’ll find the current IP address assigned by your router in the Network Information box.

Find this by clicking on your network connection, then selecting Connection Information. This will pop up a box with your current IP address, network adapter card, broadcast address, gateway, and DNS server. Make a note of the IP address.

Next, edit your connection information to give you a static IP address on your local network. Right-click again, but this time go to Edit Connections. Select the appropriate adapter name (e.g. eth1) and edit those settings.

Select the IPv4 tab and switch the Method to Manual. Click Add then enter the information from your connection settings. Note, however, the IP address will need to be entered differently. Retain the first three octets (the numbers between the dots) but change the last to a high number under 254.

Sharing the Web Folder

Several options are available to access and upload files onto your server. To illustrate the importance of folder permissions, consider sharing the web folder as an option.

It is important to only use this method if your server is on a private network. Be certain no one can connect to it and access your shared folder.

Start by relaxing permissions on the web folder. Open a terminal by pressing Ctrl + Alt + T, then enter:

sudo chmod 777 /var/www

You will be prompted for your password. If correct, the permissions will be updated.

Now go to the file browser and find /var/. Right-click the www folder and then select Sharing options and uncheck it. For security options, you can share it with or without a password. Select Guest access to share the folder without requiring a username and password.

Now, you or anyone else will be able to access the files without a password. For this reason, sharing with a password is recommended for security purposes. 

To view your files, go to the network location //localhost/www.

It will either prompt for your password or allow you access straight to your files, depending on your security settings. These are the same files accessible in your web browser via http://localhost/ (or whatever static IP address you set).

Corporate Training for Business Growth and Schools