magento client denied by server configuration - php

Magento isn't displaying anything but a white homepage, in the error_log the error given is:
client denied by server configuration: /var/www/httpdocs/app/etc/local.xml
I can access the admin area fine, does anyone know why this might happen?

The log entry appears to be created by calls magento is making to ensure you have secured your admin properly. Rather than it being an error it is actually something you want to see as it is effectively saying your admin is secure. Clearly this is just noise in your logs.
There is a really elegant solution on how to fix this and speed up your admin page load described here:
http://www.yireo.com/tutorials/magento/magento-administration/1322-client-denied-by-server-configuration-appetclocalxml
Essentially create the file in the location below with the contents shown. Once you have added the file:
app/design/adminhtml/default/default/layout/local.xml
With the contents:
<layout>
<default>
<remove name="notification_security" />
<remove name="notification_survey" />
</default>
</layout>
Remember to flush your caches: System > Cache Management

Okay... few mixed issues on this page, here is my attempt to clear these up...
Client denied by server configuration: /var/www/httpdocs/app/etc/local.xml
Alan: is correct is this unrelated to your issue... Magento as of 1.4 fills your error log with this message, one for each page you access in the Admin area... This is as a result of Magento "testing" your config file to see if it can be seen be the world... Kinda dumb as this is error is showing it is protected...
The solution to which you were looking for when you came accross the page, seems to be to "hack the core": http://www.magentocommerce.com/boards/viewthread/213947/#t306425
APC issue stated as APC not palying nicely with Magento:-
Switching Magentos caching backed from "apc" back to "files"... You must clear your var/cache directory "rm -R var/cache/*" before switching Magento back to use cache method files from APC... otherwise Magento will read old cache and barf... It is also sensible for the same reason to clear APC by restarting Apache prior to switching to use APC...
And Finally... Original question:-
White screen... most likely as a result of a PHP error and your server having display errors turned off... Firstly manually clear cache on command line from within Magento document root "rm -R var/cache/*"... this may solve as broken cache can cause this... if not... check php config that "display_errors" equals 1 or On... To view PHP settings, in Magento document root, on command line $echo "<?php phpinfo() ?>" > phpinfo.php... request phpinfo.php in browser from magento domain and review php settings, change as necessary...
Other: Renaming errors/local.xml.sample to errors/local.xml will result in you being able to see the complete Magento Error Exception...
Hope this helps someone...

The wording on that error
client denied by server configuration: /var/www/httpdocs/app/etc/local.xml
is an Apache error message that's unrelated to your problem. Someone tried to directly access your local.xml file via a web browser but were blocked by the server configuration. This is correct behavior.
Your white screen error is happening for another reason.
Are there other errors in the log?
Configure PHP to log PHP errors separately.
You can access the magento admin, so turn on logging for Magento specific errors
With the above in place, configure your store to only server file to your IP so you can figure out which error in the log(s) (Apache, PHP, or Magento) is related to your direct request.

APC caching apparently doesn't play nicely with Magento, disabling it threw a PHP error that an outdated theme was producing

Related

WordPress - wp-admin blank page

I am currently unable to get into my WP Dashboard. The wp-admin page is completely blank throwing no visible errors. I can hit wp-login.php, use my login credentials and hit Log In and then again just blank page, still not logged in. The site it self works fine.
I did enable wp_debug and this still is not showing any errors.
I just took over this site so I do not know of any recent updates or changes made to themes,plugins etc.
UPDATE: I was able to get wp-admin page to load the wp-login page properly by just uploading a clean version of wp-admin/index.php. However I am still seeing a blank page and unable to login after hitting 'log in'
I check the error logs for the server and I do not see anything related to this site.
Make sure that u don't have blank spaces in config and functions file at the top or bottom of theses.
btw, it seems like server's error. See his log :)
Sounds like a PHP error.
Add:
error_reporting(E_ALL);
ini_set('display_errors', '1');
To the top of wp-admin/index.php
A common troubleshooting technique would be to rename your
./wp-content/plugins
folder. This will temporarily deactivate all your plugins. Often such issues are caused by a malfunctioning plugin, usually after an automated update.
Another thing you can try is to switch the php version of your hosting account. Most hosting companies run CloudLinux and you have in cPanel -> Select PHP Version. You can test the administrator login with different versions.
You can also contact your webhosting provider and have them check if the ConfigServer eXploit Scanner (cxs), often installed on shared servers hasn't quarantined any of your website files.
It might be a long shot, but it is also worth checking your .htaccess file.
Good luck!
It may be caused from an error in your theme functions file. If you have a theme backup (which you are sure worked before), try restoring it from the file manager in your host panel. If you don't, try uploading a popular wordpress theme (e.g. twenty-sixteen) then change your default theme from PhpMyAdmin.
Go to your root folder, open wp-config.php,...
Enable Debug mode.(i.e)
define('WP_DEBUG', false);
to
define('WP_DEBUG', true);
And inspect it using Firebug.

