Apache has been installed and put into operation, but later found that some modules are not loaded, of course, there are two methods: 1. first, completely recompile Apache and then install Apache. the compilation module is the SO file, and the extension module is loaded using the LoadModule command. Here we will only talk about the second scenario: now we need to enable the deflate module of Apache, that is, compressing the output, to speed up website download and save the network bandwidth server RedHatAS4Aapache installed on/usr/loc
Apache has been installed and put into operation, but later found that some modules are not loaded, of course, there are two methods:
1. Completely recompile Apache and then install
2. The compilation module is the SO file, and the extension module is loaded using the LoadModule command.
Here we will only talk about the second method.
Scenario: now we need to enable the deflate module of Apache to compress the output to speed up website download and save network bandwidth.
Server Red Hat AS 4
Aapache is installed in/usr/local/apache2/
Apache installation source files are saved under/usr/local/soft/httpd-2.2.8/
Requirement: load the mod_deflate.c module to enable Apache to support compressed output.
1. Check/usr/local/apache2/conf/httpd. conf and find no similar code: LoadModule deflate_module modules/mod_deflate.so.
This module is not loaded by Apache.
2. Check/usr/local/apache2/modules/. The mod_deflate.so file is not found in this directory. This indicates that this module has not been compiled. Compile the module first and then download it.
3. first enter the directory where the mod_deflate.c file is located:
Root@localhost.localdomain ~ /] # Cd/usr/local/soft/httpd-2.2.8/modules/filte r
4. Use the apxs file to compile the target Module
[Root@localhost.localdomain/usr/local/soft/httpd-2.2.8/modules/filters] #/usr/local/apache2/bin/apxs-I-c-a mod_deflate.c
Note:-I installation and-c compilation specify the module-a activation module (that is, add the LoadModule command to httpd. conf)
Running result:
................
----------------------------------------------------------------------
Chmod 755/usr/local/apache2/modules/mod_deflate.so
[Activating module 'release' in/usr/local/apache2/conf/httpd. conf]
Indicates that the module is stored as/usr/local/apache2/modules/mod_deflate.so after compilation, and the module is automatically activated in httpd. conf.
Now, check/usr/local/apache2/conf/httpd. conf and you will find that the program has been automatically added.
LoadModule deflate_module modules/mod_deflate.so
5. Restart Apache:
Root@localhost.localdomain ~ #/Usr/local/apache2/bin/apachectl restart
If the module File already exists in step 2, you do not need to compile the module. manually modify httpd. conf and restart Apache.