Magmi: дозволити імпорт після авторизації

Table of Content

Apache
Потрібно створити файл з конфігами для apache

# vi magmi/.htaccess
# вимикаємо перегляд вмісту директорій в браузері
Options -Indexes
# вмикаємо перегляд вмісту директорій в браузері
#IndexIgnore *.zip *.txt *.conf
# вмикаємо авторизацію
AuthUserFile /var/www/pitlane-ural/production/magmi/.htpasswd
AuthName "Restricted Access"
AuthType Basic
Require valid-user
#Deny from all
#Allow from 62.122.203.100

# вимикаємо можливість перегляди вміст файлу
<files ~ "\.(ini|conf)$">
  Order allow,deny
  Deny from all
</files>

Заповнюємо файл .htpasswd наступною командою

# htpasswd .htpasswd user

Nginx
Add the following location directive to your Nginx configuration file to protect by either IP or HTTP basic authorisation. Replace my.ip.add.ress and .htpasswd as necessary. Then reload for the changes to take effect.

location /magmi-web/ {
   satisfy any;
   #allow my.ip.add.ress;
   auth_basic "Restricted";
   auth_basic_user_file $document_root/.htpasswd;
}

To populate the contents of your .htpasswd file, you can use the following command (replace user and password as neccessary):

# printf "user:$(openssl passwd -1 password)\n" >> .htpasswd

Source: http://www.magestack.com/exploit-check/

Leave a Reply

Your email address will not be published. Required fields are marked *