Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

10.1 Web site service program


May 24, 2021 That's what Linux should learn



In 1970, ARPANET ( Arpanet ) , the predecessor of the Internet , was in its inf development and began to open up to the non-military sector , with many universities and businesses beginning to access it. Although the size of the Apa network (only 4 host network operation) is not as mature as the current LAN, but it still for the progress of network technology has laid a solid foundation.

Most of us must have come into contact with the Internet by visiting websites. T he Web site services we usually visit are Web web services, which generally refer to services that allow users to access various resources on the Internet through a browser. As shown in Figure 10-1, a Web network service is a passively accessed service program that responds only when it receives a request from another host on the Internet, and the Web server that eventually provides the service provider transmits the requested content to the user via HTTP (hyper-text transfer protocol) or HTTPS (secure hyper-text transmission protocol).

Currently, programs that can provide Web network services include IIS, Nginx, and Apache. A mong them, IIS (Internet Information Services, Internet Information Service) is the default Web service program in Windows system, which is a graphical website management tool, not only to provide Web site services, but also to provide FTP, NMTP, SMTP and other services. However, IIS can only be used in Windows systems, and the name of our book is "Linux should learn this way", so it is not within our scope of study.

10.1 Web site service program

Figure 10-1 Communication between the host and the Web server

On October 4, 2004, Nginx, a Web services program developed for Russia's well-known portal site, was born. N ginx program as a lightweight website service software, because of its stability and rich features and quickly occupy the server market, but Nginx is most recognized as the system resource consumption is low and consumable capacity, so it has been the domestic portal sites such as Sina, NetEase, Tencent and so on. This book will cover the Nginx service program in Chapter 20.

Apache is one of the most marketable Web service programs available today, widely recognized across platforms and security, with fast, reliable, and simple API extensions. F igure 10-2 shows the apache Service Foundation's famous Logo, whose name is taken from the Native American language and implies superior combat strategy and infinite patience. Apache service program can run in Linux system, UNIX system and even Windows system, supports IP, domain name and port number-based virtual host functions, supports a variety of authentication methods, integrates proxy server modules, secure Socket layer (SSL), can monitor service status and custom log messages in real time, and has a variety of rich module support.

Apache program is the default Web service program in RHEL 5, 6, 7 systems, and its relevant knowledge points have always been the focus of RHCSA and RHCE certification exams.

10.1 Web site service program

Figure 10-2 Apache Software Foundation's famous Logo

In summary, Nginx service program as a late star, has won the trust of a large number of station chiefs through their own advantages and efforts. The online learning site that is https://www.linuxprobe.com this book is based on the Nginx service program deployment, I have to say that Nginx is really great!

However, apache program as an old Web service program, on the one hand, in the Web server software market has a fairly high share, on the other hand, Apache is the default Web service program in the RHEL 7 system, but also the RHCSA and RHCE certification exam required content, so whether from the practical application point of view or from the point of view of dealing with the Red Hat certification exam, we need to study the deployment of Apache service program, and dig deep into its rich available features.

Step 1: Mount the system image from the disc device to the /media/cdrom directory.

root@linuxprobe mkdir -p/media/cdrom (root@linuxprobe-) mount /dev/cdrom/media/cdrom mount: /dev/sr0 is write-protected, mounting read-only Step 2: Use the Vim text editor to create a profile for the Yum repository, the meaning of the specific parameters in the following command can be referred to in section 4.1.4.

(root@linuxprobe. s/etc/yum.repos.d/rhel7.repo (rhel7) name=rhel7 baseurl=file//media/cdrom enabled=1 gpgcheck=0 Step 3: Start installing the Apache service program. N ote that when installing with the yum command, the package name of the Apache service that follows the command is httpd. If you execute the yum install apache command directly, the system will report an error.

[root@linuxprobe ~]# yum install httpd Loaded plugins: langpacks, product-id, subscription-manager .................. O mit some of the output information... Dependencies Resolved

  1. Package Arch Version Repository Size
  2. ================================================================================
  3. Installing:
  4. httpd x86_64 2.4.6-17.el7 rhel 1.2 M
  5. Installing for dependencies:
  6. apr x86_64 1.4.8-3.el7 rhel 103 k
  7. apr-util x86_64 1.5.2-6.el7 rhel 92 k
  8. httpd-tools x86_64 2.4.6-17.el7 rhel 77 k
  9. mailcap noarch 2.1.41-2.el7 rhel 31 k
  10. Transaction Summary
  11. ================================================================================
  12. Install 1 Package (+4 Dependent packages)
  13. Total download size: 1.5 M
  14. Installed size: 4.3 M
  15. Is this ok [y/d/N]: y
  16. Downloading packages:
  17. --------------------------------------------------------------------------------
  18. ………………省略部分输出信息………………
  19. Complete!

Step 4: Enable the httpd service program and add it to the boot startup item so that it can run with the system up and running, thus continuously providing web services to the user:

(root@linuxprobe.) systemctl start httpd s.root@linuxprobe s.systemctl enablel httpd ln -s'/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.target. Wants/httpd.service' You can enter http://127.0.0.1 in the address bar of the browser (in this case, Firefox browser for example) and press the enter key to see the default page of the httpd service provider used to provide Web services, as shown in Figure 10-3.

10.1 Web site service program

Figure 10-3 the default page of the httpd service program