Subscribe to Updates

    Get the latest news from USA, Canada and Europe directly to your inbox.

    What's Hot

    Rare Tornado Touches Down in Suburban Los Angeles

    March 23, 2023

    The Paraguayan Prosecutor’s Office opens an investigation against former President Horacio Cartes and current Vice President Hugo Velázquez for alleged corruption

    March 23, 2023

    We estimate 5.5 million irregular people receiving Bolsa Família, according to Wellington Dias

    March 23, 2023
    Facebook Twitter Instagram
    • Privacy Policy
    • Terms
    • Contact
    Facebook Twitter Instagram
    West ObserverWest Observer
    • Home
    • News
      1. United States
      2. Europe
      3. Canada
      4. Latin America
      5. Australia
      6. World
      7. View All

      Rare Tornado Touches Down in Suburban Los Angeles

      March 23, 2023

      Orange County authorities searching for arson suspect caught on surveillance video

      March 23, 2023

      Protests Continue in Syrian Town Days After Killing of 4 Kurdish Civilians

      March 23, 2023

      When everyone sounds like a weather forecaster, who should people trust?

      March 23, 2023

      The Paraguayan Prosecutor’s Office opens an investigation against former President Horacio Cartes and current Vice President Hugo Velázquez for alleged corruption

      March 23, 2023

      Students protest rising cost of living

      March 23, 2023

      Mobilization against the pension reform: 3.5 million demonstrators today according to the CGT, nearly 1.1 million according to the Ministry of the Interior

      March 23, 2023

      Demonstrations of March 23, live: the inter-union calls for a 10th day of mobilization on Tuesday; fires and tensions in Paris

      March 23, 2023

      Autism now more common among Black, Hispanic kids in U.S.

      March 23, 2023

      World Athletics bans transgender women athletes competing in female competitions

      March 23, 2023

      Skeptical U.S. lawmakers grill TikTok CEO over safety

      March 23, 2023

      Crypto firm founder Do Kwon arrested in Montenegro

      March 23, 2023

      We estimate 5.5 million irregular people receiving Bolsa Família, according to Wellington Dias

      March 23, 2023

      Justiça Federal authorizes NGOs to manufacture and transport cannabis-based medicines

      March 23, 2023

      New phase of Operation Lesa Pátria turns on man who taught guerrilla tactics in QG of the Army

      March 23, 2023

      Small plane that landed in Goiânia does not have authorization for air taxi, says Anac

      March 23, 2023

      Russia launches a military satellite into space

      March 23, 2023

      Seoul: Pyongyang launched 4 cruise missiles off its east coast

      March 23, 2023

      IAEA: Nuclear safety at the Zaporizhya power plant remains precarious

      March 23, 2023

      America: North Korea does not appear to be preparing for an imminent nuclear test

      March 23, 2023

      Rare Tornado Touches Down in Suburban Los Angeles

      March 23, 2023

      The Paraguayan Prosecutor’s Office opens an investigation against former President Horacio Cartes and current Vice President Hugo Velázquez for alleged corruption

      March 23, 2023

      We estimate 5.5 million irregular people receiving Bolsa Família, according to Wellington Dias

      March 23, 2023

      Students protest rising cost of living

      March 23, 2023
    • Politics
    • Business
    • Lifestyle
    • Tech
    • Sports
    • Travel
    • More
      • Entertainment
      • Videos
    en English
    en Englishes Españolfr Françaisde Deutschhi हिन्दीit Italianoja 日本語pt Portuguêsru Русскийzh-CN 简体中文
    West ObserverWest Observer
    Home » Solved: You Don’t Have Permission to Access on This Server

    Solved: You Don’t Have Permission to Access on This Server

    June 6, 2022No Comments Lifestyle
    Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Many web server configurations face issues related to file permissions. It often renders the server inaccessible to visitors and manifests in the form of a 403 error. Usually, the error message is something like “Forbidden: you don’t have permission to access / on this server”. It can be anything in the form of Forbidden: you don’t have permission to access this resource.

    MAKEUSEOF VIDEO OF THE DAY

    Similar issues can also occur due to problems in the Apache configuration file or even because of a corrupt .htaccess file. This guide provides step-by-step solutions to all of these problems. Try them one at a time, starting from the first solution.

    What Causes This Apache 403 Error?

    This is a fairly common 403 error on Apache’s end caused by a myriad of issues. However, in most cases, this error occurs due to the lack of proper permissions needed to access a site publicly. Apart from this, WordPress sites often face this issue due to a bad .htaccess file.

    Moreover, since Apache version 2.4, there have been some changes in how directives work. This can also restrict public access to your website and result in a 403 forbidden error.

    1. Fix File Permissions to Avoid the Error

    Most people face this common 403 error due to the lack of proper permissions. If the site admin forgets to enable read access to the outside world, then end-users will be unable to access the requested resource. This is often the root cause of this error.

    For example, say you’re trying to access a file named textbook.php on a WordPress site and come up with an error saying you don’t have permission to access /textbook.php on this server. It implies the file is there, but the site owner has disabled access to public users.

    If you’re a site admin instead, you need to make sure files intended for public access have proper read permissions. Else, if you’re facing this error on a public site, inform the site administrator to solve this issue.

    Setting the correct permissions for publicly accessible files can be a bit tricky. That’s why admins should start with absolutely zero permissions and add them as needed. It’s a good idea to have folders with permission mode of 755 and files with 644.

    For a simple website, the directories need to have execute permission, and files should have read permission. Make sure not to give execute permission on files. Malicious users can gain unwanted access to public servers via such files

    The permission mode for Read, Write and Execute access is 4, 2, and 1, respectively. So, a permission mode of 755 on directories means only the owner has full access to the directory contents. Group users and others can only read and execute. Similarly, 644 permission mode for files provides read and write access to the owner and only read access to everyone else.

    To solve errors like forbidden: you don’t have permission to access this resource on any server, fix your webroot directory permissions. The below command uses the chmod utility to set the directory permissions to 755:

    sudo find /var/www/html -type d -exec chmod 755 {} ;

    This command assumes you’re using the default document root of Apache to hold your website. If you’re using a different directory, replace the directory name accordingly. Use the below command to change all file permissions to 644:

    sudo find /var/www/html -type f -exec chmod 644 {} ;

    The above command uses the find utility to locate individual files and sets the correct permission via chmod. The ending {} holds the file paths returned by the find command, and the semicolon (;) marks the end of the iteration.

    Plus, you can also change file permissions individually. For example, the following command will change the permission of textbook.php on the web root and make it publicly accessible. So next time someone tries to access this file, they won’t see the dreaded “you don’t have permission to access this resource error.”

    sudo chmod 644 /var/www/html/textbook.php

    Once you’ve changed all file permissions as required, restart the Apache server to let your changes take effect.

    sudo systemctl restart apache2.service

    This command restarts the Apache server on Ubuntu. However, many RPM-based distros like RHEL or CentOS install Apache as httpd. For such systems, use the following command instead:

    sudo systemctl restart httpd

    2. Fix the .htaccess File for Your WordPress Website

    The .htaccess file serves as a distributed config file and tells Apache how to handle things like configuration changes per directory. Sometimes this file can get corrupted and may result in the “you don’t have permission to access / on this server” error.

    Luckily, if that’s what is causing the 403 error on your server, you can easily fix this by creating a new .htaccess file. In order to create a new .htaccess file for your website, first, log in to your WordPress dashboard. Then, click on Settings > Permalinks.

    You don’t have to make any additional changes here. Just click on the Save Changes button and WordPress will generate a fresh .htaccess file for you.

    So anytime you see “you don’t have permission to access this resource” on Apache servers, try creating a new .htaccess file. This method usually works well for WordPress websites.

    3. Configure Directives in the Apache Configuration File

    Apache 2.4 makes use of a new configuration module named mod_authz_host. This module exposes several new directives. In short, this implements the following rules:

    • Require all granted: Allow all requests
    • Require all denied: Deny all requests
    • Require host safe.com: Only permit requests from safe.com

    If you’re using Apache 2.4, make sure your main configuration file contains the following block of code. You can check out the contents of this file using a simple text editor like Vim. Add this block in the configuration file if they’re missing. Then, you can save and exit Vim.

    vim /etc/apache2/apache2.conf

    Code:

    <Directory />
    

    Options FollowSymLinks

    AllowOverride None

    Require all denied

    </Directory>

    <Directory /usr/share>

    AllowOverride None

    Require all granted

    </Directory>

    <Directory /var/www/>

    Options Indexes FollowSymLinks

    AllowOverride None

    Require all granted

    </Directory>

    Moreover, if you’re running an RHEL-based web server, you need to ease access to the /var/www section in your Apache configuration file. So make sure the /etc/httpd/conf/httpd.conf file contains the following block of code.

    vim /etc/httpd/conf/httpd.conf

    Code:

    <Directory "/var/www">
    AllowOverride None
    Require all granted
    </Directory>

    Finally, restart the Apache server using one of the following commands:


    sudo systemctl restart apache2.service


    sudo systemctl restart httpd

    Fix the Apache Server Permission Error on Linux

    A lot of people face the above issue when accessing public websites or configuring their own sites. This guide covered several fixes to this problem. Resetting the filesystem permission for Apache should be the first resort. If the error persists even after changing the permissions, try creating a new .htaccess file and ensure directives are set properly in your Apache configuration file.

    There are many more issues that can result in a server-side error similar to this one. You need to be proficient at troubleshooting Linux server issues to get your server up and running in such situations.

    Source: Make Use Of

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email VKontakte WhatsApp

    Related Posts

    When we think of good style, we think of outfits. We really should think: Katie Qian

    March 23, 2023

    8 wacky ways to get high without smoking

    March 23, 2023

    Everyone is a star of something in L.A. Versace’s new collection is ready to be seen

    March 21, 2023

    This hidden garden is bursting with native plants. Here’s how to get inside

    March 21, 2023

    L.A. Affairs: Did you find love at Disneyland? Tell us your story

    March 19, 2023

    L.A. Affairs: I was wild, and he was a mountain man. Could we make magic together?

    March 17, 2023
    Don't Miss

    We estimate 5.5 million irregular people receiving Bolsa Família, according to Wellington Dias

    Latin America March 23, 2023

    The Minister of Social Development, Wellington Dias, said, in an interview with CNN in this…

    Students protest rising cost of living

    March 23, 2023

    Mobilization against the pension reform: 3.5 million demonstrators today according to the CGT, nearly 1.1 million according to the Ministry of the Interior

    March 23, 2023

    Demonstrations of March 23, live: the inter-union calls for a 10th day of mobilization on Tuesday; fires and tensions in Paris

    March 23, 2023
    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    • YouTube
    • Vimeo
    Our Picks

    Olympic Games 2024: deputies adopt measures sanctioning intrusions into stadiums and on the grounds

    March 23, 2023

    EU summit: Strong warnings from Guterres

    March 23, 2023

    45 irregular migrants left to die by Greece rescued

    March 23, 2023

    She lived with a 5-month-old baby in an abandoned building: the story of the family in Kyiv continued

    March 23, 2023

    Subscribe to Updates

    Get the latest news from USA, Canada and Europe directly to your inbox.

    About Us
    About Us

    Your #1 source for all the website news, follow USA, Europe and Canada News. Latest reports about business, politics and entertainment.

    We're accepting new partnerships right now.

    Email Us: [email protected]

    Facebook Twitter YouTube LinkedIn
    Our Picks

    Rare Tornado Touches Down in Suburban Los Angeles

    March 23, 2023

    The Paraguayan Prosecutor’s Office opens an investigation against former President Horacio Cartes and current Vice President Hugo Velázquez for alleged corruption

    March 23, 2023

    We estimate 5.5 million irregular people receiving Bolsa Família, according to Wellington Dias

    March 23, 2023
    Newsletter

    Subscribe to Updates

    Get the latest news from USA, Canada and Europe directly to your inbox.

    © 2023 West Observer. All Rights Reserved.
    • Privacy Policy
    • Terms
    • Contact
    • Khaleej Voice

    Type above and press Enter to search. Press Esc to cancel.