Reputation: 397
I'm seeing a lot of errors in apache error log:
(13)Permission denied: [client xyz:63932] AH00529: /home/username/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/username/public_html/' is executable Default permissions for all account's public_html is 711 and for .htaccess 644.
The owner and group both are set to be respective account's username. I need this one so I don't want to change owners and groups.
I've been reading various threads and it is confusing. In some thread they say it should be 755 while on others they say to set it 751 (default for cPanel).
What should be default permissions for public_html folders?
Upvotes: 0
Views: 120
Reputation: 1
For the public_html directory:
chmod 711 /home/username/public_html This lets the owner read, write, and execute, while others can execute.
For the .htaccess file:
chmod 644 /home/username/public_html/.htaccess This lets the owner read and write, while others can only read.
Run this command to set ownership:
chown username:username /home/username/public_html/.htaccess chown username:username /home/username/public_html Replace username with your account's username.
For example:
chmod 711 /home/username 4. Look Over Your .htaccess File for Grammar Mistakes If the permissions and ownership are right, the .htaccess file might have grammar errors. Take a close look at what's inside to spot any slip-ups.
Upvotes: 0