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?


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

    sudo chmod 755 *     

The webserver must have privilieges to read the files and directories in this webserver-root-directory. Make sure the permissions are 644 (or higer if required) and owned by www-data:www-data or your FTP-User if this work for your setup.

Try to delete your browser-cache if the error is still shown.

  • 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 – mrdaliri Feb 21 '13 at 8:49
  • 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. – prophecy201 Feb 21 '13 at 14:33

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.