"L" is for Linux
Tags: todayilearned, codenewbie, security, sideprojects
Published: 2020-12-25 00:13:22

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

[:x:]__Linux__
[:x:]Apache
[:x:]MySQL
[:x:]PHP

As stated in the intro post for this series, "L" represents Linux in LAMP software stack. LAMP (__L__inux, __A__pache, __M__ySQL, __P__HP) 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." <sup>[5](#L5)</sup>

## <a name="TOC">Table Of Contents</a>
[Step 1: Picking out the Server's OS](#S1)
[Step 2: OS Install](#S2)
[Step 2.1: Setting up network access](#S21)
[Step 3: The Install](#S3)
[Step 4: Ping Test](#S4)






## <a name="S1">Step 1: Picking Out the Server's OS</a>
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](https://www.smarthomebeginner.com/images/2015/02/best-home-server-software-ft.jpg)

As far as free server OS options it depends a lot on your intended use.
- If you want a media storage server specifically you could chose [Plex Media Server](https://www.plex.tv/), [FreeNAS](https://www.freenas.org/), or [Kodi Open Source Home Theatre Software](https://kodi.tv/) to name a few.
- If you want some flexibility you might try some server management software like [Amahi Home Server](https://www.amahi.org/) that is installed on top of Fedora or CentOS servers and comes pre-installed with a lot of services already.
- If you want to configure it yourself, like me, you might choose [Ubuntu Server Edition](https://ubuntu.com/download/server), [ClearOS](http://www.clearfoundation.com/Software/overview.html), or [Fedora Server](https://getfedora.org/) to name a few.

After some research on the abilities of the server software, I decided on [Ubuntu Server Edition](https://ubuntu.com/download/server) 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](#TOC)}




## <a name="S2">Step 2: Pre-OS Install</a>
Server install will very a lot depending on the one you chose, but for my [Ubuntu Server Edition](https://ubuntu.com/download/server) 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.



### <a name="S21">Step 2.1: Setting up Network access</a>
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](https://target.scene7.com/is/image/Target/GUEST_88e15c08-9c51-45ca-a293-af115d3eca96?wid=325&hei=325&qlt=80&fmt=webp)


{[Back to the ToC](#TOC)}










## <a name="S3">Step 3: The Install</a>
Thanks to the ["Install Ubuntu Server" tutorial](https://ubuntu.com/tutorials/install-ubuntu-server#1-overview) 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](https://ubuntu.com/download/server)
2. Burning it to a USB or CD (I used [BalenaEtcher](https://www.balena.io/etcher/) 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](https://dev-to-uploads.s3.amazonaws.com/i/nir41hh64vnj719092qy.png)
_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](#TOC)}









## <a name="S4">Step 4: Ping Test</a>
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](https://dev-to-uploads.s3.amazonaws.com/i/82uihwpdruwtn2303rfp.png)
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](#TOC)}





<hr>
Success! The __L__inux OS install is done and it's on to __A__pache.

[:o:]__Linux__
[:x:]Apache
[:x:]MySQL
[:x:]PHP






<hr>

Happy Hacking
![Happy Hacking ^_^](https://media.giphy.com/media/l3vRmVv5P01I5NDAA/giphy.gif)


### Resources:
<a name="L1">1.</a> https://www.smarthomebeginner.com/best-home-server-software-os/
<a name="L2">2.</a> https://www.technorms.com/77526/home-server
<a name="L3">3.</a> https://ubuntu.com/tutorials/install-ubuntu-server#1-overview
<a name="L4">4.</a> http://net-tools.sourceforge.net/
<a name="L5">5.</a> https://www.ibm.com/cloud/learn/lamp-stack-explained



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