Symfony framework install 406 Not Acceptable Error w/CPanel & WHM

So I am trying to get Symfony working on my server by following these install instructions.
http://symfony.com/doc/current/book/installation.html#book-installation-permissions
I got to the part where I ran this command in console in the directory where I wanted the framework to be installed.
symfony new my_project_name
I then followed these instructions to set my web root directory to /web as I believe I'm supposed to do?
It installed all the files correctly since I can see them in the folder. I made sure to restart apache and I'm positive document root is in the correct location.
http://tecadmin.net/how-to-change-document-root-of-primary-domain-in-cpanel/#
Once I did this I was supposed to be able to test the installation, but nothing seems to happen except that 406 error?
This is the exact error I get.
An appropriate representation of the requested resource /app.php could not be found on this server.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
I'm not sure what else to do.
Please note, that since I'm using CPANEL I can't change the virtual host configurations of apache if that is the issue, so I'm looking for a CPanel specific answer. Thank you!
Okay so I finally figured out what to do, I had 2 problems. Because I installed as the 'root' user I had to run the following command on the symfony installation.
chown -R devdistribution:devdistribution .
In my case, my username is devdistribution but you would just put your own. Make sure to do this on the top level not just the /web folder.
I knew this was one of the errors because the apache log said something along these lines
Mismatch between target UID (520) and UID (501) of file "/home/devdistribution/public_html/distribution_tech/web/app.php"
This fixed the 500 error, but not the 406. To fix the 406 error you need to login into WHM and type modsecurity to find it in the search field.
go to the configuration option for it, you will see this.
Rules Engine SecRuleEngine
This setting controls the behavior of the rules engine.
Process the rules.
Do not process the rules.
Process the rules in verbose mode, but do not execute disruptive actions.
Select 'Do not process the rules'. Then save at the bottom. This fixed the issue for me and I was able to see the opening symfony screen!
However, this I'm sure leaves security vulnerabilities now...so I still need help on the proper way to handle mod security with symfony in this case if anyone knows? I'll make a separate question for this.
Step 1:
Login to your cPanel account and start searching for the file manager icon under the files section.
Step 2:
As always, you need to make sure, you see the public_html directory. Depending on the web hosting you have, you may also see the home directory after opening the file manager.
Step 3:
Find the .htaccess file and right-click to edit.
Step 4:
After choosing an edit option, you see a popup asking to disable encoding if you wish. You have to click on the Edit button to continue.
Step 5:
On a new tab, you can see many rewritten rules. You have to add the code to the .htaccess file.
<IfModule mod_security.c>
SecFilterEngineOff
SecFilterScanPOSTOff
</IfModule>

Symfony2.3 with xampp v3.2.1 files under web is not responding

i have set up my symfony 2.3 project with xampp correctly as I had access the app_dev.php successfully. However, i can not access it and other files like config.php now!! I really have no idea what was going wrong, when I clicked on the web/ or type /path/to/web/app_dev.php all browsers are just keep loading, not even return errors.
p.s. preparations like "php app/check.php" has been done, and /web/config.php was also fine before I met this problem.
Please give some hints and I appreciate all! Thx..
Please check for file permissions and turn on your error logger. Turn on display_errors and try it once again.
Possible reasons are
- Permission to write in cache and log
- Your symbolic links is not pointing properly to web
- Config file is not configured with ORM etc..
All these should come as error file and will be shown on the screen

