Magento Apache Configuration (Available Application Warning / etc / local.xml)

Just finished installing Magento on a Linux server.

When I go to the Magento admin panel, I see the following message at the top of the page.

Your web server is not configured correctly. As a result, configuration files with sensitive information are accessible externally. Contact your hosting provider.

What is the most likely reason for this error message?

Thanks,

John Gaucher

+8
linux apache magento
source share
7 answers

Magento uses .htaccess files in different directories to restrict access to directory trees. You will find them in the app, in the media, in var, and wherever Magento came up with to stick with them. They perform various actions, such as refusing to view (application, var), execution (media.htaccess). In order for these .htaccess files to work, it is very important that the following is set either in the .htaccess root directory or in the virtual server configuration.

Options FollowSymLinks AllowOverride All 

More than likely, Magento discovers that the .htaccess directory file in the application does not allow to deny network access to your application file /etc/local.xml, so all your credentials and the encryption key are visible to everyone who has a web browser.

Another problem may be that your file / directory permissions are too weak.

For Magento running FastCGI, SuPHP or LSAPI

 find . -type f -exec chmod 644 {} \; find . -type d -exec chmod 755 {} \; chmod 550 pear #for Magento pre 1.5 chmod 550 mage #for Magento 1.5 and up chmod 550 cron.sh 

For Magento running DSO (mod_php)

 find . -type f -exec chmod 644 {} \; find . -type d -exec chmod 755 {} \; chmod o+w var var/.htaccess app/etc chmod 550 pear #for Magento pre 1.5 chmod 550 mage #for Magento 1.5 and up chmod 550 cron.sh chmod -R o+w media 

For the question below , the following .htaccess file is assumed in the / etc application folder. Attempting to read something through the server should cause error 403. The next step is to contact your web host to find out why this file is not respected.

 Order deny,allow Deny from all 

Note. . If you use alternative HTTP servers such as nginx, you should look for all .htaccess files created in the Magento directory tree and recreate all the .htaccess functions used by Magento in your nginx so that you have the same file / directory protections that and a standard Apache DSO installation. The same goes for installing Windows in IIS.

+19
source share

I tried all the above and no one worked on our web hosting. "AllowOverride All" will not work on our vhosts.conf, and as a result, "Deny from all" is ignored.

Add this code to .htaccess and it works in charm ...

 ##### Block access to local.xml ##### RewriteRule ^(.*)local.xml$ - [F,L] 
+4
source share

1. Add the following code to httpd.conf.

  <Directory "/var/www/html/app/etc"> Options FollowSymLinks AllowOverride All </Directory> 
  • set ftp permission to local.xml => 600

  • sudo /etc/init.d/httpd restart

  • sudo /etc/init.d/httpd reload
+2
source share

Magento checks if /app/etc/local.xml is available (using curl). You can try it yourself in the browser to check.

To fix this, you will make sure that this file is no longer displayed. How you do this depends on your web server. Magento comes with .htaccess to prevent access, but you can copy folders without hidden files. cp does not copy them. Or apache cannot access .htaccess to check file permissions.

+1
source share

I solved this problem by following these steps:

Confirm that there is a .htaccess file in the subdirectory of the Magento installation application. If the .htaccess file is missing, create a new .htaccess file in the application subdirectory, which contains the following directives:

 Order deny,allow Deny from all 

Confirm that the file permissions are set correctly. As a rule, directories should have permissions equal to 755 (read, write and execute rights for the user, as well as read and execute rights for the group and the world). Files must have 644 permissions (read and write permissions for the user and read permissions for the group and the world).

Change the resolution of the .htaccess file to 644, and then refresh the magento admin page.

0
source share

@Brijmohan karadia and @Spudley

Your solution worked. I am using AWS Linux to install Magento.

  • Go to /etc/httpd/conf/httpd.conf

  • Add the following to httpd.conf.

    FollowSymLinks Allow Override All Options

3.set SSH / FTP permission on local.xml => 600 in the path to the /app/etc/local.xml file

  1. sudo service httpd restart
0
source share

The application file /etc/local.xml should be changed to 600 and the error will disappear;)

-4
source share

All Articles