These days Web Servers are more than just that. Web Servers can be used for a variety of things, including be a repository for files that can be used by your infrastructure devices, such as switches, compute, and storage.
In this blog we’ll be installing the NGINX Web application on a CentOS VM (yes…I know). As a note – the Web Server install in this case in not Internet (Public) facing in the traditional sense, ok? To use NGINX in all its glory, you might want to visit there official website: www.nginx.com.
Again, what we’re doing is building this Web Server for the purposes of holding configuration files for our infrastructure devices.
Alright – so let’s get started. Normally, I would show a diagram, but all we’re doing is setting up our webserver for a later blog posting. So let’s begin:
Task 1: Download and install CentOS 7 from: https://www.centos.org/download/
I normally choose the ‘Minimal ISO’ because it’s about 800MB compared to 8Gigs of the ‘Everything ISO’
Once installed. It’s best to perform an update and install net-tools
Task2: Install the EPEL release for installing NGINX
Run the following command for the epel release
Task 3: Install NGINX service
After the epel release, install the NGINX services with the following command
Task 4: Start NGINX Service
Let’s start the NGINX service by issuing the following command
Verify the service with
As you can see, next to active – our NGINX service is running, yeah!
Task 5: Verify you can reach your NGINX server via a web browser
Open a web browser and enter the ip address of your web browser. From me it will be http://192.168.92.132
Note: If you can’t reach it, probably you might want to check the firewall service on your CentOS VM and clear it using
If you’re all set, then enter your IP, your default web Server page should look like this:
If you notice the default location of this web file (index.html). It’s located at: /usr/share/ngnix/html. In this directory you’ll see a few files to which you can modified to remove the test page we just saw.
If we look into that directory we’ll see the following:
Notice the index.html? Well, this is our default homepage as shown above. But for our purposes, this webserver is not public facing. To be honest – I’m not much of a web designer either so making great looking web pages is not my thing 🙂 . Again, the purpose is to act as a repository to hold files so our infrastructure devices can download them. Such file will be patches, startup scripts, ssh keys for automation tools like Anisble (hummm), and etc…
Task 6: Rename index.html and delete it.
We’ll do is copy & rename the index.html to index.html.orig. I do this because maybe, just maybe, down the road I’ll delve in web building a bit more.
Then we’ll have to delete the index.html file
Task 7: Add files or directories and verify you can see the file/directory listing
From here you can simply create/add files (or even make additional directory structures) in this directory [/usr/share/nginx/html] and they will appear on the webpage.
When we go back to the webpage, refresh – you’ll see your files listed. Notice my file called Start-your-NGIN…X.
To test if the file will download just click on a file.
Alright – now you have your webserver up & ready for ‘internal’ use. Just add your files for your infrastructure devices and begin automating various aspects of your overall Data Center infrastructure.