1 , why to use Apxs
We are in the Apache , some modules we do not need, so there is no install, but sometime in the future we need this module, how to do it, we need to re-compile Apache? It's fine if you want to do this, but there's a better way to solve the problem. Using apxs to add the modules you need, this php - phpize is very similar.
to use apxs, your platform must support the DSO feature, and the Apache httpd must have the Mod_so module built in . Take a look
Httpd-l | grep mod_so
If there is nothing , the description is not installed, if there is something on display, the description loaded.
Httpd-m can view modules that have already been loaded
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7C/E8/wKioL1bb71nAVo1GAAEEY4KoNvU326.jpg "title=" Add module 1.jpg "alt=" wkiol1bb71navo1gaaeey4konvu326.jpg "to Apache/>
Grammar:
[[Email protected]]# APXS
apxs-g [-S name=value]-n modname
apxs-q [-S name=value] query ...
apxs-c [-S name=value] [-O dsofile] [-I incdir] [-D name=value] [-L-libdir] [-L-libname] [-wc,compiler-flags] [-wl,linker-flags] Files ...
apxs-i [-S name=value] [-N modname] [-a] [-a] dso-file ...
APXS-E [-S name=value] [-N modname] [-a] [-a] dso-file ...
Some parameter description:
It explicitly sets the module name for the-I (install) and -g (Template generation) options. for the-G option, it is required; for the-i option,the APXS tool will determine at least the name of the module by its file name.
Query For information about a certain APXS setting. The query parameter can be one or more of the following strings:CC, CFLAGS, Cflags_shlib, Includedir, Ld_shlib, Ldflags_shlib,libexecdir, Libs_ Shlib, Sbindir, Sysconfdir, TARGET. This parameter is used to manually query for certain settings. For example, to manually process Apache 's C header file, you can use it in Makefile
This option generates a subdirectory named name ( see option -N) and two files in it: One is a template module source program named MOD_NAME.C, Can be used as a template for building your own modules, or as a good starting point for learning to use the APXS mechanism, and the other is the corresponding Makefilefor compiling and installing this module.
This option indicates that a compilation operation is required. It first compiles the C source program (. c) files for the corresponding target code file (. o), and then connects the target code with the remaining target code files (. O and. a) in files. )to generate the dynamic shared object Dsofile. If you do not specify the-o option, this output file name is inferred from the first file name in files, so, by default, it will generally be mod_name.so
This option indicates the need to perform an installation operation to install one or more dynamic shared objects into the server's modules directory.
This option automatically adds a LoadModule line to the httpd.conf file to activate the module, or, if this line already exists, enables it.
similar to the-a option, but it adds a LoadModule instruction prefixed by a pound sign (#), thatis, the module is ready but is still disabled.
This option means that an edit operation is required, which can be used in conjunction with the-a and -a options, similar to the-I operation, to modify Apache 's httpd.conf configuration file, but this module is not installed.
2 , add Apache Module
Extract directory to Apache installation files
Directory of CD Apache/modules/proxy
[Email protected]]#/usr/local/apache2/bin/apxs-c-i mod_proxy_balancer.c
The following instructions appear to be installed.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7C/E8/wKioL1bb76nBGa-uAAE0T-UpjOE317.jpg "title=" Add module 2.jpg "alt=" wkiol1bb76nbga-uaae0t-upjoe317.jpg "to Apache/>
at the same time the modules directory should also have the . So file you just added.
re-check the httpd.conf file for the corresponding, if not, manually add or remove the original comment
LoadModule proxy_balancer_modulemodules/mod_proxy_balancer.so
adding modules to Apache