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 do I compile and install Apache in linux?

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

Share

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

1 preface

Compile and install Apache HTTP Server, the latest version is 2.4.41, you can compile and install apr,apr-util,pcre after installation.

2 preparation work

Three: apr,apr-util,pcre, installed can be skipped.

2.1 apr

Downloads: link

Tar-zxvf apr-1.7.0.tar.gzcd apr-1.7.0./configure-- prefix=/usr/local/apr/aprmake sudo make install

Custom installation location.

2.2 apr-util

Downloads: link

Tar-zxvf apr-util-1.6.1.tar.gzcd apr-util-1.6.1./configure-prefix=/usr/local/apr/util-with-apr=/usr/local/apr/apr

Custom installation location, if you change the default installation location of apr in the previous step, you need to use the

-- with-apr

Specify the installation location of the custom apr.

Then compile and install:

Makesudo make install2.3 pcre

Downloads: link

Tar-zxvf pcre-8.44.tar.gzcd pcre-8.44./configure-- prefix=/usr/local/pcremakesudo make install3 Apache3.1 download

Official website

3.2Unpack tar-zxvf httpd-2.4.41.tar.bz2cd httpd-2.4.413.3 installation. / configure-- prefix=/usr/local/httpd

Because the default installation location of apr has been modified, the apr cannot be found, so use the

. / configure-- help

Check out the options help.

There are a lot of options, but the options you need for apr:

. / configure-- help | grep-I "apr"

So add the option:

. / configure-- prefix=/usr/local/httpd\-- with-apr=/usr/local/apr/apr\-- with-apr-util=/usr/local/apr/util

If the pcre cannot be found, add:

-- with-pcre=/usr/local/pcre

3.4 compile and install make sudo make install3.5 to modify the default configuration vim PREFIX/conf/httpd.conf

Where PREFIX is the installation location. Modify the server name, port, etc., as needed.

Search for ServerName, and the initial configuration can be modified to:

ServerName localhost:803.6 startup service PREFIX/bin/apachectl-k start

PREFIX is the installation location, permission denied please add sudo.

3.7 Test

The browser enters the custom ServerName that you just made:

Successful, what is shown here is htdocs/index.html.

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

Servers

Wechat

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

12
Report