Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
client denied by server configuration (Magento 1.4.2.0)
 
Nico1899
Jr. Member
 
Total Posts:  23
Joined:  2010-10-08
 

Hi,

i have a brand new magento 1.4.2.0 installation.

If i click a link in the admin backend, i receive follow error in the apache log:

[Thu Dec 09 11:17:10 2010] [error] [client 192.168.50.5] client denied by server configuration: /srv/www/htdocs/www.magento-shop.com/app/etc/local.xml

The IP-Address 192.168.50.5 is the server, my client has another IP.

Apache configuration:

AllowOverride All
Order allow,deny
Allow from all

is set for this host

With Magento 1.4.1.1 i didn’t have this error message in apache log.

thank you for help

 
Magento Community Magento Community
Magento Community
Magento Community
 
furnitureforyoultd
Enthusiast
 
Total Posts:  833
Joined:  2009-03-09
 

I\’ve got the reverse. If I tried to load the frontend then this appears in the error log:

[error] [client 127.0.0.1] client denied by server configuration: C:/wamp/www-1420/app/etc/local.xml

main page is blank, although I can log in to the admin panel.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nico1899
Jr. Member
 
Total Posts:  23
Joined:  2010-10-08
 

i found in a .htaccess in the app directory.

i don’t know why, but Magento access the local.xml over apache since 1.4.2.0 ?

add follow line to the app/.htaccess solve the problem:

Allow from 192.168.50.5 127.0.0.1 localhost

This is a bug and should fixed.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Darren Grant
Sr. Member
 
Total Posts:  84
Joined:  2008-03-31
 

It seems that magento is testing to see if the file can be accessed each time a page is loaded and alerts you to the fact that this file that contains your MySQL database password is readable. So it is correct but seems odd that every page should check this filling the log with error messages instead of just doing it once at the login page.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nico1899
Jr. Member
 
Total Posts:  23
Joined:  2010-10-08
 

Thanks, I understand now why this message appears.

Good for sure, but I’m worried me about the performance of Magento.
A better solution is in any case to pack this kind of security checks in a separate script that is called completely independent of Magento.

It disturbs me deeply not only secure if the Web server log is filled with garbage.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Martin
Guru
 
Avatar
Total Posts:  445
Joined:  2007-08-31
Brno | London | Los Angeles
 

The solution that helped me with the client denied by server configuration: /app/etc/local.xml problem is this small code change:

File:  /app/code/core/Mage/Adminhtml/Block/Notification/Security.php
Row:  73
Action:  comment out POST action for local.xml file

private function _isFileAccessible()
    
{
        $defaultUnsecureBaseURL 
= (string) Mage::getConfig()->getNode('default/' Mage_Core_Model_Store::XML_PATH_UNSECURE_BASE_URL);

        
$http = new Varien_Http_Adapter_Curl();
        
$http->setConfig(array('timeout' => $this->_verificationTimeOut));
        
// $http->write(Zend_Http_Client::POST, $defaultUnsecureBaseURL . $this->_filePath); # 20110107: change
        
$responseBody $http->read();
        
$responseCode Zend_Http_Response::extractCode($responseBody);
        
$http->close();

        return 
$responseCode == 200;
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
dangarza
Jr. Member
 
Total Posts:  6
Joined:  2009-02-04
 

Im having the same “403 Forbidden You don’t have permission to access /downloader/ on this server” error when trying to load Magento Connect Manager from the Admin, everything else works correctly.
This is from my error log:
client denied by server configuration: /home/ab831/public_html/app/etc/local.xml
I tried changing permissions to several folders, then the htaccess from /app and finally i tried commenting out line 73. Still not working.
Im trying to install a language pack.
Any clues?

 
Magento Community Magento Community
Magento Community
Magento Community
 
amelguizo
Jr. Member
 
Total Posts:  1
Joined:  2011-01-25
 

I had this same error and I solved it by clearing “writeable by group” in the permissions of the folder magento/downloader.

Hope this help you

 
Magento Community Magento Community
Magento Community
Magento Community
 
pglock
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2010-05-06
Princes Risborough, UK
 

There seems to be two issues in this thread, both related to permissions. I’m running sites on servers with suPHP so to clear the problem I first applied the following script in the root of each site :

find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && chmod o+var var/.htaccess includes includes/config.php app/etc && chmod 550 pear
Then changed the permissions of app/etc/local.xml
chmod 600 app/etc/local.xml
That seems to have stopped the log entries.

[Edit] Posted too soon. The log entries are still there! Looks like I’ll have to do the code hacking suggested in the previous posts. Always a good idea to check you permissions with the code above though…

 
Magento Community Magento Community
Magento Community
Magento Community
 
quentinmachu
Jr. Member
 
Total Posts:  2
Joined:  2011-03-05
 

Hi,

I’ve the same problem that others ( 404 with apache error on any page except when logged in as Admin ), I already tried to reset file permissions ( via the wiki ! ) ; the code tweak ....

PHP 5.2.6-1+lenny9 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 4 2010 06:06:53)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

