How to install Apache service in Linux operating system

How to install Apache service in Linux operating system

Download link:

Operating Environment

CentOS 7.6 in VMware virtual machine

SecureCRT

Xftp (Xmanager)

Demand Analysis

Use Apache service to access http

Procedure

1. Mount the CD

[root@localhost ~]# mount /dev/cdrom /mnt

insert image description here

Check whether it is mounted

[root@localhost ~]# df -Th

insert image description here

2. Compile the installation program from the source package (compile and install)

[root@localhost Packages]# yum -y install gcc gcc-c++ make

insert image description here

3. Install HTTP dependency packages, a total of 7 packages

[root@localhost Packages]# rpm -ivh /mnt/Packages/pcre-devel-8.32-17.el7.x86_64.rpm
[root@localhost Packages]# rpm -ivh /mnt/Packages/apr-devel-1.4.8-3.el7_4.1.x86_64.rpm
[root@localhost Packages]# rpm -ivh /mnt/Packages/expat-devel-2.1.0-10.el7_3.x86_64.rpm
[root@localhost Packages]# rpm -ivh /mnt/Packages/libdb-devel-5.3.21-24.el7.x86_64.rpm
[root@localhost Packages]# rpm -ivh /mnt/Packages/cyrus-sasl-devel-2.1.26-23.el7.x86_64.rpm
[root@localhost Packages]# rpm -ivh /mnt/Packages/openldap-devel-2.4.44-20.el7.x86_64.rpm
[root@localhost Packages]# rpm -ivh /mnt/Packages/apr-util-devel-1.5.2-6.el7.x86_64.rpm

insert image description here

4. Use XFTP software to put the http-2.4.25.tar.gz software package into the Linux system

Open Xmanager Enterprise software

insert image description here

Open the Xftp program

insert image description here

If you use it for the first time, you need to create a new one. Fill in the IP address of the virtual machine for both the name and host, change the protocol to SFTP, enter the username and password, and click Confirm to close.

insert image description here

Select 20.0.0.41 in the session and click Connect

insert image description here

Enter /opt in the path box above, enter the opt file, and drag the httpd-2.4.25.tar.gz compressed package file on the desktop into the opt file

insert image description here

5. tar unpacking

Switch to the /opt directory

[root@localhost ~]# cd /opt

Unzip the compressed package to C/opt

[root@localhost opt]# tar xzvf httpd-2.4.25.tar.gz -C /opt

ll Check it out, it already exists

[root@localhost opt]# ll

insert image description here

6. ./configure configuration

Enter the httpd-2.4.25 directory

[root@localhost opt]# cd httpd-2.4.25/

Configure ./configure, where the installation path is added

[root@localhost httpd-2.4.25]# ./configure --prefix=/usr/local/apache

insert image description here

7. Make compilation

Convert to recognizable binary file

[root@localhost httpd-2.4.25]# make

8. make install

Copy the software's executable program, configuration files, help documents and other related files to the Linux operating system

[root@localhost httpd-2.4.25]# make install

9. Use

Enter the /usr/local/apache/bin/ directory

[root@localhost httpd-2.4.25]# cd /usr/local/apache/bin/

Modify the configuration file

[root@localhost bin]# vi /usr/local/apache/conf/httpd.conf

Press i to enter the edit mode, press :set nu to mark the text with line numbers, press :194 to locate line 194, and delete the first character # in line 194 to enable the 80 service agreement.

insert image description here

To start the apachectl service, type twice! Not successful once

[root@localhost bin]# ./apachectl start
[root@localhost bin]# ./apachectl start

insert image description here

Install the client browser

[root@localhost bin]# rpm -ivh /mnt/Packages/lynx-2.8.8-0.3.dev15.el7.x86_64.rpm

This is the client browsing tool

[root@localhost bin]# lynx 127.0.0.1

insert image description here

Disable virtual machine firewall service

[root@localhost bin]# systemctl stop firewalld.service

insert image description here

Enter the computer webpage and enter the virtual machine IP address

insert image description here

Enter the virtual machine and confirm again

insert image description here

Summarize

This concludes this article on how to install the Apache service under the Linux operating system. For more information about installing the Apache service under Linux, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Linux installation apache server configuration process
  • Steps to build a file server using Apache under Linux
  • Detailed explanation of Apache website service configuration based on Linux
  • A brief analysis of the configuration and management of Apache servers under Linux
  • Deployment and configuration of Apache service under Linux

<<:  6 Practical Tips for TypeScript Development

>>:  MySQL Database Basics: A Summary of Basic Commands

Recommend

Extract specific file paths in folders based on Linux commands

Recently, there is a need to automatically search...

Detailed explanation of how to use the calendar plugin implemented in Vue.js

The function to be implemented today is the follo...

MySQL 8.0 Window Function Introduction and Summary

Preface Before MySQL 8.0, it was quite painful to...

Vue implements video upload function

This article example shares the specific code of ...

MySQL 5.7.17 compressed package installation-free configuration process diagram

There are two versions of MySQL database manageme...

Vue folding display multi-line text component implementation code

Folding display multi-line text component Fold an...

Rainbow button style made with CSS3

Result: Implementation code: html <div class=&...

Vue implements graphic verification code login

This article example shares the specific code of ...

Summary of two methods to implement vue printing function

Method 1: Install the plugin via npm 1. Install n...

Vue3 list interface data display details

Table of contents 1. List interface display examp...

React implements a general skeleton screen component example

Table of contents What is a skeleton screen? Demo...

This article will show you the basics of JavaScript: deep copy and shallow copy

Table of contents Shallow copy Deep Copy Replenis...

How to install vncserver in Ubuntu 20.04

Ubuntu 20.04 has been officially released in Apri...