Ubuntu/Apache2/ Forbidden/Permission error

前端 未结 3 1117
独厮守ぢ
独厮守ぢ 2021-01-20 15:07

I have Ubuntu 11.10 with Lamp installed

There is some files that i can\'t access to from my web directory \"/var/www\"

http://localhost/banner/banner.html I

相关标签:
3条回答
  • 2021-01-20 15:21

    the user running the apache deamon, on ubuntu thats www-data (like in most debian based systems), needs at least read permissions for the files. But as you posted only owner root and group root has read rights.

    Actually owner root has rw group root has r.

    So the user actually running the webserver (www-data) falls to the others permissions, which have none.

    Either do a chmod -R o+r /var/www/banner/* or a chown -R www-data /var/www/banner to fix that.

    0 讨论(0)
  • 2021-01-20 15:21

    May be it is an issue with your banner.html permissions - apache`s user has no permissions even to read it.

    0 讨论(0)
  • 2021-01-20 15:40

    I always forget that while the sub-directories and files need the read permission, the sub-directories also need execute permission.

    chmod a+x banner
    

    This tends to come up when I've saved a web page in the 'Webpage, Complete' format with Chrome or Firefox and am then trying to serve it under localhost, which I often do when building mockups for clients.

    0 讨论(0)
提交回复
热议问题