CentOS under the Apache integrated Tomcat Access report Forbidden 403 Error resolution method

Source: Internet
Author: User
Tags response code

In the implementation of the Apache and Tomcat integration to achieve dynamic static resource separation is a problem, when the request by the Apache 80 port for listening processing, the page elements, the format is a lot of loss, and the 8080 port of Tomcat to handle the time there is no problem. After thinking open chrome debugging, found that the requested resources including pictures, CSS, JS, the response code is all 403, which should be the Apache permissions have a problem, and finally modified the permissions of the resource path to solve the problem. Combined with the online information and their own actual situation summarized the following common reasons:

  1. Since the default site path for the Apache configuration file has been modified, there is no permission to modify the path

    Workaround, find the location of the modified path in the configuration file, and modify the configuration file to the following format:

    " Your_path ">    Options Indexes followsymlinks    allowoverride None    Order allow,deny    allow from all </Directory>
  2. The file is not in the site directory, that is, the path is incorrect

    Workaround: Check the input path for errors and whether the page you are accessing exists.

  3. Apache user has no site path access rights

    View the owner of the site path and discover that the owning user and user group are root

    [Email protected] webapps]#ls-Latotal352864drwxr-xr-x.6Root root theMay the  -: .. DRWXR-xr-x.3Root root inMay the  the: - .. DRWXR-X---. OneRoot root4096May - Geneva: -FTMS-rw-r--r--.1Root root72365363May - Geneva: -FTMS.WARDRWXR-X---.3Root root4096May the  -: -ROOT

    Apache Users and user groups found in Apache configuration files are Apache

    # user/group:the name (or #number)of the user/for # running httpd, as with most system services. #Us ER apachegroup Apache

    The site Directory requires Apache users to have access, so the ownership of the directory is changed to Apache

    Workaround: Go to the Site Directory, modify permissions

    [Email protected] webapps]#Chown-R Apache:apache. [Email protected] webapps]#ls-Latotal352864drwxr-xr-x.6Apache Apache theMay the  -: .. DRWXR-xr-x.3Root root inMay the  the: - .. DRWXR-X---. OneApache Apache4096May - Geneva: -FTMS-rw-r--r--.1Apache Apache72365363May - Geneva: -FTMS.WARDRWXR-X---.3Apache Apache4096May the  -: -ROOT

    Some of this type of problem can be solved by the above method.

CentOS under the Apache integrated Tomcat Access report Forbidden 403 Error resolution method

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.