15

From a live magento setup I made a tar.gz, moved that to an domains of another DirectAdmin user, extracted the tar.gz, copied the database, changed the URL of domain in the database. Front-end works good.

Backend gives me the following error:

Your web server is configured incorrectly. As a result, configuration files with sensitive information are accessible from the outside. Please contact your hosting provider.”

I already check the folder and file permission. Also tried to change the rights from the user:group settings with SSH access to the same user as the DirectAdmin user name. But that did not work either.

Note that this installation is on the same server as the live environment.

Live: (working) http://imageshack.us/photo/my-images/197/nrhj.png/
Test: (not working) http://imageshack.us/photo/my-images/542/uklz.png/

Mukesh
  • 7,630
  • 21
  • 105
  • 159
user2576151
  • 151
  • 1
  • 1
  • 4

8 Answers8

10

Specifically check the permissions on app/etc/local.xml as usually this means it is world readable.

Also, there is supposed to be a .htaccess file in app/etc/ that denies the contents from being served out by the web server. Check just in case your tar backup didn't include it. Usually this problem comes about from using an FTP client to do the transfer that has had hidden file visibility turned off.

Fiasco Labs
  • 6,457
  • 3
  • 32
  • 43
  • 4
    The missing .htaccess was my issue. I went to a fresh Magento install and took the .htaccess that was located at /app (not /app/etc/). The .htaccess simply contains:Order deny,allow Deny from all – Joe Fletcher Jul 18 '14 at 23:10
8

For Apache 2.4.x you have to add Require all granted So it would look something like this:

<Directory /var/www/magento>
  AllowOverride All
  # New directive needed in Apache 2.4.3: 
  Require all granted
</Directory>

Source: Apache: client denied by server configuration

Community
  • 1
  • 1
John Veldboom
  • 2,049
  • 26
  • 29
6

Im using a Debian 7 with Apache 2.2.22 and Magento 1.9.1, adding

<Directory /var/www/magento/>
            AllowOverride All
</Directory>

in /etc/apache2/sites-available/default

works for me

Haselnussstrauch
  • 333
  • 2
  • 10
4

Similar to John Veldboom's answer I added this to /etc/apache2/apache2.conf since my magento install was in a different directory /var/www/html (eg. the directory path is wherever magento was extracted):

<Directory /var/www/html/>
        AllowOverride All
        Require all granted
</Directory>

With the following apache2 and ubuntu distro:

root@test-VirtualBox:/var/www/html# dpkg -l apache2 && lsb_release -a
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  apache2        2.4.7-1ubunt amd64        Apache HTTP Server
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:    14.04
Codename:   trusty
jmunsch
  • 22,771
  • 11
  • 93
  • 114
2

I had this issue on Debian and found my server-level site config (in /etc/apache2/sites-available/default) had AllowOverride None set. Changing that line to AllowOverride All fixed it.

1

Thanks Haselnussstrauch, your answer worked for me. My setting was in apache2.conf

sudo nano /etc/apache2/apache2.conf

Change the default AllowOverride None to AllowOverride All

<Directory /var/www/>
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

Then restart Apache:

sudo service apache2 restart
Eric S.
  • 41
  • 1
0

Many other places suggest that you can block ip addresses to your server by adding this to your httpd.conf

<Location />
order allow,deny
allow from all
deny from aa.bb.cc.dd
</Location>

however this for some reason causes all other .htaccess files to be ignored, including .htaccess files that are in place to protect magento.

user3338098
  • 907
  • 1
  • 17
  • 38
  • end summary: don't block ip addresses with apache (it's horrible), instead I use fail2ban, it's SO much better. – user3338098 Nov 06 '15 at 20:16
0

I have fixed issue, there is no .htaccess fine inside sub folder (especially app).

Qin Wang
  • 422
  • 4
  • 12