Configure Apache in opensuse to enable rewrite Module

Source: Internet
Author: User

I have just re-installed the system over the past few days and need a lot of configuration. I am a lamper. Of course I want to configure Apache + PHP + MySQL. The release version I used is opensuse13.1 ,.

After installing Apache, you must enable the URL rewriting function to work with the development of the project. Open the configuration file/etc/apache2/httpd. conf of Apache, find AllowOverride none, change AllowOverride all, and change option none to option followsymlinks. This does not work, but it also needs to load the rewrite module.

The main function of rewrite is to rewrite the URL and rewrite the URL to achieve static (pseudo-static). The purpose of this operation is to facilitate the search engine and users' understanding, to increase the search engine's indexing quantity.

Return to the/etc/apache2/httpd. conf file and you can see this line.

#  |-- sysconfig.d/loadmodule.conf . . . . .  [*] load these modules

The Apache module File is stored in/etc/apache2/sysconfig. d/loadmodule. conf.

Go into this file and check whether the file contains many statements for Loading modules. So I am very excited to load the rewrite module File and restart Apache, then I went into the file and found that the statement I just wrote was missing. So I checked the file carefully and found that:

## Files in this directory are created at apache start time by /usr/sbin/rcapache2 # Do not edit them!## as listed in APACHE_MODULES (/etc/sysconfig/apache2)

It turns out that this file cannot be edited. It can only be modified in the/etc/sysconfig/apache2 file, so you can check it again. Found:

APACHE_MODULES="actions alias auth_basic authn_file authz_host authz_groupfile  authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl userdir php5 reqtimeout authn_core authz_core"

It turns out that this is the statement for Apache to load the module. Add rewrite to the end, restart Apache, and find that it is successful, and/etc/apache2/sysconfig. d/loadmodule. A rewrite statement is added to the conf file.

LoadModule rewrite_module                 /usr/lib64/apache2-prefork/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.