Answer the question
In order to leave comments, you need to log in
Why does Apache 403 error occur?
Hello, dear experts) I was
creating a subdomain for the new version of my site (conditionally sub.domain.com). And ran into an unkillable 403 Apache error.
System: UBUNTU & Apache (DigitalOcean)
Framework: PHP Symfony
I will describe my actions.
Created folder:
/var/www/sub.domain.com
Created virtual host:
# /etc/apache2/sites-available/sub.domain.com.conf
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName sub.domain.com
ServerAlias www.sub.domain.com
DocumentRoot /var/www/sub.domain.com
<Directory /var/www/sub.domain.com>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
</VirtualHost>
RewriteEngine on
#RewriteCond %{HTTPS} off
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_URI} !public/
RewriteRule (.*) /public/$1 [L]
Доступ запрещён!
У Вас нет прав доступа к этой директории. Отсутствует индексный файл, или директория недоступна для чтения.
Error 403
[Sat Nov 21 18:48:27.288759 2020] [mpm_prefork:notice] [pid 31917] AH00169: caught SIGTERM, shutting down
[Sat Nov 21 18:48:27.396916 2020] [mpm_prefork:notice] [pid 32384] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 configured -- resuming normal operations
[Sat Nov 21 18:48:27.396988 2020] [core:notice] [pid 32384] AH00094: Command line: '/usr/sbin/apache2'
sudo -u www-data ls -l /var/www/sub.domain.com/
drwxrwxrwx 2 root root 4096 Nov 21 17:51 bin
-rwxrwxrwx 1 root root 2472 Nov 21 18:07 composer.json
-rwxrwxrwx 1 root root 262708 Nov 21 18:07 composer.lock
drwxrwxrwx 4 root root 4096 Nov 21 18:07 config
-rwxrwxrwx 1 root root 6 Nov 21 17:18 index.html
drwxrwxrwx 2 root root 4096 Nov 21 18:09 migrations
-rwxrwxrwx 1 root root 1065 Nov 21 18:09 phpunit.xml.dist
drwxrwxrwx 3 root root 4096 Nov 21 18:04 public
drwxrwxrwx 9 root root 4096 Nov 21 17:51 src
-rwxrwxrwx 1 root root 14176 Nov 21 18:20 symfony.lock
drwxrwxrwx 15 root root 4096 Nov 21 17:52 templates
drwxrwxrwx 2 root root 4096 Nov 21 17:52 tests
drwxrwxrwx 2 root root 4096 Nov 21 17:52 translations
drwxrwxrwx 4 root root 4096 Nov 21 18:09 var
drwxrwxrwx 20 root root 4096 Nov 21 18:20 vendor
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question