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

Talk about implicit conversion in MySQL

In the course of work, you will encounter many ca...

How to connect to MySQL using C++

C++ connects to MySQL for your reference. The spe...

Detailed explanation of HTML's <input> tag and how to disable it

Definition and Usage The <input> tag is use...

MySQL uses custom sequences to implement row_number functions (detailed steps)

After reading some articles, I finally figured ou...

Share 5 helpful CSS selectors to enrich your CSS experience

With a lot of CSS experience as a web designer, we...

Example of implementing a virtual list in WeChat Mini Program

Table of contents Preface analyze Initial Renderi...

How to install and configure SSH service in Ubuntu 18.04

Install ssh tool 1. Open the terminal and type th...

How to implement a password strength detector in react

Table of contents Preface use Component Writing D...

How to implement the strategy pattern in Javascript

Table of contents Overview Code Implementation Su...

Detailed tutorial on installing Python 3.6.6 from scratch on CentOS 7.5

ps: The environment is as the title Install possi...

Three ways to share component logic in React

Without further ado, these three methods are: ren...

Use and optimization of MySQL COUNT function

Table of contents What does the COUNT function do...

mysql-canal-rabbitmq installation and deployment super detailed tutorial

Table of contents 1.1. Enable MySQL binlog 1.2. C...