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

Introduction and usage examples of ref and $refs in Vue

Preface In JavaScript, you need to use document.q...

Various transformation effects of HTML web page switching

<META http-equiv="Page-Enter" CONTENT...

Simple example of limit parameter of mysql paging

Two parameters of Mysql paging select * from user...

An article explains Tomcat's class loading mechanism

Table of contents - Preface - - JVM Class Loader ...

A brief discussion on the synchronization solution between MySQL and redis cache

Table of contents 1. Solution 1 (UDF) Demo Case 2...

HTML weight loss Streamline HTML tags to create web pages

HTML 4 HTML (not XHTML), MIME type is text/html, ...

How to install lua-nginx-module module in Nginx

ngx_lua_module is an nginx http module that embed...

10 Best Practices for Building and Maintaining Large-Scale Vue.js Projects

Table of contents 1. Use slots to make components...

What does the "a" in rgba mean? CSS RGBA Color Guide

RGBA is a CSS color that can set color value and ...

18 Web Usability Principles You Need to Know

You can have the best visual design skills in the...

How to use physics engine joints in CocosCreator

Table of contents mousejoint mouse joint distance...

Reasons for the sudden drop in MySQL performance

Sometimes you may encounter a situation where a S...