Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to add an agent module after installing apache

Shulou Source: shulou.com Published: 2022-06-01 23:43:48 09月19日 Update

This article mainly introduces how to add proxy module after installing apache, the article is very detailed, has certain reference value, interested friends must read it!

Foreword:

After installing apache, some required modules were missing. You need to add modules to apache manually.

Let's take the proxy module as an example to introduce the following addition method.

1. Apache 2.2.3 Directory

My Apache 2.2.3 installation is located in/usr/local/apache. Apache source directory/usr/local/httpd-2.2.3.

2. Add proxy module

To add mod_proxy modules to a running apache, navigate to the modules/proxy directory in the apache source code. Then use apxs to compile and install:

(1) Add mod_proxy.so

/usr/local/apache/bin/apxs -i -c -a mod_proxy.c proxy_util.c After successful installation, the mod_proxy.so file will be generated in the apache modules directory, and a line will be added to httpd.conf:LoadModule proxy_modules/mod_proxy.so mod_proxy.c error message: httpd: Syntax error on line19of/usr/local/apache/conf/httpd.conf: Cannot not load/usr/local/apache/modules/mod_proxy.so into server: /usr/local/apache/module

apxs -i -a -c mod_proxy.c proxy_util.c Problem solved. Because proxy_util.c is the base module, it must be installed first. The higher authorities have ordered the middle peasants to increase their numbers, so this problem will not arise.

(2) Add mod_proxy_http.so

/usr/local/apache/bin/apxs -i -c -a mod_proxy_http.c proxy_util.c After successful installation, mod_proxy.so file will be generated under apache modules directory and added to httpd.conf LoadModule proxy_http_module modules/mod_proxy_http.so

(3) Add mod_proxy_ajp.so

/usr/local/apache/bin/apxs -c -i -a mod_proxy_ajp.c ajp*.c Note that ajp*c must be added, these things are related to mod_proxy_ajp.c, otherwise an error will be reported: httpd: Syntax error on line 60 of /usr/local/apache/conf/httpd.conf: Cannot load/usr/local/apache/modules/mod_proxy.so into server: /usr/local/apache/modules/mod_proxy.so: undefined symbol: ajp_send_header

(Learn video sharing: php video tutorial)

Restart Apache.

/usr/local/apache/bin/apachectl start

apxs option description:

-c Perform compilation operations

-i install operation, install one or more dynamic shared objects into the modules directory of the server

-a Automatically adds a LoadModule line to the httpd.conf file to activate this module, or enables it if this line exists

-A is similar to-a, but it adds a pound prefix (#) to the LoadModule line.

-e requires editing and can be used with the-a and-A options, similar to-i, modifying the httpd.conf file without installing this module.

The above is "how to add proxy module after installing apache" all the contents of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!

Tags: Modules directories agents files success one line content source code articles videos questions China plus generation compilation middle farmers value information interests prefixes prefaces Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Apple Shulou Information Huawei MariaDB