Magento - issue working with forms

I've set up a new server for my magentocommerce.
Unfortunatly when I moved the domain to the new location (tests have been done using another domain) a weird issue started happening: when the login page displays on the frontend, or the backend and I (and customers, of course) do submit the right credentials the page refresh, the cookie gets set but the form is displayed again. It's such a cache being served instead of the right content (catalog).
The only solution actually is delete the cache on the browser and retry.
I've used varnish http accelerator for two days, but since I've had too much issues dealing with it I uninstalled it and cleaned things up (now there's only the apache instance to serve user requests).
I also installed APC caching and Fooman Speedster.
What can it be to cause this issue?
Can you please help me to get in the right direction to fix this issue? On the old server it was not happening, but since that time there have been some modification to the store (nothing to do with authentication anyway).
The apache error log does not report anything, the only thing in there is PHP: syntax error, unexpected BOOL_TRUE in /etc/php5/apache2/conf.d/apc.ini on line 4 which has to do with the line apc.enabled = 1.
Look at the System -> Configuration -> Web tab in the admin panel and see if the Cookie Path and Cookie Domain are set correctly for the new server. You can do it directly in the database as well. In this case, search for rows with web/cookie/cookie_path and web/cookie/cookie_domain paths. Setting them to empty values in the admin panel or NULL in the database may also help.
You should also clear Magento cache (System -> Cache Management) and APC cache (here's how to do it: How to clear APC cache entries?).
I don't know if it solves your specific form problem but we had the same error in the apache error log.
Our failure was, we've copied the apc.ini code from http://magebase.com/magento-tutorials/speeding-up-magento-with-apc-or-memcached/. They use "#" for comments.
Turns out we had to use ";" for comments. After these changes, there were no more errors in the apache error log.

errors in admin area after updating to joomla 2.5

I updated my joomla site to 2.5 from joomla 1.7 I faced below errors:
1- I cannot open global configuration page from the admin area and receive "500 internal server error"
2- When I press the add new article button from the admin area I receive the same error.
3- When I press the add new category button from the admin area I receive the same error.
appreciate if you can help to solve this.
I had the same issue and was about to go crazy (even considered switching to another CMS) ... the problem appears to be related to the fact that Joomla 2.5 is throwing several errors and the PHP engine was trying to write to the php_errors.log file in a directory where it didn't have write permissions, thus the 500 error (misleading I know).
Incidentally, this happened to me on a Windows box running IIS 7.5, not Apache. The solution, intiailly was to edit my PHP.INI file and change the "error_log" setting to point to a folder which had write permissions for all websites. I just created a new folder and gave the 'users' group modify permissions - not the best way to do it but for development purposes, it was ok.
You then have to restart IIS.
It is important that you actually restart IIS, not just restart the application pool, as this didnt seem to force PHP to re-read the config.
Once I got this far, I started noticing errors (which I will continue to post here among other places until I can find a solution). So far, the first error I see is when I go to add a New Menu Item, i get this:
Warning: is_file(): open_basedir restriction in effect. File(\metadata.xml) is not within the allowed path(s): (C:\Inetpub\vhosts\myWebsite.com\httpdocs\) in C:\Inetpub\vhosts\myWebsite.com\httpdocs\libraries\joomla\filesystem\file.php on line 523
It appears that Joomla is trying to verify if the \metadata.xml file exists, however I'm not sure where that file is or what it does. At this point, i suspect it's still ultimately a permissions problem, but I'm still digging...
The most common cause of 500 error that I've seen on Joomla! websites is related to the permissions of the files on the website. eg. yesterday we had to fix a website for a company that had upgraded and in the process somehow set the Group write permission on their /administrator directory.
You can check this quickly through the file manager of your hosting service, if using CPanel you should make sure your directories are set to 755 (User has read/write/execute permissions, Group and World have read permission) and files set to 644 (User has read & write permissions, Group and World have read permission).
These sound like the same issue.
See this rundown of potential upgrade problems by Brian Teeman:
http://brian.teeman.net/joomla-1.7/upgrading-to-joomla-2.5-some-warnings.html
The problem you are having could be related to the database issue he mentions.

Categories