How to fix a permissions problem on www folder?

7,881

run this command in the terminal after navigating to www folder:

    sudo chmod 755 *     
Share:
7,881
95faf8e76605e973
Author by

95faf8e76605e973

Updated on September 18, 2022

Comments

  • 95faf8e76605e973
    95faf8e76605e973 over 1 year

    I have created a directory in my www folder using terminal and root user. Then, create some text files in that folder (with terminal and root user).

    Now, when I want to access these files and directory via browser, Apache said:

    403 Forbidden. You don't have permission to access /folder on this server.

    Other files and folders in www directory are accessible via browser (I uploaded them via FTP client).

    How can this be fixed?

  • 95faf8e76605e973
    95faf8e76605e973 about 11 years
    folder is set to 755, and files are 644. I tried this command: chown www-data:www-data folder, but it said: invalid user: www-data
  • prophecy201
    prophecy201 about 11 years
    Did you installed apache from apt? It should create a user and a group called "www-data". What does id www-data say? Take a look in "/etc/apache2/envvars" What is set for export APACHE_RUN_USER and export APACHE_RUN_GROUP? Try to chown your files to this user and group.