Apache - 在存在的文件上获得403错误

时间:2017-06-04 12:16:02

标签: apache ubuntu-16.04 vhosts

我有一个在Ubuntu 16.04上运行的apache服务器,现在我有以下问题,那就是我的虚拟主机上出现403错误。 (You don't have permission to access / on this server.)

这是权限:

Permissions

这是我的.conf:

<VirtualHost *:80>
    ServerName api.luukwuijster.io

    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/html/api.luukwuijster.io/

    <Directory /var/www/html/api.luukwuijster.io/>
        Order allow,deny
        AllowOverride All
        Require all granted
    </Directory>


    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =api.luukwuijster.io

RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

这是我的错误.log告诉我:

  

[Sun Jun 04 14:03:00.957530 2017] [access_compat:error] [pid 24594] [client 77.163.120.254:55376] AH01797:客户端被服务器配置拒绝:/var/www/html/api.luukwuijster。 IO /

有谁知道如何解决这个问题?

非常感谢任何帮助!

修改

我的ssl conf:

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName api.luukwuijster.io

    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/html/api.luukwuijster.io/

    <Directory /var/www/html/api.luukwuijster.io/>
        Order allow,deny
        AllowOverride All
        Require all granted
    </Directory>


    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
# Some rewrite rules in this file were disabled on your HTTPS site,
# because they have the potential to create redirection loops.

# RewriteCond %{SERVER_NAME} =api.luukwuijster.io
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]

SSLCertificateFile /etc/letsencrypt/live/api.luukwuijster.io/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/api.luukwuijster.io/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

0 个答案:

没有答案