简体   繁体   中英

How do I give permission for apache to retrieve imgs from directory?

I'm using fedora and I need to set up apache so that it can retrieve images from a directory. So far it can write to my image directory since sending the command ...

semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/profile-pics'

restorecon -v '/var/www/profile-pics'

but when I try to access these files through the localhost/profile-pics/my_pic.jpg, the URL isn't being found. And as I said before, my PHP script is able to upload images from the user and write to this directory. I just don't understand why I can't retrieve the images and send them back to the client.

您需要使用httpd或vhost配置中的部分来允许访问: http : //httpd.apache.org/docs/2.2/mod/core.html#directory

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