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

Ubuntu source code compilation and installation of Apache tutorial

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

Share

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

This article mainly explains the "Ubuntu source code compilation and installation of Apache tutorial", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and study the "Ubuntu source code compilation and installation of Apache tutorial" bar!

Apache installation Guide: http://httpd.apache.org/docs/2.4/install.html

There is a detailed installation process in the installation guide, so here I will just say a few notes:

1. To compile and install apache, some dependent environments must be installed, otherwise many files will not be found in the later compilation:

An introduction to APR (Apache portable Run-time libraries,Apache Portable Runtime) and APR-Util,apr can be found at: http://www.cnblogs.com/iLumia/p/4214886.html download address: http://apr.apache.org/

If the PCRE library does not have pcre installed, please download: http://www.pcre.org first

In addition, there are some disk space requirements, C compiler, time synchronization, Perl5 can be adjusted as needed.

two。 Here are the detailed installation steps:

Here I am used to putting the source code under / usr/local/src and changing directories according to my custom.

1)。 Install apr-1.5.2

Switch to the source directory of apr

Cd / usr/local/src/apr-1.5.2/

Installation and compilation

. / configure-- prefix=/usr/local/apache/aprmake-j4 (set parallel compilation parameters according to the number of cores of your computer × 2 to improve compilation speed) sudo make install

2)。 Install apr-util-1.5.4

Switch to the source directory of apr-util

Cd / usr/local/src/apr-util-1.5.4/

Installation and compilation

. / configure-- prefix=/usr/local/apache/apr-util-- with-apr=/usr/local/apache/aprmake-j4make install

3)。 Install pcre-8.39

Enter the installation directory

Cd / usr/local/src/pcre-8.39/

Installation and compilation

. / configure-- prefix=/usr/local/pcremake-j4make install

4. After installing the dependency, you can install apache.

Enter the apache source directory

Cd / usr/local/src/httpd-2.4.25/

Installation and compilation

We need to specify the location of the dependent package we just installed with the-with parameter

. / configure-- prefix=/usr/local/apache-- with-apr=/usr/local/apr-- with-apr-util=/usr/local/apr-util/-- with-pcre=/usr/local/pcremake-j4make install

At this point, the source code installation of apache is completed, and then we provide the apache service

Add a startup script:

Cp / usr/local/apache/bin/apachectl / etc/init.d/httpd baby named http://www.bbqmw.net/qm_yeqm

Add environment variables:

Echo 'export PATH=$PATH:/usr/local/apache/bin' > / etc/profile.d/httpd.shchmod aquix / etc/profile.d/httpd.shsource / etc/profile.d/httpd.sh

After that, you can manage httpd in a variety of ways, and if you need to boot automatically, add the startup command to / etc/rc.local.

Sudo / usr/local/apache/bin/apachectl start

May report that the port is occupied and the httpd.conf file needs to be modified.

Sudo gedit / usr/local/apache/httpd/conf/httpd.conf

Then change the ServerName line to ServerName 127.0.0.1 80

Change line Listen 80 to Listen 127.0.0.1 80

Then save and start the apache service.

Service httpd start

Note:

If the configuration file cannot be found when starting the service, one way is to copy a configuration file to the appropriate path

Or when you start apache, add the-f parameter to indicate the absolute path of the configuration file.

Thank you for reading, the above is the "Ubuntu source code compilation and installation of Apache tutorial" content, after the study of this article, I believe you on the Ubuntu source code compilation and installation of Apache tutorial this problem has a deeper understanding, the specific use of the need for you to practice and verify. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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