Install/compile the mod_rewrite module in Apache

Source: Internet
Author: User
Install/compile the mod_rewrite module in Apache Zhoz, technology development» system network, comment (0), reference (0), read (422), via Original Site Large | medium | small Reference address:
Note: This address is valid only before 23:59:59 today. If Apache is not installed on the server, it is very easy to compile the mod_rewrite module during Apache compilation.
Today, Apache has been installed. Now I only want to compile the mod_rewrite.so module and load it in Apache.
You can obtain the root permission.
[Mam-Main @ Ohta mappers] $ su mam
Password:
[Mam @ Ohta mappers] $ sudo Su
Password:

[Root @ Ohta mappers] #/usr/local/apache2/bin/apxs-I-a-c./mod_rewrite.c

Then the compilation process will appear: /usr/local/apache2/build/libtool -- silent -- mode = compile gcc-prefer-pic-dap_have_designated_initializer-dlinux = 2-d_reentrant-d_gnu_source-g-O2-pthread-I/ usr/local/apache2/include-I/usr/local/apache2/include-I/usr/local/apache2/include-c-o. /mod_rewrite.lo. /mod_rewrite.c & touch. /mod_rewrite.slo
/Usr/local/apache2/build/libtool -- silent -- mode = link GCC-o. /mod_rewrite.la-rpath/usr/local/apache2/modules-module-avoid-version. /mod_rewrite.lo
/Usr/local/apache2/build/instdso. Sh sh_libtool = '/usr/local/apache2/build/libtool'./mod_rewrite.la/usr/local/apache2/modules
/Usr/local/apache2/build/libtool -- mode = install CP./mod_rewrite.la/usr/local/apache2/modules/
CP./. libs/mod_rewrite.so/usr/local/apache2/modules/mod_rewrite.so
CP./. libs/mod_rewrite.lai/usr/local/apache2/modules/mod_rewrite.la
CP./. libs/mod_rewrite.a/usr/local/apache2/modules/mod_rewrite.a
Chmod 644/usr/local/apache2/modules/mod_rewrite.a
Ranlib/usr/local/apache2/modules/mod_rewrite.a
Path = "$ path:/sbin" ldconfig-N/usr/local/apache2/modules
----------------------------------------------------------------------
Libraries have been installed in:
/Usr/local/apache2/modules

If you ever happen to want to link against installed Libraries
In a given directory, libdir, you must either use libtool, and
Specify the full pathname of the library, or use the '-llibdir'
Flag during linking and do at least one of the following:
-Add libdir to the 'LD _ LIBRARY_PATH 'environment variable
During execution
-Add libdir to the 'LD _ run_path 'environment variable
During linking
-Use the '-wl, -- rpath-wl, libdir' linker flag
-Have your system administrator add libdir to '/etc/lD. So. conf'

See any operating system documentation about shared libraries
More information, such as the LD (1) and LD. So (8) manual pages.
----------------------------------------------------------------------
Chmod 755/usr/local/apache2/modules/mod_rewrite.so
[Activating module 'rewrite' in/usr/local/apache2/CONF/httpd. conf]

if there are no errors, A mod_rewrite.so file will be compiled in the Apache/modules directory.
at the same time, it will be loaded in
VI/usr/local/apache2/CONF/httpd. conf:
loadmodule rewrite_module modules/mod_rewrite.so

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.