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

How to install PostgreSQL11 on CentOS7

Install PostgreSQL 11 on CentOS 7 PostgreSQL: The...

How to use the debouce anti-shake function in Vue

Table of contents 1. Anti-shake function 2. Use d...

Vue implements countdown between specified dates

This article example shares the specific code of ...

Simple steps to implement H5 WeChat public account authorization

Preface Yesterday, there was a project that requi...

VMware Workstation download and installation detailed tutorial

Virtual machines are very convenient testing soft...

Detailed explanation of crontab scheduled execution command under Linux

In LINUX, periodic tasks are usually handled by t...

How to use Linux locate command

01. Command Overview The locate command is actual...

React Native JSI implements sample code for RN and native communication

Table of contents What is JSI What is different a...

Achieve 3D flip effect with pure CSS3 in a few simple steps

As a required course for front-end developers, CS...

MySQL data migration using MySQLdump command

The advantages of this solution are simplicity an...

Detailed explanation of the execution principle of MySQL kill command

Table of contents Kill instruction execution prin...

XHTML Getting Started Tutorial: XHTML Web Page Image Application

<br />Adding pictures reasonably can make a ...

Optimization methods when Mysql occupies too high CPU (must read)

When Mysql occupies too much CPU, where should we...

MySQL Practical Experience of Using Insert Statement

Table of contents 1. Several syntaxes of Insert 1...