1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice

Directory permissions and .htaccess

Discussion in 'Plesk for Linux - 8.x and Older' started by ZopfWare, Mar 18, 2005.

  1. ZopfWare

    ZopfWare Regular Pleskian

    25
    57%
    Joined:
    May 30, 2004
    Messages:
    215
    Likes Received:
    0
    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.
     
  2. pdreissen

    pdreissen Guest

    0
     
    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!
     
  3. ZopfWare

    ZopfWare Regular Pleskian

    25
    57%
    Joined:
    May 30, 2004
    Messages:
    215
    Likes Received:
    0
    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.
     
  4. pdreissen

    pdreissen Guest

    0
     
    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!
     
  5. anandpatilg

    anandpatilg Guest

    0
     
    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
     
  6. pdreissen

    pdreissen Guest

    0
     
    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!
     
  7. Jllynch

    Jllynch Regular Pleskian

    28
     
    Joined:
    Nov 11, 2003
    Messages:
    242
    Likes Received:
    0
    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
     
  8. 247trader

    247trader Guest

    0
     
    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
     
  9. ice51

    ice51 Guest

    0
     
    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
     
  10. ice51

    ice51 Guest

    0
     
    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
     
  11. pdreissen

    pdreissen Guest

    0
     
    Great,

    Still have the same problem over here. Also after a nagios install!
     
  12. Jllynch

    Jllynch Regular Pleskian

    28
     
    Joined:
    Nov 11, 2003
    Messages:
    242
    Likes Received:
    0
    I think its this line here from the RPm script that did it;
    if ! /usr/bin/id -Gn apache 2>/dev/null | grep -q nagios ; then
    /usr/sbin/usermod -G nagios apache &>/dev/null

    Anyone know exactly why?





    http://www.netvantage.com.au
     
  13. ice51

    ice51 Guest

    0
     
    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
     
  14. whitecurve

    whitecurve Guest

    0
     
    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
     
  15. sebastian_md

    sebastian_md Guest

    0
     
    yeap, it is working again!
    thanks a lot pals!

    and, yes, nagios was generated this issue
     
  16. DigitalCrowd

    DigitalCrowd Basic Pleskian

    24
    23%
    Joined:
    Jul 5, 2002
    Messages:
    58
    Likes Received:
    0
    hehehe... glad I found this thread.

    I installed Nagios and all went south. Did the fix and wham, back in business.
     
  17. iaino2002

    iaino2002 Guest

    0
     
    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 :)
     
Loading...