• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Directory permissions and .htaccess

ZopfWare

Regular Pleskian
Can anyone tell me what has happened to my Apache that all of a sudeden I have to set permissions of 751 (drwxr-x--x) to get httpdocs and cgi-bin (or any other directory with an .htaccess file) to run? If I leave them at the default plesk settings I get a 403 error related to being unable to read the .htacess file...

This is driving me nuts not being able to figure out what has happened.

Any help is greatly appreciated.
 
I am having exactly the same problem since a few weeks. I don't know what happend either. Do you have a sollution for this already ?

Thanks in advance!
 
I wound up having to change the permissions on the httpdocs and cgi-bin directories to 751 and that has taken care of the problem...but it still bugs me to not know why it is happening.
 
Originally posted by ZopfWare
I wound up having to change the permissions on the httpdocs and cgi-bin directories to 751 and that has taken care of the problem...but it still bugs me to not know why it is happening.

Ok,

But what about new domains you create ?
If i create new domains, then the permissions of that domain still aren't correct!

Thanks for your reply!
 
The permission you have set is 751 which is generally 750, here in case of 750 there is no execute permission, so when you are setting 751 it indicates that you are setting execute permission for the directory having the .htaccess, I think that when a .htaccess file is created under the httpdocs directory it needs execution permission as the .htaccess is the first file when any thing from httpdocs directory is called to execute.

Hope this helps you,
Also let me know that what are the default permission set to the httpdocs and cgi-bin directory when a new domain is created.
By Default it is 750.

Thanks,
Anand
 
That's the strange stuff here. It is 750.
However in the apache error log it logs:

[Sun Mar 20 22:48:36 2005] [crit] [client 62.xx.xx.xx] (13)Permission denied: /home/httpd/vhosts/domain.com/httpdocs/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

It just happend.

Probably it has something to do with apache. But i checked the config files a dozend times, put back backup config files. But nothing seems to help.
No i am using a script after a domain has been created to chmod the directories to 751.

Thanks for your reply!
 
Anyone got a solution to this one we are having the same problem also and it is driving us mad. All our sites were saying permisison denied at one stage.

What version of Plesk are you using?
We are using 7.1.1.

Also we now appear to be having this issue on protected directories also. (Did anyone else install Nagios by any chance?)

I think it was Nagios that stuffed things up for me and it looks like the following script in the RPM did it;

preinstall scriptlet (using /bin/sh):
if ! /usr/bin/id nagios &>/dev/null; then
/usr/sbin/useradd -r -d /var/log/nagios -s /bin/sh -c "nagios" nagios || \
logger -t nagios/rpm "Unexpected error adding user \"nagios\". Aborting installation."
fi
postinstall scriptlet (using /bin/sh):
/sbin/chkconfig --add nagios

if /usr/bin/id apache &>/dev/null; then
if ! /usr/bin/id -Gn apache 2>/dev/null | grep -q nagios ; then
/usr/sbin/usermod -G nagios apache &>/dev/null
fi
else
logger -t nagios/rpm "User \"apache\" does not exist and is not added to group \"nagios\". Sending commands to Nagios from the command CGI is not possible."
fi

if [ -f /etc/httpd/conf/httpd.conf ]; then
if ! grep -q "Include .*/nagios.conf" /etc/httpd/conf/httpd.conf; then
echo -e "\n# Include /etc/httpd/conf.d/nagios.conf" >> /etc/httpd/conf/httpd.conf
# /sbin/service httpd restart
fi
fi


Unfortunately I can't work out which part did the damage.



http://www.netvantage.com.au
 
I install nagios as well. I think it has changed the default username on apache but I cannot find any reference to what the default username for apache is that plesk uses. Anyone got a working copy of apache that can post the username and group it is using?

Thanks
 
Yep. Nagios blew the big one on me as well. Anyone have a solution?
New domains still aren't executable until I manually change them?
Thoughts?
:confused:
-ICE51
 
Researching the apache group configs now as a friend of mine has a brand new 7.5.2 box and his perms are 750 on the httpdocs and everything runs fine. I gotta belive Nagios adjusted the apache groups somehow so the plesk owned dirs can't be run anymore.
Will post if I find a solution.
-ice51
 
Great,

Still have the same problem over here. Also after a nagios install!
 
Fixed it!

Whew...
I compared the local groups via webmin with my friend's new 7.5.2 box and found the difference.

the psaserv group in his had the following:
apache psaftp psaadm

mine was missing the 'apache'
I added apache and restarted the httpd service and vola! All my dirs that were 750 work fine!

Hope this helps.
-ICE51
 
Just want to add my vote to the the fix suggested above.

simple run

Code:
usermod -G psaserv apache

to add apache back into the psaserv group
then run

Code:
grep psaserv /etc/group

to confirm this, this should return something like:

Code:
psaserv:x:2523:psaftp,psaadm,apache
 
yeap, it is working again!
thanks a lot pals!

and, yes, nagios was generated this issue
 
For anyone on SuSE linux

hi, very slight variation on this fix for anyone on SuSE 10.3

apache runs under the user wwwrun so you need to do this: -

usermod -G psaserv wwwrun

then: -

/etc/init.d/apache2 restart

But thank you so much for posting this fix, you saved me a hell of a lot of time :)
 
Back
Top