.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

ozgurerdogan

Verified User
Joined
Apr 20, 2008
Messages
343
Sometimes some users deletes public_html folder (not sure if there is a way to avoid user deleting this folder?), so I have to create it with following bash:

HTML:
=================================================================

#!/bin/sh
user=username
domain=domain.com

mkdir -p /home/$user/domains/$domain/public_html/cgi-bin
mkdir -p /home/$user/domains/$domain/private_html
mkdir -p /home/$user/domains/$domain/public_ftp
mkdir -p /home/$user/domains/$domain/stats
mkdir -p /home/$user/domains/$domain/logs

mkdir -p /home/$user/backups 

chown -R $user:$user /home/$user


echo Completed...

exit 0;


==================================================================

But after creating folders, this time I am getting:
.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
even I set 755 to public_html folder. It does not fix problem. So Ihave to run:

cd /usr/local/directadmin/scripts
./set_permissions.sh all

to fix the issue. But I think I am doing in wrong way.

./set_permissions.sh all fixes .htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, is there a way to set correct permissions for that user/domain having pcfg_openfile problem?

Thanks
 
Look at the file, and it's paths, before you run the script, and then again afterwards. Then you should be able to see the difference and what you should set manually.

Jeff
 
Do you mean set_permissions.sh ? I would not dare to edit that file as copy and run it :(

But do you have any idea about issue I face about ".htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable"

I have this problem when I re-create user folders. Maybe there is a an easier way to fix it expect runing set_permissions.sh?

Thanks in advance.
 
I'm not sugesting you edit the set permissions script. Only to run it and look to see what changes it's made. Then you'll know what changes you need to make if you don't want to run it each time.

Jeff
 
Ahh it makes tons of things. It will be hard to detect what changes it makes. After running it, I see 755 permission for public_html and I tried that before. So I think It makes something it backend.

For ".htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable" errors, Cpanel suggests reinstalling FrontPage extensions. Am I only one having this issue :) ?
 
Hello,

There was a reported bug, but I wasn't able to reproduce it:
http://www.directadmin.com/features.php?id=1161
I added an extra chmod call anyway, so check to see if you're issue matches this. (check if the .htaccess is chmod to 600 or 644)

As for setting permissions, your call:
Code:
chown -R $user:$user /home/$user
is likely going to break a few things with regards to stats, logs and emails.

You can run it (that's fine to get a proper baseline for most files), but just be sure to call:
Code:
./set_permissions.sh user_homes
after you do the chown.

John
 
Yes ./set_permissions.sh user_homes corrected problem and took much shorter.

But wondering, do not I need to run it only for user having the permission issue instead all users (user_homes)? Can script be run for a specific user?
 
You are so kind. Thank you. Will future versions of DA also include it? or should I keep it with different name?
 
Sorry to barge in, I know about http://help.directadmin.com/item.php?id=166 but what about preventing deletion in actual ProFTP? Has anyone managed this? Some new clients aren't familiar with the DA structure, so they go ahead and delete everything in /home/<user> - bad times :( Even though our welcome email states not to touch these files/directories!
 
Yes thats important part. If we could avoid users deleting those must exist folders, that would help lot.
 
So, maybe something like this:

Code:
<Directory /home/*/domains/*/public_html>
<Limit DELE>
DenyAll
</Limit>
</Directory>

<Directory /home/*/domains/*/public_html/*>
 <Limit RMD XRMD>
    AllowAll
    </Limit>
</Directory>
 
i get same problem like this not in public_html but in private_html (ssl enabled)
i already try running this
./set_permisions.sh set_user_home username
yes it's work but next few minute error again i also get 403 forbidden and log like this

[Mon Aug 08 06:52:22 2011] [crit] [client 114.79.59.44] (13)Permission denied: /home/domain/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

fyi : i use DA + mod_ruid2
 
There were reports of mod_ruid2 throwing that error when only 1 of the 4 templates were customized.

Related:
http://help.directadmin.com/item.php?id=2

But make sure the custom changes have been done in all 4 virtual_hots2 files, and not just the virtual_host2.conf.
The issue was described here where the issue was with subdomains, as the main domain was set correctly.

John
 
Back
Top