Apache2 Common Compiling parameters interpretation

Source: Internet
Author: User
./configure/
--prefix=/opt/apache2/
--enable-so/
--enable-expires/
--enable-proxy/
--enable-deflate/
--enable-rewrite/
--enable-headers/
&& make && make install

1 default installation, specify prefix only (specify installation path)
Then look at the modules that have been loaded
/opt/apache2/bin/apachectl-t

2 In fact, installation is generally the choice of modules will be required, the above command can know that the default module has been installed, which modules are required. Excerpt a description of the Apache manual:

Reference
Module options
There are two ways to use the module: one is static connection into the core, and the other as the DSO module dynamic loading;
If the compilation contains any DSO modules, the MOD_SO will be automatically included in the core. If you want the core to be able to load DSO,
But do not actually compile any DSO module, you need to explicitly specify "--enable-so=static".

General grammar
In general, you can enable or disable a module using the following syntax:

--disable-module
Disabling module modules (for basic modules only)
--enable-module=shared
Compile module to DSO (available for all modules)
--enable-module=static
Statically connecting module to core (for extended and experimental modules only)
--enable-mods-shared=module-list
Compile all modules in Module-list into DSO (available for all modules)
--enable-modules=module-list
Module-list is statically connected to the core (available for all modules)

The above module-list can be:
(1) List of module names delimited by quotation marks and separated by a space
--enable-mods-shared= ' headers rewrite DAV '
(2) "most" (most modules)
(3) "All" (all modules)
--enable-mods-shared=most

The default does not choose the module, it will install a basic module, generally required, if you choose Most, then include the basic module and expansion module, if all, it is really all ^_^
Select the DSO way there will be a bunch of loadmodule, they do not need to be able to comment out
In fact, we usually choose to install which expansion module is good, which is useful.

--enable-expires/
(can add file expiration limit, effectively reduce server pressure, cache on the client side, the validity period will not access the server again, unless press F5 refresh, but also cause the file update is not timely)
--enable-proxy/
(the agent function is necessary because it can handle cross-domain problems and can detach some other request processing)
--enable-deflate/
(compression function, Web page can achieve 40% compression, save bandwidth cost, but will be a little increase in CPU pressure)
--enable-rewrite/
(Can be done again, more practical, file changes are very good)
--enable-headers/
(File header information overwrite, compression function required)

Other extension functions can be referred to the manual, not one of the descriptions, only describes the Aquan feel more practical extension modules, the following is the extract of the configuration method (for reference only):

############# gzip ############
<location/>
Setoutputfilter DEFLATE
Browsermatch ^MOZILLA/4 gzip-only-text/html
Browsermatch ^mozilla/4/.0[678] No-gzip
Browsermatch/bmsie!no-gzip!gzip-only-text/html
Setenvifnocase Request_uri/. (?: Gif|jpe?g|png|swf|exe|ico) $ no-gzip dont-vary
Header Append Vary user-agent env=!dont-vary
</Location>

############# expire ############
<ifmodule expires_module>
Expiresactive on
ExpiresDefault "Access plus 1 day"
Expiresbytype image/gif "Access plus 1 month"
Expiresbytype image/jpeg "Access plus 1 month"
Expiresbytype image/png "Access plus 1 month"
Expiresbytype text/html "Access plus hours"
Expiresbytype text/css "Access plus hours"
Expiresbytype text/javascript "Access plus hours"
</IfModule>

############ Proxy
#ProxyPass/aslibra Http://aslibra.com/blog
#ProxyPassReverse/aslibra Http://aslibra.com/blog

############ rewrite
Rewriteengine on
Rewriterule ^/blog/test[0-9]{1,}/.htm$/blog/index.php

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.