Apache has been installed and put into operation, but later found that some modules did not load, of course, there are two ways: 1. One is to completely recompile Apache, then install 2. Compile the module as so file and load the extension module with the loadmodule instruction. apache after installation mod_rewrite1.apache1.3apache_1.3.34.tar.gz extracted directory for/root/apache_1.3.34 text in the abbreviation "source directory" Apache installation directory/usr /local/apache The short name is "target Directory" step: 1, Apache install rewrite module need dbm support, otherwise can not compile, so first to install a gdbm:ftp://ftp.gnu.org/gnu/gdbm/ Installation steps: Enter the installation directory, ./configure make make install make Install-compat (the last line will also be executed.) Otherwise, the ndbm.h header file cannot be compiled) if you are not sure if DBM is already installed on the server, you can install it. Otherwise this step can be skipped. 2, now to the Apache source directory in the standard module directory (/root/apache_src/src/modules/standard/), using the following instructions to compile the so file:/usr/local/apache/bin/apxs-c mod _REWRITE.C-LGDBM can get mod_rewrite.so files. Note: "-LGDBM" is used as a description when compiling mod_rewrite.c to gdbm link in. This will not be the "dbm Fetch" error when starting Apache in the 6th step. 3. Now let Apache Apxs from the trend http.conf add LoadModule statements to the configuration file and copy the mod_rewrite.so files to the Apache/libexec directory/usr/local/apache/bin/ Apxs-i-a-n rewrite/root/apache_1.3.34/src/modules/standard/mod_rewrite.so Note: The rewrite parameter in the command is to tell the APXS command mod_ The name of the module in the rewrite.so file. After the command is executed, APXS will add "_module" to the name of the module in LoadModule for rewrite.Said. If you start Apache and find that you always give a "Can't locate API" error, it means that the syntax of the module name after LoadModule is changed according to your Apache version. 4, Stop Apache apache/bin/apachectl stop 5, run the Profile check command apache/bin/apachectl configtest as shown syntax OK, the entire operation is successful. Then you can go to the 6th step. Otherwise, debug according to the prompt information. But as long as this article is said to operate is not error. 6, start Apache apache/bin/apachectl start 2.apache2. Add mod_rewrite Module # find. -name mod_rewrite.c//Search for mod_rewrite.c files in Apache's source installation directory # CD PATH/TO/MOD_REWRITE.C//Enter the directory containing the mod_rewrite.c files #/usr/ Local/apache/bin/apxs-c mod_rewrite.c//apxs should specify an absolute path in the bin directory where you are currently using Apache #/usr/local/apache/bin/apxs-i-a-n mod_ Rewrite mod_rewrite.la If there are no errors, you should compile a mod_rewrite.so file in your Apache modules directory. Edit the httpd.conf file to confirm that the httpd.conf already contains the mod_rewrite.so load statement, as follows: LoadModule Rewrite_module modules/mod_rewrite.so at this point, Your Apache should have supported the rewrite. When you are finished, restart the server Apache. Restart Apache The following error occurred: www#/usr/local/apache/bin/apachectl restart Httpd:syntax error on line Of/usr/local/apache/conf/htt Pd.conf:Can ' t locate API module structure ' mod_rewrite_module ' in File/usr/local/apache/modules/mod_rewrite.so:undefined symbol "Mod_rewrite_module" httpd.conf for LoadModule mod_rewrite_module modules/mod _rewrite.so change to LoadModule rewrite_module modules/mod_rewrite.so start normal!
Apache Add module dynamically