Linux installation apache server configuration process

Linux installation apache server configuration process

Prepare the bags

Install

Check if Apache is already installed

rpm -qa |grep httpd

Uninstall Apache

rpm -e --nodeps httpd

(-nodeps means ignoring the dependencies of the software)

Create a folder to store rpm packages

cd /

mkdir rpm_dir

Unzip the package

tar -zxvf httpd-2.4.51.tar.gz

tar -zxvf apr-1.7.0.tar.gz

tar -zxvf apr-util-1.6.1.tar.gz

Move Apache's two dependent files apr and apr-util to its srclib folder (note that the folder cannot have a version number, otherwise the system will not be able to find these two software)

mv /rpm_dir/apr-1.7.0 /rpm_dir/httpd-2.4.51/srclib/apr

mv /rpm_dir/apr-util-1.6.1 /rpm_dir/httpd-2.4.51/srclib/apr-util

pcre regular expression library, expat development library for parsing XML files

rpm -ivh pcre-devel-8.32-17.el7.x86_64.rpm --nodeps

rpm -ivh expat-devel-2.1.0-12.el7.x86_64.rpm --nodeps

Switch to the apache decompression directory and compile the installation package

cd httpd-2.4.51

./configure --prefix=/usr/local/apache --with-included-apr

Install Apache

make && make install

Switch to the path where apache is installed and modify the apache configuration

cd /usr/local/apache

vim conf/httpd.conf

Modify the port number:

Modify the root path for accessing the homepage:

Start Apache

You need to first link the startup program to the system startup directory and name it httpd

cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd

Register the apache service and add the following content to the beginning of the file

vim /etc/rc.d/init.d/httpd

#!/bin/sh
 
# chkconfig:35 61 61
 
# description:Apache

Configure Apache to start automatically and add Linux service monitoring

chkconfig --add httpd

View List

chkconfig --list

Start, Restart

service httpd stop

service httpd start

This is the end of this article about installing Apache server on Linux. For more relevant content about installing Apache server on Linux, please search previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Steps to build a file server using Apache under Linux
  • How to install Apache service in Linux operating system
  • 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

<<:  MySQL index pushdown details

>>:  Detailed introduction to CSS priority knowledge

Recommend

Docker uses Supervisor to manage process operations

A Docker container starts a single process when i...

A brief discussion on JavaScript shallow copy and deep copy

Table of contents 1. Direct assignment 2. Shallow...

Specific use of lazy loading and preloading in js

Delayed loading (lazy loading) and preloading are...

How to use Nginx to proxy multiple application sites in Docker

Preface What is the role of an agent? - Multiple ...

How to recover files accidentally deleted by rm in Linux environment

Table of contents Preface Is there any hope after...

MySQL-8.0.26 Configuration Graphics Tutorial

Preface: Recently, the company project changed th...

【HTML element】Detailed explanation of tag text

1. Use basic text elements to mark up content Fir...

VMWare15 installs Mac OS system (graphic tutorial)

Installation Environment WIN10 VMware Workstation...

How to add abort function to promise in JS

Table of contents Overview Promise Race Method Re...

vitrualBox+ubuntu16.04 install python3.6 latest tutorial and detailed steps

Because I need to use Ubuntu+Python 3.6 version t...

Detailed explanation of built-in methods of javascript array

Table of contents 1. Array.at() 2. Array.copyWith...

Detailed explanation of Nginx forwarding socket port configuration

Common scenarios for Nginx forwarding socket port...