Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Installation & Hosting

Lost in permissions, blank page, Apache2 - local installation

Solved by Youle View solution

Started by Youle 1 year ago · 1 replies · 60 views
1 year ago

I'm using Debian 12, and trying to run Grav under my home/user directory, with the right permissions

This is what I did so far :

  • in the /etc/apache2/envvars file, i've set the running user and group to "myuser:myuser" as follows :
TXT
export APACHE_RUN_USER=myuser
export APACHE_RUN_GROUP=myuser
  • i've changed ownership of /var/www/html to "myuser:myuser" (not sure wether this is right or not)
  • I've set a symbolic link in /var/www/html that points to /home/myuser/www/mywebsite
  • in the browser, my index.html file is showing as it should when browsing to localhost/mywebsite and so does the index.php I've set up

But when I try to access localhost/mywebsite/grav, then I get a blank page, unless I set permissions to 777 to the entire grav folder.

First question : is it wrong to change the /var/www ownership to myuser ?
Second question : did I do well when changing the envvars file as I did ? Is that the way for apache to run under my username ?
Third question : which permissions should I give to /mywebsite/grav ? should I change something ? If I let the permissions set to 777, will there be a security problem when transferring to my webhosting ?

Thank you very much in advance. I'm trying to understand all those ownership and permissions subtleties but it's not that simple

last edited 06/07/25 by Youle
1 year ago Solution

I answered my third question this way:
I changed the ownership and permissions of home/user/www/mywebsite/grav this way :

BASH
cd
sudo chown -R www-data:myuser /www/mywebsite
sudo chmod -R 755
cd www/mywebsite
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;

I know this is partially in the Grav documentation, but it is not much detailed for someone like me who didnt' really understand what it is all about.

For example, the documentation doesn't say we must be in the www/mywebsite folder before correcting the chmod. It seems pretty obvious now that I understand what I do with this command, but it wan't at all when I first copy-pasted it in my terminal, and I guess I changed ownership of my entire home folder without even knowing.

My 2 other questions remain though. I want to be sure I did everything right.

👍 1

Suggested topics

Topic Participants Replies Views Activity
Installation & Hosting · by antoinep, 11 hours ago
5 59 5 hours ago
Installation & Hosting · by Jürgen Dietrich, 7 months ago
0 60 7 months ago
Installation & Hosting · by rappluk, 8 months ago
0 61 8 months ago
Installation & Hosting · by N, 12 months ago
3 71 12 months ago
Installation & Hosting · by Jonas Bertschinger, 1 year ago
3 117 1 year ago