Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of installing and configuring Apache under CentOS

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the relevant knowledge of the method of installing and configuring Apache under CentOS, the content is detailed and easy to understand, the operation is simple and fast, and it has a certain reference value. I believe you will have something to gain after reading this article on how to install Apache and configure Apache under CentOS. Let's take a look.

Basic server is installed on the centos system. There are many missing components that are necessary before installing apache. Here is a list of the components that need to be installed this time.

Apache-aprapache-apr-utilperl-pcreapache

Download apache on the official website

Download the stable version of httpd-2.4.9.tar.gz and upload it to the server / usr/packages directory.

Install apache:

# tar-xvzf httpd-2.4.9.tar.gz# cd httpd-2.4.9#. / configure-prefix=/usr/local/apache-enable-module=so-enable-module=rewrite

Check the compilation environment for errors:

Checking for apr... Noconfigure: error: apr not found. Please read the documentation.

Due to the lack of apr (apache portable runtime), you need to download apr and apr-util.

Download address: http://apr.apache.org/download.cgi

Download apr-1.5.1.tar.gz, apr-util-1.5.3.tar.gz

Install apr:

# tar-xvzf apr-1.5.1.tar.gz# cd apr-1.5.1# .configure # make# make install

Install apr-util:

# tar-xvzf apr-util-1.5.3.tar.gz# cd apr-util-1.5.3#. Configure-- prefix=/usr/local/apr-util-- with-apr=/usr/local/apr# make# make install

Check the compilation environment for errors again:

Configure: error: pcre-config for libpcre not found. Pcre is required and available from http://pcre.org/

Missing pcre

Install pcre:

# unzip-o pcre-8.35# cd pcre-8.35#. / configure-- prefix=/usr/local/pcre# make# make install

Add parameters when checking the compilation environment again:

-with-apr=/usr/local/apr/-with-apr-util=/usr/local/apr-util/-with-pcre=/usr/local/pcre

There is no error:

# make# make install

Installation complete.

This is my first installation, lack of related components, the next installation directly install components, and finally install apache, this will be smoother.

Start apache

# cp / usr/local/apache/bin/apachectl / sbin/# apachectl start

Configure to start the apache service when the system starts

# vi / etc/rc.d/rc.local

Add: / sbin/apachectl start to the last line

Modify the apache default site directory

Modify / usr/local/apache/conf/httpd.conf file

Change to

Execute a command

# apachectl restart

This is the end of the article on "how to install and configure Apache under CentOS". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to install and configure Apache under CentOS". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report