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

How to build Apache environment under Centos

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, the editor will share with you the relevant knowledge points about how to build an Apache environment under Centos. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look.

Apache is the number one Web server software in the world. It can run on almost all widely used computer platforms, and is one of the most popular Web server-side software because of its cross-platform and security. It is fast, reliable and can compile interpreters such as Perl/Python into the server through a simple API extension.

I. installation

Turn off the firewall of the server before installation.

Systemctl stop firewalldsystemctl disable firewall

Step one:

Install apr

Download:

Wget-c http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.3.tar.bz2

Extract the file:

Tar-jvxf apr-1.6.3.tar.bz2

Detect:

Cd apr-1.6.3./configure-prefix=/usr/local/apr/

Compile:

Makemake install

Step 2:

Install apr-util

Download:

Wget-c http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.bz2

Extract the file:

Tar-jvxf apr-util-1.6.1.tar.bz2

Detect:

Cd apr-util-1.6.3./configure-prefix=/usr/local/apr-util/-with-apr=/usr/local/apr/

Compile:

Makemake install

Step 3:

Install pcre

Download:

Wget-c http://ftp.pcre.org/pub/pcre/pcre-8.42.tar.bz2

Extract the file:

Tar-jvxf pcre-8.42.tar.bz2

Detect:

Cd pcre-8.42./configure-prefix=/usr/local/pcre/

Compile:

Makemake install

Step 4: install httpd

Download:

Wget-c http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29.tar.bz2

Extract the file:

Tar-jvxf httpd-2.4.29.tar.bz2

Detect:

Cd httpd-2.4.29./configure-prefix=/usr/local/httpd/-with-apr=/usr/local/apr/-with-apr-util=/usr/local/apr-util/-with-pcre=/usr/local/pcre/

Compile:

Makemake install

Step 5:

Configure / usr/local/apache2/conf/httpd.confServerName www.examda.com:80 to ServerName localhost:80

Step 6:

Start the apache service

/ usr/local/apache2/bin/apachectl start II. Detection

Use a browser to access the local IP

It works appears! Success

Third, error reporting processing

(1) configure: error: APR not found. Please read the documentation.

This is caused by no installation of apr or failure to install apr. Reinstall apr.

Please check the first step for installation.

(2) configure: error: APR-util not found. Please read the documentation.

This is caused by no installation of apr-util or failure to install apr-util. Reinstall apr-util.

Please check step 2 for installation.

(3) configure: error: no acceptable C compiler found in $PATH

This is caused by no installation of the gcc compiler or failure to install the gcc compiler. Reinstall gcc.

Yum install-y gcc

(4) xml/apr_xml.c:35:19: fatal error: expat.h: there is no such file or directory

This is caused by no installation of expat-devel or failure to install expat-devel. Reinstall expat-devel.

Yum install-y expat-devel

(5) configure: error: Invalid C++ compiler or C++ compiler flags

This is caused by no installation of gcc-c++ or failure to install gcc-c++. Reinstall gcc-c++.

Yum install-y gcc-c++

(6) configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

This is caused by no installation of pcre or failure to install pcre. Reinstall pcre.

Please check step 3 for installation.

These are all the contents of the article "how to build an Apache environment under Centos". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to 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

Development

Wechat

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

12
Report