Add modules dynamically for Apache under RedHatAS4

Source: Internet
Author: User
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.

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.