Introduction
Apache is a popular open-source app for running web servers, owing to its reliability and stability. Despite its ease of use, it’s not uncommon to encounter a ‘403 Forbidden’ error after setting up a website using Apache.
In this tutorial, we will go over potential causes of the Apache ‘403 Forbidden’ error and different ways you can fix it.
Prerequisites
- A user account with root or sudo privileges
- Access to the command line terminal
- An installed version of Apache web server
Apache 403 Forbidden: Effects and Possible Causes
The Apache ‘403 Forbidden’ error appears when you try to load a web page with restricted access. Depending on your browser and the website in question, there are different versions of the 403 error message:
- Forbidden
- Error 403
- HTTP Error 403.14 – Forbidden
- 403 Forbidden
- HTTP 403
- Forbidden: You don’t have permission to access the site using this server
- Error 403 – Forbidden
- HTTP Error 403 – Forbidden
There are several potential reasons why the Apache 403 error occurs:
- The first option is a permission error in the webroot directory, where users don’t have access to website files.
- The second possible reason for a 403 error is missing or incorrect settings in the Apache configuration files.
- Finally, failing to set up a default directory index also triggers a 403 error message in Apache.
How to Fix ‘403 Forbidden’ in Apache
If you have come across an Apache ‘403 Forbidden’ message, there are several ways to fix it:
Method 1: Setting File Permissions and Ownership
If you suspect the cause of the 403 error to be incorrect file permissions, use:
sudo chmod -R 775 /path/to/webroot/directory
The chmod command sets the execute permission for the webroot directory and read permission for the index.html
file.
To change directory ownership, use:
sudo chown -R user:group /path/to/webroot/directory
Where:
user
is the user account with root privileges on your web server.group
iswww-data
orapache
.
Restart the Apache web server for the changes to take effect.
If you are working with Ubuntu, use the following command to restart Apache:
sudo systemctl restart apache2
If you are working with Centos, use:
sudo systemctl restart httpd
Method 2: Setting Apache Directives
It is possible that the proper require directive is not configured and restricts access to resources. To fix it:
1. Access Apache’s main configuration file. For Ubuntu, use:
sudo nano /etc/apache2/apache2.conf
For Centos, use:
sudo nano /etc/httpd/httpd.conf
2. Once you open the configuration file, scroll down to the following section:
3. If the final line in the <Directory /var/www/>
section contains Require all denied
, change it to Require all granted
.
4. Press Ctrl+X
and then Y
to save changes to the Apache configuration file.
5. Restart the Apache web server for the changes to take effect. For Ubuntu, use:
sudo systemctl restart apache2
For Centos, use:
sudo systemctl restart httpd
Method 3: Adding a Default Directory Index
When a user visits a URL that requests a directory, the web server looks for a file in the given directory. If the file or any similar files are not found, and directory index listings are disabled, the web server displays the ‘403 Forbidden’ error message.
To fix the issue, add a default directory index.
1. Access Apache’s main configuration file by using:
sudo nano /etc/apache2/apache2.conf
2. Scroll down to find out the default index file name:
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
3. Make sure there is a file in the webroot folder with this name and upload it if it’s missing.
Conclusion
After following this tutorial, you should be able to determine the cause of an Apache ‘403 Forbidden’ error and fix any issues you may find.
If you want to find out more about 403 forbidden error, read our article 403 forbidden error — what is it and how to fix it.
Apache web server is one of the most popular and widely used open-source web servers thanks to its stability and reliability. The web server commands a huge market, especially in the web hosting platforms.
Be that as it may, you may get a “Forbidden – You don’t have permission to access / on this server” error on your browser after setting up your website. It’s quite a common error and a good chunk of users have experienced it while testing their site. So what is this error?
Demystifying the Forbidden Error
Also referred to as the 403 Forbidden error, Apache’s ‘Forbidden Error’ is an error that is displayed on a web page when you are attempting to access a website that’s restricted or forbidden. It’s usually splashed on the browser as shown.
Additionally, the error can manifest in several ways on the browser as indicated below:
- HTTP Error 403 – Forbidden
- Forbidden: You don’t have permission to access [directory] on this server
- 403 Forbidden
- Access Denied You don’t have permission to access
- 403 forbidden requests forbidden by administrative rules
So what causes such errors?
The ‘403 Forbidden Error‘ occurs due to the following main reasons:
1. Incorrect File / Directory Permissions
This error can be triggered due to incorrect file/folder permissions on the webroot directory. If the default file permissions are not adjusted to grant users access to the website files, then the chances of this error popping on a web browser are high.
2. Misconfiguration of the Apache Configuration Files
This error can also be attributed to a misconfiguration of one of the Apache configuration files. It could be an incorrect parameter that has been included or missing directives in the configuration file.
Fixing the ‘403 Forbidden Error’
If you have encountered this error, here are a few steps that you can take to remedy this.
1. Adjust file permissions & ownership of the webroot directory
Incorrect file permissions & directory ownership are known to restrict access to website files. So, firstly, be sure to assign the file permissions recursively to the webroot directory as shown.
The webroot directory should always have EXECUTE permissions and the index.html
file should have READ permissions.
$ sudo chmod -R 775 /path/to/webroot/directory
Additionally, adjust the directory ownership as shown:
$ sudo chown -R user:group /path/to/webroot/directory
Where the user is the regular logged-in user and the group is www-data
or apache
.
Finally, reload or restart the Apache webserver for the changes to take effect.
$ sudo systemctl restart apache2 OR $ sudo systemctl restart httpd
If this does not resolve the issue, proceed to the next step:
2. Adjust directives in Apache main configuration file
If you are on Debian-based Linux, in Apache’s main configuration file /etc/apache2/apache2.conf
, ensure that you have this block of 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>
Save and exit and thereafter, restart the Apache.
If you are running Apache on RHEL-based distributions / CentOS systems, ensure that you relax access to the /var/www
directory in the /etc/httpd/conf/httpd.conf
main Apache configuration file.
<Directory "/var/www"> AllowOverride None Require all granted </Directory>
Then save all the changes and reload Apache.
If after trying all these steps you are still getting the error, then please check the configuration of your virtual host files. We have detailed articles on how you can configure the Apache Virtual host file on:
- How to Install Apache with Virtual Hosts on Debian
- How to Configure Apache Virtual Hosts on Rocky Linux
- How to Install Apache with Virtual Host on CentOS
I hope that the steps provided have helped you clear the 403 error.
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
На чтение 3 мин Опубликовано 19.07.2020
Веб-сервер Apache является одним из самых популярных и широко используемых веб-серверов с открытым исходным кодом благодаря своей стабильности и надежности.
Веб-сервер управляет огромным рынком, особенно на платформах веб-хостинга.
Как бы то ни было, вы можете получить ошибку «Forbidden – You don’t have permission to access / on this server» в вашем браузере после настройки вашего веб-сайта.
Это довольно распространенная ошибка, и многие пользователи уже сталкивались с ней при тестировании своего сайта.
Так в чем же эта ошибка?
Также называемая «ошибка 403», эта такая ошибка в Apache , которая отображается на веб-странице, когда вы пытаетесь получить доступ к веб-сайту с ограниченным или запрещенным доступом.
Кроме того, ошибка может отображаться по разному:
- HTTP Error 403 – Forbidden
- Forbidden: You don’t have permission to access [directory] on this server
- 403 Forbidden
- Access Denied You don’t have permission to access
- 403 forbidden request forbidden by administrative rules
Содержание
- Так что вызывает такие ошибки?
- 1. Неправильные права доступа к файлам / каталогам
- 2. Неправильная настройка файлов конфигурации Apache
- Фиксим ‘403 Forbidden Error’
- 1. Настройте права доступа к файлам и владение каталогом webroot
- 2. Настройте директивы в главном конфигурационном файле Apache
Так что вызывает такие ошибки?
‘403 ошибка‘ возникает по следующим основным причинам:
1. Неправильные права доступа к файлам / каталогам
Эта ошибка может быть вызвана из-за неправильных прав доступа к файлам/папкам в каталоге webroot.
Если права доступа к файлам по умолчанию не настроены для предоставления пользователям доступа к файлам веб-сайта, то вероятность появления этой ошибки в веб-браузере высока.
2. Неправильная настройка файлов конфигурации Apache
Эта ошибка также может быть связана с неправильной настройкой одного из файлов конфигурации Apache.
Это может быть неверный параметр, который был включен по ошибке, или отсутствующие директивы в файле конфигурации.
Фиксим ‘403 Forbidden Error’
Если вы столкнулись с этой ошибкой, вот несколько шагов, которые вы можете предпринять, чтобы исправить это.
1. Настройте права доступа к файлам и владение каталогом webroot
Известно, что неправильные права доступа к файлам и владение каталогами ограничивают доступ к файлам сайта.
Поэтому, во-первых, убедитесь, что права доступа к файлам рекурсивно назначены каталогу webroot, как показано далее.
Каталог webroot всегда должен иметь разрешения EXECUTE, а файл index.html должен иметь разрешения READ.
$ sudo chmod -R 775 /path/to/webroot/directory
Кроме того, настройте владельца каталога, как показано далее:
$ sudo chown -R user:group /path/to/webroot/directory
Где user является обычным вошедшим в систему пользователем, а группа – www-data или apache.
Наконец, перезапустите веб-сервер Apache, чтобы изменения вступили в силу.
$ sudo systemctl restart apache2
Если это не решает проблему, перейдите к следующему шагу:
2. Настройте директивы в главном конфигурационном файле Apache
Убедитесь, что в главном конфигурационном файле Apache /etc/apache2/apache2.conf у вас есть этот блок кода:
<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>
Сохраните и выйдите, а затем перезапустите Apache.
Если вы используете Apache в системах RHEL / CentOS, убедитесь, что вы ослабили доступ к каталогу /var/www в главном файле конфигурации Apache /etc/httpd/conf/httpd.conf.
<Directory "/var/www"> AllowOverride None Require all granted </Directory>
Затем сохраните все изменения и перезагрузите Apache.
Пожалуйста, не спамьте и никого не оскорбляйте.
Это поле для комментариев, а не спамбокс.
Рекламные ссылки не индексируются!
Содержание
- ИТ База знаний
- Полезно
- Навигация
- Серверные решения
- Телефония
- Корпоративные сети
- Исправляем 403 Forbidden в Apache на CentOS
- Бесплатный вводный урок на онлайн курс по Linux
- Воркэраунд
- Бесплатный вводный урок на онлайн курс по Linux
- Полезно?
- Почему?
- 🛠️ Исправляем ошибку “Forbidden – You don’t have permission to access / on this server”
- Так что вызывает такие ошибки?
- 1. Неправильные права доступа к файлам / каталогам
- 2. Неправильная настройка файлов конфигурации Apache
- Фиксим ‘403 Forbidden Error’
- 1. Настройте права доступа к файлам и владение каталогом webroot
- 2. Настройте директивы в главном конфигурационном файле Apache
- Apache2 virtualhost 403 forbidden?
- 6 Answers 6
- apache tutorial — 403 forbidden Error — apache — apache web server — apache server — apache2
- 1. status code 403 — Problem:
- 2. http 403 — Cause:
- Что такое ошибка доступа 403 и как ее исправить?
- Что такое ошибка доступа 403?
- Почему возникает ошибка доступа 403
- Что делать если возникла ошибка доступа 403
- Шаг 1 — Проверка файла .htaccess
- Откройте «Диспетчер файлов» в панели управления хостингом
- Шаг 2 — Работа с правами доступа
- Шаг 3 — Отключение плагинов WordPress
- Заключение
ИТ База знаний
Курс по Asterisk
Полезно
— Узнать IP — адрес компьютера в интернете
— Онлайн генератор устойчивых паролей
— Онлайн калькулятор подсетей
— Калькулятор инсталляции IP — АТС Asterisk
— Руководство администратора FreePBX на русском языке
— Руководство администратора Cisco UCM/CME на русском языке
— Руководство администратора по Linux/Unix
Навигация
Серверные решения
Телефония
FreePBX и Asterisk
Настройка программных телефонов
Корпоративные сети
Протоколы и стандарты
Исправляем 403 Forbidden в Apache на CentOS
Маленькая, но полезная заметка. Однажда, в один прекрасный день у нас перестала работать подмапленная в web — доступ директория (смонтирована она была через /etc/fstab ). Браузер возвращал 403 Forbidden Error. Не долго думая, смотрим, что происходит в логах при обращении к web. В режиме реального времени можно посмотреть командой:
Бесплатный вводный урок на онлайн курс по Linux
Мы собрали концентрат самых востребованных знаний, которые позволят начать карьеру администраторов Linux, расширить текущие знания и сделать уверенный шаг в DevOps
Итак, у нас там было следующее:
Хм. Дело в том, что у нас там просто выводится список папок, по файлам. Следовательно, сервак просто не может отрисовать эту структуру. Погнали исправлять
Воркэраунд
Лезем в конфигурационный файл нашего Apache:
И в общей области, где идут настройки директорий добавляем следующее:
Где merion_directory — ваша директория в корне веб — сервера /var/www/html/, при обращении к которой вы получаете 403. Конфигурация проста — мы просто говорим апачу, что у нас там каталог файлов и его нужно «отрисовать» даже несмотря на то, что у нас там нет никаких index.html или index.php. По окончанию настройки ребуетаем Apache:
Или через systemctl. Ребутаем браузер (Ctrl + F5). Профит!
Бесплатный вводный урок на онлайн курс по Linux
Мы собрали концентрат самых востребованных знаний, которые позволят начать карьеру администраторов Linux, расширить текущие знания и сделать уверенный шаг в DevOps
Полезно?
Почему?
😪 Мы тщательно прорабатываем каждый фидбек и отвечаем по итогам анализа. Напишите, пожалуйста, как мы сможем улучшить эту статью.
😍 Полезные IT – статьи от экспертов раз в неделю у вас в почте. Укажите свою дату рождения и мы не забудем поздравить вас.
Источник
🛠️ Исправляем ошибку “Forbidden – You don’t have permission to access / on this server”
Веб-сервер управляет огромным рынком, особенно на платформах веб-хостинга.
Как бы то ни было, вы можете получить ошибку «Forbidden – You don’t have permission to access / on this server» в вашем браузере после настройки вашего веб-сайта.
- HTTP Error 403 – Forbidden
- Forbidden: You don’t have permission to access [directory] on this server
- 403 Forbidden
- Access Denied You don’t have permission to access
- 403 forbidden request forbidden by administrative rules
Так что вызывает такие ошибки?
‘403 ошибка‘ возникает по следующим основным причинам:
1. Неправильные права доступа к файлам / каталогам
2. Неправильная настройка файлов конфигурации Apache
Эта ошибка также может быть связана с неправильной настройкой одного из файлов конфигурации Apache.
Это может быть неверный параметр, который был включен по ошибке, или отсутствующие директивы в файле конфигурации.
Фиксим ‘403 Forbidden Error’
Если вы столкнулись с этой ошибкой, вот несколько шагов, которые вы можете предпринять, чтобы исправить это.
1. Настройте права доступа к файлам и владение каталогом webroot
Известно, что неправильные права доступа к файлам и владение каталогами ограничивают доступ к файлам сайта .
Поэтому, во-первых, убедитесь, что права доступа к файлам рекурсивно назначены каталогу webroot, как показано далее.
Каталог webroot всегда должен иметь разрешения EXECUTE, а файл index.html должен иметь разрешения READ.
Кроме того, настройте владельца каталога, как показано далее:
Где user является обычным вошедшим в систему пользователем, а группа – www-data или apache.
Наконец, перезапустите веб-сервер Apache, чтобы изменения вступили в силу.
2. Настройте директивы в главном конфигурационном файле Apache
Сохраните и выйдите, а затем перезапустите Apache.
Если вы используете Apache в системах RHEL / CentOS, убедитесь, что вы ослабили доступ к каталогу /var/www в главном файле конфигурации Apache /etc/httpd/conf/httpd.conf.
Если статья написана для обычных юзеров, то скажу Вам как обычный юзер, вот это связать между собой не реально
“Каталог webroot всегда должен иметь разрешения EXECUTE, а файл index.html должен иметь разрешения READ.
$ sudo chmod -R 775 /path/to/webroot/directory”
Где в приведенном примере разрешения EXECUTE?
И где расширение READ?
Для тех кто пишет коды самостоятельно подобные статьи в принципе не нужны, а те, кто используют для кодов сторонние программы, в таких статьях в принципе ничего понять не могут, кроме того, что нужно давать какие то доступы.
А тут не надо “писать коды”, достаточно знать 4 – чтение, 2 запись, 1 – выполнение
А мне помогло, дал права как в примере и завелся сайт и базы данных подтянулись, спасибо.
Источник
Apache2 virtualhost 403 forbidden?
I’m running ubuntu 13.04 64bit on my desktop, I installed Apache2, MySQL and PHP etc.
I wanted to have my web root in /home/afflicto/public_html instead of /var/www . So I went along with this guide:
http://www.maketecheasier.com/install-and-configure-apache-in-ubuntu/2011/03/09
(I did everything from «configuring different sites») as I like the solution more.
Here’s what I did:
Installed Apache2, MySQL etc..
copied /etc/apache2/sites-avaliable/default to /etc/apache2/sites-available/afflicto . Then edited it, it now looks like the following:
/etc/apache2/sites-available/afflicto
I did sudo a2dissite default && sudo a2ensite afflicto && sudo service apache2 restart
I created a index.php and index.html in /home/afflicto/public_html/test/
when accessing localhost/test or localhost/test/index.html etc, I get 403 forbidden error.
What am I doing wrong?
update 1
I have set the owner of the public_html directory to www-data .
Also sudo chmod -R +x public_html && sudo chmod -R 777 public_html
Still same 403 error.
Here’s the output of the apache error log:
6 Answers 6
I was faced with this issue. But I didn’t like the idea of changing the group of my home directory to www-data. This problem can simply be solved by modifying the configuration file for the virtualHost. Simply configure the Directory tag to include these
The Require all granted is a new feature I guess; having a default value of denied .
Turns out I had to chmod not only /home/afflicto/public_html but also /home/afflicto/ directory as well.
Источник
apache tutorial — 403 forbidden Error — apache — apache web server — apache server — apache2
- Error 403 Forbidden
- 403 Error
- Forbidden
- 403 Forbidden
- Nginx 403 Forbidden
- 403 Forbidden: Access Denied
- HTTP 403 Forbidden
- 403 Forbidden Error
- 403 Forbidden Nginx
- hostgator 403
- error code 403 22
- forbidden meaning – access denying on a file can be given with this 403 error message.
1. status code 403 — Problem:
- When we try to access our site in a web browser, we may receive a 403 forbidden error message.
- Furthermore, we may see entries in the runtime error log similar to the following line:
2. http 403 — Cause:
This problem 403 error occurs when any of the following conditions is true:
- There is no index file in the document root directory (for example, there is no index.html or index.php file in the public_html directory) which arises status 403.
- http status code 403 — Permissions are set incorrectly for either the .htaccess file or the public_html directory:
- The file permissions for the .htaccess file should be set to 644
- read and write permissions for the user, and
- read permissions for the group and world).
- The permissions for the public_html directory should be set to 755
- read, write, and execute permissions for the user, and
- read and execute permissions for the group and world.
- When the 403 area code error occurs, this often indicates that the permissions for the public_html directory are set incorrectly to 644 which may arise 403 forbidden access is denied.
- Caching -> A previously requested version of a URL returning a 403 forbidden error it may be cached in the browser. Clearing your cache may solve the problem. So that, you aren’t being served with old files.
- http forbidden — Accessing Hidden Files / Wrong URL -> If a user tries to access hidden files stored on your web server such as the .htaccess file, this will also return a 403 forbidden error.
- Hidden files are not meant to publicly accessible which is why the server restricts them and lets the user know they are forbidden to access them.
- Similarly, if a user incorrectly enters a URL, a 403 forbidden Nginx error message (or something similar) may also occur depending on what they have entered, for example, a directory instead of a file path.
- nginx 403 — Fixing an Nginx 403 Forbidden Error
- In addition to the 403 error causes mentioned above, there are also a few things you can do to troubleshoot for Nginx 403 forbidden error.
- No index file defined – When there is no index file present in the directory defined with the index directive, this can result in an nginx 403 forbidden.
- The file permissions for the .htaccess file should be set to 644
For example, consider the following index directive:
Источник
Что такое ошибка доступа 403 и как ее исправить?
В этой статье мы расскажем о причинах, с которыми может быть связано возникновение ошибки 403 . В качестве примера мы покажем вам, как исправить подобную ошибку на WordPress-сайте . Тем не менее, на других CMS или статических сайтах действия, которые необходимо предпринять, будут почти аналогичными:
Причины возникновения ошибки 403 могут отличаться в зависимости от различных обстоятельств. Иногда эта ошибка может быть результатом изменений или обновлений, которые ваш хостинг произвел в своей системе.
Рассмотрим эту тему подробнее. Затем мы перечислим различные причины возникновения этой ошибки и пути решения.
- Доступ к панели управления хостингом.
Что такое ошибка доступа 403?
Прежде чем мы продолжим и попытаемся исправить код ошибки 403 , давайте сначала поймем, что это на самом деле такое. Ошибка доступа 403 — это код состояния HTTP .
Вот примеры сообщений об ошибке, с которыми можно столкнуться:
Давайте выясним, что вызывает эти ошибки.
Почему возникает ошибка доступа 403
Получение сообщения об ошибке 403 в процессе разработки может оказаться тревожным сигналом. Причина может заключаться в том, что вы пытаетесь получить доступ к тому, к чему у вас нет прав. Ошибка доступа 403 — это способ, с помощью которого сайт заявляет, что у вас недостаточно прав.
Эта ошибка обусловлена следующим:
- Неверные права доступа к файлам или папкам;
- Неправильные настройки в файле .htaccess .
Кратко рассмотрим, как можно это исправить.
Что делать если возникла ошибка доступа 403
Теперь, когда мы знаем факторы, провоцирующие возникновение ошибки, пришло время рассмотреть то, как от нее избавиться.
Действия, перечисленные ниже, будут касаться исправления ошибки 403 на WordPress-сайте . Но их также можно использовать и на других платформах. Рассмотрим весь процесс обнаружения ошибки 403 доступ запрещен , и ее исправления по этапам.
Шаг 1 — Проверка файла .htaccess
Возможно, вы не знакомы с файлом .htaccess . Это потому, что файл часто остается скрытым в директории проекта. Но если вы используете Hostinger File Manager , вы видите .htaccess по умолчанию:
Если вы используете CPanel , можно найти этот файл, используя « Диспетчер файлов ». Давайте рассмотрим, как это делается:
Откройте «Диспетчер файлов» в панели управления хостингом
В папке public_html найдите файл .htaccess . Если вы не видите его в этой папке, можно нажать на кнопку « Настройки » и включить параметр « Показать скрытые файлы »:
.htaccess — это файл конфигурации сервера, который предназначен для изменения настроек веб-сервера Apache .
Файл .htaccess присутствует на всех WordPress-сайтах . В тех редких случаях, когда сайт не его или он был удален непреднамеренно, нужно создать этот файл вручную.
После того как вы нашли файл .htaccess , чтобы исправить ошибку 403 forbidden , нужно:
- Скачать файл .htaccess на компьютер, чтобы создать резервную копию;
- После этого удалить файл.
- Теперь попробуйте получить доступ к сайту;
- Если он работает нормально, это просто указывает на то, что файл .htaccess был поврежден;
- Чтобы создать новый файл .htaccess, войдите в панель управления WordPress и выберите пункт Настройки> Постоянные ссылки;
- Без внесения изменений нажмите на кнопку «Сохранить», расположенную в нижней части страницы.
- Таким образом, для сайта будет создан новый файл .htaccess .
Если это не решит проблему, перейдите к следующему шагу.
Шаг 2 — Работа с правами доступа
Еще одна причина по которой возникает ошибка http 403 — это неверные права доступа к файлам или папкам. При создании файлов для них по умолчанию задаются определенные права доступа. Они указывают, как и кто может осуществлять их считывание, запись и выполнение. Но иногда нужно изменить права доступа по умолчанию.
Это можно сделать с помощью FTP-клиента или диспетчера файлов. FTP-клиент FileZilla предоставляет больше возможностей для изменения прав доступа к файлам и папкам. Поэтому мы рекомендуем использовать его, чтобы выполнить следующие действия:
- Зайдите на свой сайт через FTP ;
- Перейдите в корневой каталог;
- Выберите основную папку, содержащую все файлы вашего сайта ( обычно это public_html ), кликните по ней правой кнопкой мыши и выберите пункт « Права доступа к файлам »:
- Установите флажок « Применить только к папкам », укажите права 755 в поле числового значения и нажмите кнопку « OK »;
- После того, как FileZilla изменит права доступа к папкам, повторите шаг 3 , но на этот раз выберите параметр « Применить только для файлов » и введите 644 :
- После этого попробуйте зайти на сайт и проверьте, не решена ли проблема.
Если ничего не изменилось, пришло время перейти к следующему шагу.
Шаг 3 — Отключение плагинов WordPress
Высока вероятность того, что ошибка 403 была вызвана несовместимостью или некорректной работой плагина. На этом этапе мы отключим плагины, чтобы выяснить, не с ними ли связана ошибка 403 . Лучше, конечно, отключить все плагины одновременно, а не каждый по отдельности. Так вы сможете обнаружить проблему и решить ее.
Вот, что нужно сделать:
- Перейдите на хостинг через FTP и найдите папку public_html ( или папку, содержащую установочные файлы WordPress );
- Перейдите в папку wp-content ;
- Перейдите в папку Plugins и переименуйте ее, например в » disabled-plugins «, чтобы ее было легче найти.
После отключения плагинов попробуйте снова зайти на сайт. Проблема исправлена? Если да, то причиной ошибки является некорректно работающий плагин. Попробуйте отключить плагины один за другим. Так вы сможете его обнаружить.
Затем можно попытаться обновить плагин. Если ни один из перечисленных способов не помог, то пришло время обратиться к своему хостинг-провайдеру.
Заключение
Следуя приведенным выше рекомендациям, можно избавиться от ошибки 403 forbidden .
Вадим Дворников автор-переводчик статьи « What Is 403 Forbidden Error And How To Fix It »
Источник
apache tutorial — 403 forbidden Error — apache — apache web server — apache server — apache2
2. http 403 — Cause:
This problem 403 error occurs when any of the following conditions is true:
- There is no index file in the document root directory (for example, there is no index.html or index.php file in the public_html directory) which arises status 403.
- http status code 403 — Permissions are set incorrectly for either the .htaccess file or the public_html directory:
- The file permissions for the .htaccess file should be set to 644
- read and write permissions for the user, and
- read permissions for the group and world).
- The permissions for the public_html directory should be set to 755
- read, write, and execute permissions for the user, and
- read and execute permissions for the group and world.
- When the 403 area code error occurs, this often indicates that the permissions for the public_html directory are set incorrectly to 644 which may arise 403 forbidden access is denied.
- Caching -> A previously requested version of a URL returning a 403 forbidden error it may be cached in the browser. Clearing your cache may solve the problem. So that, you aren’t being served with old files.
- http forbidden — Accessing Hidden Files / Wrong URL -> If a user tries to access hidden files stored on your web server such as the .htaccess file, this will also return a 403 forbidden error.
- Hidden files are not meant to publicly accessible which is why the server restricts them and lets the user know they are forbidden to access them.
- Similarly, if a user incorrectly enters a URL, a 403 forbidden Nginx error message (or something similar) may also occur depending on what they have entered, for example, a directory instead of a file path.
- nginx 403 — Fixing an Nginx 403 Forbidden Error
- In addition to the 403 error causes mentioned above, there are also a few things you can do to troubleshoot for Nginx 403 forbidden error.
- No index file defined – When there is no index file present in the directory defined with the index directive, this can result in an nginx 403 forbidden.
For example, consider the following index directive:
index index.html index.htm index.php;
click below button to copy the code. By Apache tutorial team
- Nginx will search from left to right for the defined index files. Starting with index.html and ending with index.php, if none of the defined files are found, Nginx will return a 403 error.
- IP based restrictions – Your nginx.conf file should also be verified to ensure you are not unintentionally denying a particular IP. Check the configuration file for directives similar to deny 192.x.x.x; which will block said IP from accessing a particular directory, website, or your complete server (depending on where you define it).
- Autoindex Off – With Nginx, if you don’t have an index file then a request gets passed on to the ngx_http_autoindex_module. If this module is set to off then you will likely receive a Nginx 403 forbidden error. Setting this module to on should resolve the 403 error. For example:
location /directory {
autoindex on;
}
click below button to copy the code. By Apache tutorial team
3. 403 forbidden error fix or 403 forbidden access is denied how to solve :
- First, make sure there is an index page in the document root directory.
- Next, make sure the correct file permissions are set for the .htaccess file.
- Type the following command at the command prompt:
- how to fix error code 403 — To set the correct file permissions in the public_html directory. Then type the following command at the command prompt:
4. Differences Between 403 Forbidden and 401 Unauthorized Errors
- A 401 – Unauthorized error occurs when a request to a particular resource that requires authentication either does not provide authentication or the authentication provided fails.
- A 403 error on the other hand, is returned when the authentication process is passed, but the user is not allowed to perform a particular operation or the operation is forbidden to all users.
Related Searches to 403 forbidden Error
how to hack 403 forbidden siteshow to bypass 403 forbidden sql injectionbypass 403 forbidden nginxbypass forbidden you don t have permission to accesshow to bypass 403 forbidden blocked by url filterbypass forbidden download403 forbidden apple iforgotapple support 403 forbiddenapple 403 forbidden shieldwhat does 403 forbidden mean on iphone403 forbidden iphoneapple id forbidden shieldapple website 403 forbiddenfix 403 forbidden error on ipadhow to solve 403 forbidden error in wordpresswordpress 403 forbidden nginxwordpress you don’t have permission to access / on this server.403 forbidden error fix cpanelyou don’t have permission to access /wp-admin/ on this server.wordpress 403 forbidden wp-adminyou don’t have permission to access /wp-login.php on this server.you don’t have permission to access /wp-admin/post.php on this server.403 forbidden nginx ubuntu403 forbidden nginx fixnginx 403 forbidden macdirectory index of /usr/share/nginx/html/ is forbiddennginx 403 forbidden centosnginx 403 forbidden windowsdirectory index of «/var/www/» is forbidden403 forbidden nginx phphow to fix 403 forbidden error on google chrome403 forbidden error fix android403 forbidden access is denied403 forbidden shield