0

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?

2 Answers 2

2

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

    sudo chmod 755 *     
0

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.

2
  • 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, 2013 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. Feb 21, 2013 at 14:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .