Adding modules to Apache already in production

Source: Internet
Author: User

In many cases it is necessary to add modules to Apache already in production, and the stupidest way to do this is by recompiling the entire Apache package, but there are more precise ways to do it.

First of all to get the source file of the module, here with Mod_dir as an example, the other module method is the same

1. Enter the source file directory

#cd/root/src/httpd-2.0.55/modules/mappers

2. Using Apache's APXS command to process mod_dir.c source files

#/usr/local/apache/bin/apxs-c mod_dir.c

3, the use of GCC compiler generated mod_dir.so this important stuff

#gcc-shared-o mod_dir.so MOD_DIR.O

4, again using the Apache APXS command, the compiled shared library installed into the Apache modules directory, he will modify the httpd.conf configuration file.

#/usr/local/apache/bin/apxs-i-a-n Dir_module mod_dir.so

5, APXS has a bug, so finally also need to manually modify the httpd.conf file, #loadmodule mod_dir_module modules/mod_dir.so modified to LoadModule dir_module modules /mod_dir.so


Using this method we can cross-conveniently compile the modules we need into the current version of Apache. An upgrade to the old Apache environment is useful.



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.