Joomla and Linux permissions

Friday, 16 December 2016 17:58 administrator
Print

There are many users asking for the correct permissions on a Joomla installation.

Various things do not work as expected and many users give 777 permisions in order to overcome these issues.

This is very - very bad. Do not ever assign a directory facing the internet 777 permissions.

The directory permissions should always be 755 and the file permissions 644.

So if I have these in place "why do I have errors ?". Because of the wrong ownership on files and directories.

There is a confussion between permissions and ownership.

If you have the correct permissions then all your trouble comes from "ownership".

Please change the owner in the directory of your Joomla installation to the one that Apache uses.

For Joomla on Ubuntu, in order to change the ownership on a shell, type the following:

cd /var/www/joomla/
[sudo] chown -R www-data:www-data .

Use [sudo] without square brackets if you are not logged in as root.

Replace "joomla" with the name of the directory on your installation.

Don't forget the "." after a space at the end of the command.

Also for the permissions on all directories and all files use the following command:

cd /var/www/joomla/
[sudo] find . -type f -exec chmod 644 {} \;
[sudo] find . -type d -exec chmod 755 {} \;

Last Updated on Saturday, 30 June 2018 10:05