Introduction

Hello, I'm Ushii.
In the previous article, I introduced how to create a "box" for your own server.
This time, I would like to talk about changing the self-made server from a "box" to a "server".
Specifically, "Building a Web Server".

Building a web server

First, let me state that the server works by using software.
One of the essential software is "OS (Operation System)".
I think most people have heard the word "OS" and actually use it.
OS is essential software for computer devices such as personal computers and smartphones, and well-known OSs include Windows, Android, and iOS.

First, let's install this "OS" on the server.
The OS installation procedure is very simple, so I will not introduce it in this article.
*This time, I am using the OS called CentOS7.2.

Once the OS installation is complete, it's time for the real thing!
Build a web server!
As for the movement of the Web server, I aimed to make it as shown in Figure 1.

Fig. 1 Target behavior of Web server

Description of Figure 1:
(IP Address; Web Server = 192.168.0.10, PC = 192.168.0.20)
(1) Access the web server from your PC (Specify the IP address of the web server [192.168.0.10])
(2) Web server provides information (home page) to PC
→ The homepage is displayed on the PC.


The procedure for building the web server is as follows.
Since CentOS7.2 is a Linux-based OS, it is operated by commands.


◆ Web server construction procedure
1. Install the web server application “Apache”
·command" yum install httpd

2. Apache configuration
·command" vi /etc/httpd/conf/httpd.conf” to open the configuration file.
・After opening the file, set the following items.

Figure 1 Group of parts that make up the server

3. Create file “index.html”
・Create a file with the command "vi /var/www/html/index.html"
→ write content:

ex) The actual notation is ⇒ like this!

Writing content
actual display

·supplement:
index.html is the file that indicates the "top page" of the home page, and is displayed first when accessed.
Even when the specified page (file) is not found, index.html is displayed.


(4. Setting access restrictions)
If you want to allow access only from a specific IP address, make the following settings.

・Execute the command "vi /etc/httpd/conf/httpd.conf" to open the configuration file.
・After opening the file, set the following items.

*IP: Access is permitted only from 192.168.0.20 (PC).

Five. start apache
·command" systemctl start httpd.service”.
*If you want Apache to start automatically when the server starts, don't forget to execute the command "systemctl enable httpd.service"!

Web server construction is now complete!

If everything is set up properly, your server should look something like Figure 1!
If it is not functioning as a web server,
Please review the settings of security functions such as "firewall" and "SELinux" on the server.
I've had a lot of trouble with firewalls...

Now let's take a closer look at the interaction between the web browser on your PC and the web server. (Figure 2)

Figure 2 Communication between a web browser on a PC and a web server

When accessing the web server from a web browser on a PC, messages are exchanged as shown in Figure 2.
In fact, information is provided not only from Web servers, but also from PCs.

at the end

This time, I wrote an article about building a web server.
From the next time onwards, I will write an article about Mellanox products, so please look forward to it.

Profile of Mellanox

◇本社:ヨークナム (イスラエル)、サニーベル (アメリカ)

◇広帯域、低レイテンシーインターコネクトのリーディングカンパニー
・EDR 100 Gbps InfiniBand、/ 100 ギガビット Ethernet
・アプリケーションのデータ処理時間を大幅に削減
・データセンタサービス基盤の ROI を劇的に向上

Introduction page of Mellanox