Repository navigation
File Permissions
This page sets who may read and write each part of the application. The goal is that Apache (www-data) can read the code but not change it, and can write only where it must: tmp/ (cache and temporary files) and logs/.
The code must be installed as in Installing KeyAnyWhere.
Your user owns the files, the group www-data can read them, and nobody else can do anything. This also undoes the "writable by everyone" permissions that composer install gives to tmp/ and logs/.
sudo chown -R "$USER":www-data /var/www/keyanywheresudo chmod -R u=rwX,g=rX,o= /var/www/keyanywhereBoth Apache and the CLI (kaw-cake, which runs as www-data) write here, and you may run commands as your own user too. The ACLs below give both users write access to the existing files and to every file created later, as recommended by the CakePHP book.
sudo setfacl -R -m u:www-data:rwX -m u:"$USER":rwX /var/www/keyanywhere/tmp /var/www/keyanywhere/logssudo setfacl -R -d -m u:www-data:rwX -m u:"$USER":rwX /var/www/keyanywhere/tmp /var/www/keyanywhere/logswww-data must be able to write in logs/, and must not be able to write in src/:
sudo -u www-data touch /var/www/keyanywhere/logs/.write-test && echo "logs: writable" && sudo -u www-data rm /var/www/keyanywhere/logs/.write-testsudo -u www-data touch /var/www/keyanywhere/src/.write-test 2>/dev/null && echo "src: WRITABLE, check step 1" || echo "src: read-only"The output should be logs: writable and src: read-only.
Note
After a git checkout or composer install (an upgrade), run steps 1 and 2 again: new files get your user's default permissions.
Source code · Issues · Releases · Packagist · Online demo · Hosted edition
1. Getting started
2. Installing in production
- Overview
- Preparing the Server
- Installing KeyAnyWhere
- File Permissions
- Generating Security Keys
- Environment Variables
- Configuration Files
- Database Setup
- Insecure Password Catalog
- Web Server and HTTPS
- First-Run Setup
3. Operating your installation
4. Using KeyAnyWhere
5. Security
6. Development
7. Extending