The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED Apache Forbidden Error

Discussion in 'EasyApache' started by Nirjonadda, Mar 23, 2017.

  1. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    341
    Likes Received:
    8
    Trophy Points:
    18
    cPanel Access Level:
    Website Owner
    Doing yum update but still are not fixed, some time still getting error messages.

    Forbidden
    You don't have permission to access / on this server.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    What's the corresponding message in /usr/local/apache/logs/error_log when this happens? Also, please post the output from the following command:

    Code:
    rpm -qa|grep ea-apache24-config
    Thank you.
     
  3. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    341
    Likes Received:
    8
    Trophy Points:
    18
    cPanel Access Level:
    Website Owner
    Some time We have getting, Forbidden: You don't have permission to access / on this server.

    Code:
    [root@na ~]# rpm -qa|grep ea-apache24-config
    ea-apache24-config-runtime-1.0-92.92.1.cpanel.noarch
    ea-apache24-config-1.0-92.92.1.cpanel.noarch
    [root@na ~]#
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Feel free to open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

    Thanks!
     
  5. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    341
    Likes Received:
    8
    Trophy Points:
    18
    cPanel Access Level:
    Website Owner
    Going to open, /usr/local/apache/logs/error_log

    Code:
    [Fri Mar 24 23:36:24.675591 2017] [:error] [pid 1584] [client 103.244.242.161:55050] client denied by server configuration: /home/user/public_html/brms-statistic, referer: https://www.mysite.com/
    
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello @Nirjonadda,

    I've moved this over to a separate thread, as it might relate to different issue.

    Are you receiving this error on multiple websites? What's the contents of the .htaccess file within this account's public_html directory?

    Thank you.
     
  7. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    341
    Likes Received:
    8
    Trophy Points:
    18
    cPanel Access Level:
    Website Owner
    Support Request ID: 8329161, I think this issue happened after EasyApache 4 Update - March 21, 2017 and March 22, 2017. I have only one website. The contents of the .htaccess file within this account's public_html directory.

    Code:
    RewriteEngine On
    
    # Force www:
    RewriteCond %{HTTP_HOST} !^$
    RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteCond %{HTTPS}s ^on(s)|
    RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    
    # Force SSL:
    RewriteCond %{HTTPS} off
    RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    
    RewriteCond %{QUERY_STRING} (^|\?|&)p=([0-9]+)($|&)
    RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule ^showthread\.php$ /posts/%2/? [R=301,L]
    RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-[^/]+/page([0-9]+)$
    RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule ^showthread\.php$ /threads/%2/page-%3? [R=301,L]
    RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-.*$
    RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule ^showthread\.php$ /threads/%2/? [R=301,L]
    
    #Mod_security can interfere with uploading of content such as attachments.
    #If you cannot attach files, remove the "#" from the lines below.
    #<IfModule mod_security.c>
    # SecFilterEngine Off
    # SecFilterScanPOST Off
    #</IfModule>
    
    ErrorDocument 401 default
    ErrorDocument 403 default
    ErrorDocument 404 default
    ErrorDocument 405 default
    ErrorDocument 406 default
    ErrorDocument 500 default
    ErrorDocument 501 default
    ErrorDocument 503 default
    
    <IfModule mod_rewrite.c>
      RewriteEngine On
    
      #If you are having problems with the rewrite rules, remove the "#" from the
      #line that begins "RewriteBase" below. You will also have to change the path
      #of the rewrite to reflect the path to your XenForo installation.
      RewriteBase /
    
      #This line may be needed to enable WebDAV editing with PHP as a CGI.
      #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
      RewriteCond %{REQUEST_FILENAME} -f [OR]
      RewriteCond %{REQUEST_FILENAME} -l [OR]
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
      RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
      RewriteRule ^.*$ - [NC,L]
      RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
      RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
      RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
      RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
      RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
      RewriteRule ^.*$ index.php [NC,L]
    </IfModule>
    
    <IfModule mod_deflate.c>
      #Compress HTML, CSS, JavaScript, Text, XML and fonts
      AddOutputFilterByType DEFLATE application/javascript
      AddOutputFilterByType DEFLATE application/rss+xml
      AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
      AddOutputFilterByType DEFLATE application/x-font
      AddOutputFilterByType DEFLATE application/x-font-opentype
      AddOutputFilterByType DEFLATE application/x-font-otf
      AddOutputFilterByType DEFLATE application/x-font-truetype
      AddOutputFilterByType DEFLATE application/x-font-ttf
      AddOutputFilterByType DEFLATE application/x-javascript
      AddOutputFilterByType DEFLATE application/xhtml+xml
      AddOutputFilterByType DEFLATE application/xml
      AddOutputFilterByType DEFLATE font/opentype
      AddOutputFilterByType DEFLATE font/otf
      AddOutputFilterByType DEFLATE font/ttf
      AddOutputFilterByType DEFLATE image/svg+xml
      AddOutputFilterByType DEFLATE image/x-icon
      AddOutputFilterByType DEFLATE text/css
      AddOutputFilterByType DEFLATE text/html
      AddOutputFilterByType DEFLATE text/javascript
      AddOutputFilterByType DEFLATE text/plain
      AddOutputFilterByType DEFLATE text/xml
    
      #Remove browser bugs (only needed for really old browsers)
      BrowserMatch ^Mozilla/4 gzip-only-text/html
      BrowserMatch ^Mozilla/4\.0[678] no-gzip
      BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
      Header append Vary User-Agent
    </IfModule>
    
    ## EXPIRES CACHING ##
    #<IfModule mod_expires.c>
      ExpiresActive On
      ExpiresByType image/jpg "access plus 1 year"
      ExpiresByType image/jpeg "access plus 1 year"
      ExpiresByType image/gif "access plus 1 year"
      ExpiresByType image/png "access plus 1 year"
      ExpiresByType text/css "access plus 1 month"
      ExpiresByType application/pdf "access plus 1 month"
      ExpiresByType text/x-javascript "access plus 1 month"
      ExpiresByType application/x-shockwave-flash "access plus 1 month"
      ExpiresByType image/x-icon "access plus 1 year"
      ExpiresDefault "access plus 2 days"
    #</IfModule>
    ## EXPIRES CACHING ##
    
    <ifModule mod_expires.c>
      ExpiresActive On
      ############################################
      ## Add default Expires header
      ## http://developer.yahoo.com/performance/rules.html#expires
      <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|ogg|svg|js|css|swf)$">
      ExpiresActive On
      ExpiresDefault "access plus 1 year"
      </FilesMatch>
    </ifModule>
    
    #Deny attempts to view the Htaccess file.
    <Files .htaccess>
      Order allow,deny
      Deny from all
    </Files>
    
    # php -- BEGIN cPanel-generated handler, do not edit
    # Set the “ea-php71” package as the default “PHP” programming language.
    <IfModule mime_module>
      AddType application/x-httpd-php .php .php7 .phtml
    </IfModule>
    # php -- END cPanel-generated handler, do not edit
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    To update, the issue was determined to relate to a Mod_Evasive rule as opposed to the bug addressed in the previous thread.

    Thank you.
     
  9. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    341
    Likes Received:
    8
    Trophy Points:
    18
    cPanel Access Level:
    Website Owner
    Yes this issue happened with mod_evasive.
     
Loading...

Share This Page