简体   繁体   中英

apache “Access forbidden! Error 403” when creating alias to a directory in home

I'm new to apache. I'm trying to create an alias to my project folder which is in home/Documents/Projects/blog directory.

I added this to httpd configs:

Alias /blog "/home/ehsan/Documents/Projects/blog/ui/dist"   
<Directory "/home/ehsan/Documents/Projects/blog/ui/dist">
    DirectoryIndex index.html
    AllowOverride All
    Options FollowSymlinks
    Require all granted
</Directory>

I did this also:

sudo chmod -R 775 /home/ehsan/Documents/Projects/leitner/ui/dist

but I get "403 Access forbidden." error.

I did the same thing for phpmyadmin and it works.

I read somewhere that apache should have access to all the higher level directories. is that true?

apache version: 2.4.41 (Unix)

os: manjaro 18

I think you can make apache the owner of the folder which it's gonna make changes in it. Try this: head to your project directory as below

cd /home/ehsan/Documents/Projects/leitner

and then:

chown -R www-data:www-data ui/

if there was any error going on, send the log of apache here would be helpful

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM