DEV Community

Cover image for "L" is for Linux
DaNeil C
DaNeil C

Posted on • Updated on

"L" is for Linux

Overview

Now that we have some info out of the way in part 1 of this series, it's time to build a server. First up is the OS.

[❌]Linux
[❌]Apache
[❌]MySQL
[❌]PHP

As stated in the intro post for this series, "L" represents Linux in LAMP software stack. LAMP (Linux, Apache, MySQL, PHP) is an open source software stack where each component contributes essential capabilities to an application. Though almost any OS, HTTP server, Database Manager, and data processing software could be used that suites your need the LAMP stack "has a classic layered architecture, with Linux at the lowest level followed by Apache, MySQL, and PHP. Although PHP is nominally at the top or presentation layer, the PHP component sits inside Apache." 5

Table Of Contents

Step 1: Picking out the Server's OS
Step 2: OS Install
Step 2.1: Setting up network access
Step 3: The Install
Step 4: Ping Test

Step 1: Picking Out the Server's OS

Though there are a lot of options for the servers Operating System, I don't need any type of crazy set up and I don't want to spend any money. With this in mind that means that any Windows Server is out as I don't want a Free Trial product and it's about $100+; so I will stick with a Linux/Unix based OS.

Server OS Options

As far as free server OS options it depends a lot on your intended use.

After some research on the abilities of the server software, I decided on Ubuntu Server Edition because I need something that is widely used in production environments. Now it's time to work on installing it onto an old computer I have hanging out in my office.

{Back to the ToC}

Step 2: Pre-OS Install

Server install will very a lot depending on the one you chose, but for my Ubuntu Server Edition it was super straight forward. The only hiccup was that it did not want to install with WIFI as its' main Internet connection point.

Why you ask? This is because the vast majority of NICs (Network Interface Cards) that are in computers are almost all the same, or there is very little variation, so it's easier to have the drivers already as part of the server OS at install. In contrast, basically every WIFI adapter out there is different and it would be next to pointless for an OS to come with drivers for some 200 WIFI adapters when they could have maybe 10 NIC drivers.

There are ways around it if you know the computers NIC interface, buuuuut it's easier just to have a Ethernet cord there for it.

Step 2.1: Setting up Network access

For my server OS install there might was an extra step here because servers don't like to use WIFI as their main connection and my office did not have an Ethernet connection in it.

For my setup, this means that I need a switch to split the Ethernet connection coming into my office. This is easy enough as its a plug-and-play style device and just needs to be plugged in. I take my incoming Ethernet cord and plug it into slot #1 and then add another Ethernet cord into slot #2 for my server computer and one more into slot #3 (respectively) for my client computer.

Server sample image form Targer

{Back to the ToC}

Step 3: The Install

Thanks to the "Install Ubuntu Server" tutorial all the steps are broken down nicely so go there if you need help as I wont go into much detail here. Just follow the tutorial and it explains really well what you might need to do for your setup. For my, I did notice that some steps didn't quite look the same but it worked out just fine.

To follow the tutorial steps as best as able for my system and a basic configuration I did:

  1. Downloading the ISO file in the Manual install
  2. Burning it to a USB or CD (I used BalenaEtcher to burn the ISO to a USB)
  3. Install it on the desired computer following the tutorial steps.
  4. https://paginas.fe.up.pt/~acbrito/laudon/ch8/chpt8-3main.htm
  5. https://www.computerhope.com/jargon/s/server.htm
  6. https://en.wikipedia.org/wiki/Server_(computing)

install complete
Note: This series will used a "headless" server; meaning that it will not have any type of Graphical User Interface and that once it is installed, it will not need a monitor. Because of this all interaction with the server will be done through the server's terminal directly or via SSH from my main "client" computer (Windows).

{Back to the ToC}

Step 4: Ping Test

Once the server is installed it's good to make sure that it's all working and you can interact with it from your client as download the Ubuntu net-tools.

  1. You can ensure it has Internet connectivity in general by running ping 8.8.8.8 (Google's DNS) from the servers terminal or it might be evident during setup if it is connected and working as the Ubuntu Server OS I installed said it needed some updates from version 20.04 to 20.09 during the install. sample updates confirmation
  2. Next I recommend installing the Ubuntu net-tools with apt install net-tools on the server computer. This tool contains the ifconfig command that allows you to see your servers IP address.
  3. Run the ifconfig command once downloaded to view your servers IP address.
  4. Now that you know the server's IP address run the "ping" command from you client computer's terminal with the IP address of your server computer to confirm that your client can see your server. (Something like: ping 192.168.1.14 but will can very depending on your home network.)
  5. Once the client computer can see the server computer, it's good to ping the client computer from the server. Being that my client is a Windows PC I ran ipconfig in my Windows terminal to find its' IP address and then ran ping 192.168.1.15 from my server computer to my client.
    • Note: you might need to restart your server and client for this to work. I tried refreshing the caches manually but restarting fixed an issue that wouldn't let my client PC ping my server. Restarting will force refresh the device's cache.

{Back to the ToC}



Success! The Linux OS install is done and it's on to Apache.

[⭕]Linux
[❌]Apache
[❌]MySQL
[❌]PHP


Happy Hacking
Happy Hacking ^_^

Resources:

1. https://www.smarthomebeginner.com/best-home-server-software-os/
2. https://www.technorms.com/77526/home-server
3. https://ubuntu.com/tutorials/install-ubuntu-server#1-overview
4. http://net-tools.sourceforge.net/
5. https://www.ibm.com/cloud/learn/lamp-stack-explained

Please Note: If anything that I have stated is incorrect please let me know what and why. I would love to learn more about what I may not fully understand yet.

Top comments (0)