My simplesaml was working perfectly until I upgraded Apache to 2.4.6 on Ubuntu
The error I was getting :
Forbidden
You don't have permission to access /simplesaml/ on this server.
The HTTP 403 Forbidden response status code indicates that the server understands the request but refuses to authorize it. This status is similar to 401 , but for the 403 Forbidden status code re-authenticating makes no difference.
The instructions for installing simplesamlphp on Apache only require an alias for the simplesamlphp directory :
https://simplesamlphp.org/docs/stable/simplesamlphp-install#section_6
But for Apache 2.4.6+ the security has changed - it worked for me when I added a Directory directive. eg:
<VirtualHost *:80>
ServerName mywebsite.dev
DocumentRoot /home/myuser/www/mywebsite/
<Directory /home/myuser/www/mywebsite/>
Require all granted
</Directory>
Alias /simplesaml /var/simplesamlphp/www
<Directory /var/simplesamlphp/www/>
Require all granted
</Directory>
</VirtualHost>
While the chosen answer is correct I would like to add that SELinux can also cause this error. It took me a couple hours to realize that was my problem after following tons of examples online.
If you are running SELinux make sure you run the following command:
chcon -R --reference=/var/www /var/simplesamlphp
This will place the /var/simplesamlphp
directory in the same security context as /var/www
. You can't just place the /var/simplesamlphp/www
directory in the same context because _include.php accesses files in /var/simplesamlphp/lib
.
I hope this prevents someone from spending as much time on this problem as I did.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With