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

A brief discussion on VUE uni-app conditional coding and page layout

Table of contents Conditional compilation Page La...

VMware Workstation 14 Pro installs CentOS 7.0

The specific method of installing CentOS 7.0 on V...

Vue implements a scroll bar style

At first, I wanted to modify the browser scroll b...

Summary of Vue's common APIs and advanced APIs

Table of contents nextTick Mixins $forceUpdate se...

Introduction to HTML DOM_PowerNode Java Academy

What is DOM? With JavaScript, you can reconstruct...

Notes on using $refs in Vue instances

During the development process, we often use the ...

How to prohibit vsftpd users from logging in through ssh

Preface vsftp is an easy-to-use and secure ftp se...

W3C Tutorial (12): W3C Soap Activity

Web Services are concerned with application-to-ap...

jQuery implements font size adjustment case

This article shares the specific code of jQuery t...

Awk command line or script that helps you sort text files (recommended)

Awk is a powerful tool that can perform some task...

Vue+flask realizes video synthesis function (drag and drop upload)

Table of contents We have written about drag and ...

Computed properties and listeners details

Table of contents 1. Calculated properties 1.1 Ba...

CSS to achieve the sticky effect of two balls intersecting sample code

This is an effect created purely using CSS. To pu...