Я попробовал все на похожих вопросах, но не повезло.
Я получаю "У вас нет разрешения на доступ к X на этом сервере". на все запросы.
У меня есть два сайта на одном и том же IP-адресе, файлы конфигурации apache идентичны, права доступа к файлам идентичны, однако один работает, а другой нет.
файл конфигурации:
<VirtualHost x.x.xxx.xx:80>
ServerName site2.example.com
ServerAlias site2.example.com
Redirect / https://site2.example.com/
<IfModule mod_security2.c>
SecRuleEngine Off
</IfModule>
</VirtualHost>
<VirtualHost x.x.xxx.xx:443>
Protocols h2 http/1.1
ServerName site2.example.com
ServerAlias site2.example.com
ServerAdmin it@example.com
SetEnv ENVIRONMENT production
DocumentRoot /data/www/site2.example.com
<Directory /data/www/site2.example.com>
Options -Indexes +FollowSymLinks
AllowOverride All
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
Require all granted
</Directory>
<IfModule mod_security2.c>
SecRuleEngine Off
</IfModule>
ErrorLog /var/log/apache2/site2_error.log
LogLevel warn
KeepAlive On
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/site2.example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/site2.example.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
Header add Strict-Transport-Security "max-age=15768000"
# Add File Caching
<filesMatch ".(js|css|png|jpeg|jpg|gif|ico|pdf)$">
Header set Cache-Control "max-age=31536000, public"
</filesMatch>
# Disable slower encryption on older versions of IE
SetEnvIf User-Agent ".*MSIE [1-5].*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
SetEnvIf User-Agent ".*MSIE [6-9].*" \
ssl-unclean-shutdown
</VirtualHost>
Чего мне не хватать?
Используемые команды разрешения:
sudo chown -R www-data:www-data /data/www/site2.example.com
sudo find /data/www/site2.example.com -type f -exec chmod 644 {} \;
sudo find /data/www/site2.example.com -type d -exec chmod 775 {} \;
Я уже перезапустил apache.