1

I know this question has been asked a lot of times but I'm completely stucked. My /var/www/html folder contains:

mbfr/
|-- index.html
|
school/
|-- index.html

I want to exemple.com serves the mbfr directory and exemple.com/school serves the school directory. Here is my VirtualHosts config file:

<VirtualHost *:80>
    ServerName exemple.com

    ServerAdmin xxxxx@exemple.com
    DocumentRoot /var/www/html

    Alias / /mbfr
    Alias /school /school

    <Directory "/var/www/html/school">
            Order allow,deny
            Allow from all
            Require all granted
    </Directory>

    <Directory "/var/www/html/mbfr">
            Order allow,deny
            Allow from all
            Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

exemple.com works fine but exemple.com/school gives me

Forbidden
You don't have permission to access /school/ on this server.
1

Do you have the correct permissions set on the */school folder? I had the same 403 message recently after reinstalling a folder in /var/www/html after an OS upgrade. It turned out that the premissions on the individual files were ok but on the folder only I myself as owner had read, write and execution permissions. Group and others also needed read and execution permissions so a simple chmod a+rx did the trick for me. Could be worth checking.

0

Please understand that my answer below is not an actual solution but a workaround, as it removes a security enforcement around httpd and the effects of this action can not be predicted. Although, until you figure out what a good and permanent solution is, it works.

as root user on your server, execute the commands below

setenforce 0
service httpd start

the setenforce 0 command puts apache in to SELinux Permissive mode. As I am not a web administrator and have no intrinsic knowledge of apache, I am not aware of repercussions of this action. Maybe someone can enlighten both of us. Since my webserver is not anything critical, I really could not care less. I am okay if I have to install the server from scratch. But your case might be different. So, take my advice with a grain of salt. A large grain at that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.