Whenever i pull from git on my production server, which is azure vps, i have to give permission to my proejct directory, so that apache user can access it. Otherwise it says, pe
So, atlast i found a solution. What i really wanted was, whenever new file is created it should inherit all permissions from parent directory.
sudo chmod g+s /projectDirectory
You should execute this command in Ubuntu after installation:
sudo chmod -R 777 storage
This commands will set correct permissions on storage folder and everything inside it. Without this Laravel will not work.