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 compile apache2.4 with source code

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

How to use source code to compile apache2.4, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

[root@Jaking12 ~] # yum install-y gcc pcre pcre-devel expat-devel bzip2 openssl-devel zlib* libtool [root@Jaking12 src] # rz [root@Jaking12 src] # tar xvf apr-1.7.0.tar.gz [root@Jaking12 src] # lsapr-1.7.0 apr-1.7.0.tar.gz [root@Jaking12 src] # cd apr-1.7.0 [root@Jaking12 apr-1.7.0] #. / configure-- prefix=/usr / local/apr [root@Jaking12 apr-1.7.0] # make [root@Jaking12 apr-1.7.0] # make install [root@Jaking12 apr-1.7.0] # cd.. [root@Jaking12 src] # rzrz waiting to receive. Zmodem trl+C 541 KB 541 KB/s 00:00:01 0 Errors.. [root@Jaking12 src] # lsapr-1.7.0 apr-1.7.0.tar.gz apr-util-1.6.1.tar.gz [root@Jaking12 src] # tar xf apr-util-1.6.1.tar.gz [root@Jaking12 src] # lsapr-1.7.0 apr-1.7.0.tar.gz apr-util-1.6.1 apr -util-1.6.1.tar.gz [root@Jaking12 src] # cd apr-util-1.6.1 [root@Jaking12 apr-util-1.6.1] #. / configure-- prefix=/usr/local/apr-util-- with-apr=/usr/local/apr [root@Jaking12 apr-util-1.6.1] # make [root@Jaking12 apr-util-1.6.1] # make install more options are available through. / configure-- help. Unlock the official compilation options document http://httpd.apache.org/docs/current/programs/configure.html--prefix=/usr/local/apache-- sysconfdir=/etc/httpd / / specifies the path in which the configuration file is installed. If not specified, the configuration file is in the directory where the program is installed; for example, specify the / etc directory-- with-apr=/usr/local/apr / / specify the dependent apr path. Note that the path must be specified, otherwise the compilation will automatically find the apr under / usr instead of the compiled high version of apr. The following is the same as-- with-apr-util=/usr/local/apr-util-- with-mpm=MPM / / specifies the default [prefork | worker | event]. For example, all three MPM modules are compiled. Use this to specify which with-pcre / / dependent pcre library is used by default to solve regular expression problems. # # install pcre-devel (regular expression library compatible with Perl)-enable-so / / Open the so module and enable the dynamic loading module function-enable-ssl / / enable the ssl feature. Note to install first. Https uses-- enable-cgi / / enables the cgi function, and uses-- enable-cgid / / mpm that works in a non-threaded manner-- enable-cgid / / mpm that works in a thread (worker/event)-- enable-rewrite / / supports URL rewriting-- enable-zlib / / general compression mechanism-- enable-module=most / / [all | most | …] Specify which modules are enabled. You can specify a specific module name, or you can use all to enable all modules, and most means to enable most commonly used modules. Generally, you can use most-enable-mpms-shared=all / / to enable the mode supported by MPM, which mpm (prefork,worker,event) is enabled, and when using worker or event, you need to compile php in another way (using the-enable-maintainer-zts option when compiling)-- enable-deflate / / transport compression mechanism to save bandwidth to provide compressed transmission coding of content to support sites such as html, js, css and so on. Using this parameter will greatly increase the transmission speed and improve the visitor's access experience. This is one of the important options for apache tuning in a production environment [root@Jaking12 apr-util-1.6.1] # cd. [root@Jaking12 src] # rzrz waiting to receive. Zmodem trl+C 8983 KB 8983 KB/s 00:00:01 0 Errors [root@Jaking12 src] # lsapr-1.7.0 apr-1.7.0.tar.gz apr-util-1.6.1 apr-util-1.6.1.tar.gz httpd-2.4.39.tar.gz [root@Jaking12 src] # tar xf httpd-2.4.39.tar.gz [root@Jaking12 src] # lsapr-1.7.0 apr -util-1.6.1 httpd-2.4.39apr-1.7.0.tar.gz apr-util-1.6.1.tar.gz httpd-2.4.39.tar.gz [root@Jaking12 src] # cd httpd-2.4.39 [root@Jaking12 httpd-2.4.39] #. / configure-- prefix=/usr/local/apache24-- enable-so-- enable-ssl-- enable-cgi-- enable-rewrite-- with- Zlib-- with-pcre-- with-apr=/usr/local/apr-- with-apr-util=/usr/local/apr-util-- enable-modules=most-- enable-mods-shared=most-- enable-mpms-shared=all-- with-mpm=event [root@Jaking12 httpd-2.4.39] # make [root@Jaking12 httpd-2.4.39] # make install all components / usr/local/apache24 main configuration file / usr/local/apache24/conf launcher This / usr/local/apache24/bin/apachectl [root@Jaking12 httpd-2.4.39] # ls / usr/local/apache24/bin build cgi-bin conf error htdocs icons include logs man manual modules [root@Jaking12 httpd-2.4.39] # ls / usr/local/apache24/conf/extra httpd.conf magic mime.types original [root@Jaking12 httpd-2.4.39] # ls / usr/local/apache24/bin/ab apxs dbmmanage envvars-std htcacheclean htdigest httpd Logresolveapachectl checkgid envvars fcgistarter htdbm htpasswd httxt2dbm rotatelogs [root@Jaking12 httpd-2.4.39] # ll / usr/local/apache24/bin/apachectl-rwxr-xr-x 1 root dip 3440 Mar 10 16:45 / usr/local/apache24/bin/apachectl

Start apache2.4

[root@Jaking12 httpd-2.4.39] # / usr/local/apache24/bin/apachectlAH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::250:56ff:fe2c:fe97%ens33. Set the 'ServerName' directive globally to suppress this message this is a hint, the problem is not ⊙ o ⊙.

Restart apache2.4

[root@Jaking12 httpd-2.4.39] # / usr/local/apache24/bin/apachectl graceful

View apache2.4 related information

[root@Jaking12 httpd-2.4.39] # netstat-pantul | grep 80tcp 0 0 0.0.0 grep 80tcp 22 0.0.0 LISTEN 807/sshd tcp6 0: 80:: * LISTEN 35199/httpd tcp6 0 0:: 22: * LISTEN 807/sshd [root@Jaking12 httpd-2.4.39] # grep DocumentRoot / usr/local/apache24/conf/httpd.conf # DocumentRoot: The directory out of which you will serve yourDocumentRoot "/ usr/local/apache24/htdocs" # access content that does not live under the DocumentRoot. [root@Jaking12 httpd-2.4.39] # ls / usr/local/apache24/ Htdocsindex.html [root@Jaking12 httpd-2.4.39] # cat / usr/local/apache24/htdocs/index.htmlIt works!

Customize the home page content

[root@Jaking12 httpd-2.4.39] # vim / usr/local/apache24/htdocs/index.htmlIt works!Hello World!

Set up file sharing service

[root@Jaking12 httpd-2.4.39] # cd / usr/local/apache24/htdocs/ [root@Jaking12 htdocs] # lsindex.html [root@Jaking12 htdocs] # touch file {1..10} [root@Jaking12 htdocs] # lsfile1 file10 file2 file3 file4 file5 file6 file7 file8 file9 index.html [root@Jaking12 htdocs] # mv index.html index.html.bak [root@Jaking12 htdocs] # lsfile1 file10 file2 file3 file4 file5 file6 file7 file8 file9 index.html.bak

At this point, the actual combat demonstration source code compilation apache2.4 is complete.

After reading the above, do you know how to compile apache2.4 with source code? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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