Any help ?

Thanks ! =)

Magento is Imba ! :o Others solutions are crap..

 
Magento Community Magento Community
Magento Community
Magento Community
 
quentinmachu
Jr. Member
 
Total Posts:  2
Joined:  2011-03-05
 

Hi again,

I forgot to tell you : Magento ver. 1.5.0.1

 
Magento Community Magento Community
Magento Community
Magento Community
 
Flipmedia
Member
 
Avatar
Total Posts:  43
Joined:  2009-09-24
 

The log entry seems to be “normal” response from Magento when you have configured it correctly!!!

The reward for a correct configuration is an apache error log entry for every page request for your admin area.

It would seem the only way to stop this error log entry is to:

Duplicate: /app/code/core/Mage/Adminhtml/Block/Notification/Security.php

To: /app/code/local/Mage/Adminhtml/Block/Notification/Security.php

Add the following after line 68:

return false// Added as I know my local.xml is protected and to bring sanity to my Apache error log

Resulting in:-

/**
     * If file is accessible return true or false
     *
     * @return bool
     */
    private function _isFileAccessible()
    
{
    
        
return false// Added as I know my local.xml is protected and to bring sanity to my Apache error log
        
        
$defaultUnsecureBaseURL = (string) Mage::getConfig()->getNode('default/' Mage_Core_Model_Store::XML_PATH_UNSECURE_BASE_URL);

        
$http = new Varien_Http_Adapter_Curl();
        
$http->setConfig(array('timeout' => $this->_verificationTimeOut));
        
$http->write(Zend_Http_Client::POST$defaultUnsecureBaseURL $this->_filePath);
        
$responseBody $http->read();
        
$responseCode Zend_Http_Response::extractCode($responseBody);
        
$http->close();

        return 
$responseCode == 200;
    
}

Note to Magento:-
I agree with checking to seeing if the config files is world editiable / readable but this check should be reserved to just the configuration part of the admin area, as users with acces to this section also most likely have access to the files system and can rectify this issue.

 
Magento Community Magento Community
Magento Community
Magento Community
 
davidhw
Jr. Member
 
Total Posts:  5
Joined:  2011-02-10
 

Fantastic - this is very useful, in fact it may well solve my problem with SLOW LOGIN TO MAGENTO ADMIN AREA (sorry - just shouting so that Google can hear this for other people) :D

Checking my server logs, it takes anything between 2 - 35s to access and check that file, which probably explains why its been so slow for me to login to my Magento Admin at times.

Thank you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Eco_HP
Jr. Member
 
Total Posts:  2
Joined:  2011-05-03
 

Wonderful! Thank you, Flipmedia! Your solution works well for my Magento. Apparently it also makes my Magento a little bit faster :)

 
Magento Community Magento Community
Magento Community
Magento Community
 
emca
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2011-11-30
Bucharest
 

http://www.yireo.com/tutorials/magento/magento-administration/1322-client-denied-by-server-configuration-appetclocalxml

 
Magento Community Magento Community
Magento Community
Magento Community
 
kalenjordan
Sr. Member
 
Avatar
Total Posts:  218
Joined:  2011-10-31
Pasadena, CA
 
Nico1899 - 10 December 2010 04:27 AM

i found in a .htaccess in the app directory.

i don’t know why, but Magento access the local.xml over apache since 1.4.2.0 ?

add follow line to the app/.htaccess solve the problem:

Allow from 192.168.50.5 127.0.0.1 localhost




This is a bug and should fixed.

Hey @Nico1899 thanks for the info.  Do you happen to have a link handy to the bug in the Magento bug tracker?  I did a quick search there for “htaccess” and “htaccess admin login” and didn’t find it.  (haven’t looked too deeply yet).

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2