Open Source

Open Source Use Case: Intranet Site

by Rudy Hill

Overview

For most of my career I have worked for companies with intranet sites. This internal tool provides employees with quick and easy access to company resources. It also provides a conduit for company-wide communications. However, I have also worked for small organizations and start-ups that did not have an intranet site, making all of the above more difficult.

For those working for a company without an intranet site, this situation provides a great use case for the implementation of open source software. In this post, then, I will give a broad overview of how to spin up an intranet site, as well as provide some suggested resources. As a disclaimer, I will refer to certain solutions and resources, but Rodapa in no way endorses them.  Additionally, some of the terms and descriptions may seem foreign to you, but the intent is not to provide technical training or a step-by-step guide.  Instead, the goal is to get you started with an open source project, and thereby help start you on the path to technology independence.

Concept

The concept behind spinning up an intranet site is the same as that for a website.  The major difference is that your intranet site will be behind your firewall. Additionally, the IP address for your website will be internally generated.

There are many resources on the internet describing how an intranet/website site works. When I first started, reading through these sites felt overwhelming because of the jargon and the matter-of-fact tone. Over time (just last week), though, I have come to see the simplicity of how a site works. From a conceptual basis, an intranet site is nothing more than a file sharing framework. Most people are familiar with the famous “G-drive” or other choice descriptions for the shared folder of a company. Similarly, an intranet site provides a file sharing mechanism. The one major difference, though, is that the manner of accessing files is purposeful and directed. The user gets to different files or pages by clicking on links or buttons (true from a user experience). Also, unlike a file system with many file types, an intranet site serves up very specific file types such as HTML and PHP. Each HTML page can be thought of as a self-contained document that uses hypertext markup language(HTML) to present information.  This a fancy way of say that each document entry is marked to indicate its purpose in the document: paragraph, heading, break, etc. There is more to HTML, but this is the basic concept.

Now, with regard to the file sharing concept, a site needs a web server to coordinate access to your files. This web server is a piece of software installed on an actual machine (client or server), or virtual machine (vm). The web server functions as a switchboard of sorts, directing user requests to files. Specifically, a web server is set up to direct requests to a specific folder on a machine in order to access files and subfolder files. More, this main folder is accessed via an ip address (manually or automatically assigned by internal network and a port). An example of this would be an address typed into your browser such as “myintranet:80” or “172.55.55.555:80”. The part to the left of the “:” describes the location of the machine on a given network.  To the right of the “:” you have the port number, which is simply a virtual entry point into the machine to access a specific service (80 is a default port for a web server). So, as long as an internal user is on the same network as the machine, he/she can access the site.

With regard to the file structure, a basic setup of a web server directs a user to the “index.HTML or index.PHP” file under the main folder, which is usually labeled “www”, “htdocs”, or “HTML”. Technically, an intranet site folder can live anywhere on the machine, but there are certain conventions followed. Below is a quick example of a folder layout:

HTML(www or htdocs)

            index.HTML

            finance_folder

                        index.HTML

                        forecast.HTML

            accounting_folder

                        index.HTML

                        results.HTML

                        ap_folder

            treasury_folder

                        index.hmtl

                        syndicate.HTML

             CSS (styling folder)

            js (JavaScript folder)

            img (image folder)

Overall, then, an intranet site is nothing more than a file sharing process that serves up specific file types in an organized manner. How pages are created and organized is an art that depends on knowledge of HTML, CSS, and JavaScript. To add the power of a database, you will also need to know a server-side language such as PHP, as well as SQL. A great source for beginners who want to learn these skills is w3schools (www.w3schools.com). Although we are not necessarily endorsing this site, it is a go-to-place for free learning. You can practice concepts on this site, as well as cannibalize code by copying and pasting from their site to your project files. 

Implementation

There are several ways to install an actual web server and all of the supporting software such as MySQL and PHP.  For the purposes of this post, we are going to base our example on the installation of XAMPP. Additionally, we are going to assume you are using a Windows server or client.  For those using a Linux server or client, you can use LAMPP or the Linux version of XAMPP.

So, what is XAMPP?  XAMPP is a free open source package that lets you easily install an Apache distribution (web server) that contains MariaDB (similar to MYSQL), PHP and Pearl.  This package, part of the non-profit project Apache Friends, can be easily downloaded for Windows, Linux or OS X. Once you are done downloading it, you can run through the installation steps (please note where the XAMPP files are loaded on your drive).

With XAMPP loaded on your machine, you now have a web server installed, as well as MariaDB, PHP and Pearl. You can now go to a web browser on the machine where the web server is loaded, and enter “localhost:80” to access your default webpage.  For those connecting to the web server outside the machine, but on the Same Network as the machine, they can enter “ip_address:80”. To find the IP address for your machine, you can ask your IT group,  or find it as follow:

   1. Windows

      a. open “Command Prompt”; click Start button, type “cmd”, press Enter

      b. type “ipconfig” and press Enter

      c. look for line that says “IPv4 Address”, right above “Subnet Mask”; your local ip should begin with 10, 172, or 192

    2. Linux

      a. open Terminal and enter “ip addr show” or “ifconfig”

      b. find ip address under “eth0”; your local ip should begin with 10, 172, or 192

To start making changes to your site, simply go to your XAMPP/htdocs folder.  The default page is a file named index.PHP (the setup provides a redirect to another file within the main folder). Once you start learning more about HTML, CSS, and JavaScript, this will all make much more sense. However, at this point you have taken the first major step, which is actually installing the infrastructure that will allow you to now design your intranet site. Moreover, you will begin to see the power of using open source software to provide low-cost solutions for your company. The only cost should be the time you allocate to this project, and the cost of a dedicated machine or vm.

Another thing to note about XAMPP is that it comes with a console. The folks that put out this solution offer a console that helps manage things such as start/stop/restart the web server, changes to config file, changing the port, etc. These things are easily done via the Command Prompt (the black screen) or Terminal.  For beginners, though, it is perfectly acceptable to use the console to manage your web server (I won’t tell).

Questions/Comments

I know this is a quick overview on a topic that has books dedicated to it. My goal is to provide a quick overview of this topic to get you jumpstarted. You can read every book on this subject, but nothing will get you the gains you need like working through a real-world example (I haven’t been to gym in months, but I still like it as analogy). In this case, XAMPP provides a quick process for installing a web server, as well as provides a console as an administrative tool. The only thing left is to start learning how to create a page by using resources such as w3schools (www.w3schools.com). Also, once you learn about CSS (webpage styling), I recommend you spend some time learning about Bootstrap (free CSS framework).

As you work your way through this intranet project, you may run into a few stumbling blocks. Please feel free to reach out to us at blog@rodapa.com.  We at Rodapa would be more than happy to support your effort in installing open source software as a way to provide your company with targeted and cost-effective solutions. 

Thank you for reading this blog post and be on the lookout for our next video tutorial, showing how to spin up a web/intranet site via AWS (Amazon Web Services).

Note: this is also a great project for kids 

Please send questions or comments to blog@rodapa.com