Permission denied
Laravel needs the following permission configuration:
- write access to bootstrap/cache
- write access to storage
To setup permissions you can either set a custom user account as owner (preferred) or use www-data as owner. The first solution is better because it allows the user to upload files via SSH or FTP without any issues.
The following commands would create an account deployer who would own the site:
sudo useradd -g www-data deployer
cd /var/www/<site>/public
sudo chown -R $USER:www-data /var/www/<site>/public
sudo find . -type f -exec chmod 664 {} \;
sudo find . -type d -exec chmod 775 {} \;
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
Symlinks not followed
You may get errors if the site has symbolic links and you do not have enabled the option FollowSymlinks:
You should add the option FollowSymlink to the vhost. Fore example:
<Directory /var/www/<site>/public>
AllowOverride All
allow from all
Options +Indexes +FollowSymLinks
</Directory>
Make sure rewrite is enabled:
sudo a2enmod rewrite
Reload profile after changes:
sudo service apache2 reload
You must be logged in to post a comment.