0

I'm running dockerized-magento. I have demo site up and running. I am attempting to open System-> Magento Connect > Magento Connect Manager. I can't get Connect Manager to come up and run - I'm totally stuck on this. Seems like a file permissions/file access issue.

Can someone please give me a helping hand here? thanks

TL;DR https://github.com/andreaskoch

1) first attempt I was getting

logs/access.log
172.17.0.1 - - [04/Nov/2016:07:28:37 +0000] 
  "GET /index.php/admin/extension_local/index/key/8c1406415afa6475579d2a7c2b4f9c19/ HTTP/1.1" 302 5 
  "http://dockerized-magento.local/index.php/admin/dashboard/index/key/541772674d54782a3ea990343e5ce075/" 
  "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-" 172.17.0.1 - - 
  [04/Nov/2016:07:28:37 +0000] "GET /downloader/?return=http%3A%2F%2Fdockerized-magento.local%2Findex.php%2Fadmin%2F HTTP/1.1" 403 169 
  "http://dockerized-magento.local/index.php/admin/dashboard/index/key/541772674d54782a3ea990343e5ce075/" 
  "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"

logs/error.log
2016/11/04 07:28:37 [error] 7#7: *12 access forbidden by rule, client: 172.17.0.1, server: , 
    request: "GET /downloader/?return=http%3A%2F%2Fdockerized-magento.local%2Findex.php%2Fadmin%2F HTTP/1.1", host: "dockerized-magento.local", 
    referrer: "http://dockerized-magento.local/index.php/admin/dashboard/index/key/541772674d54782a3ea990343e5ce075/"

2) I did a search for downloader and found, config/nginix/sites-enabled/default.conf. added allow for IP from above

server {
...
   location ^~ /app/                       { deny all; }
    location ^~ /includes/                  { deny all; }
    location ^~ /lib/                       { deny all; }
    location ^~ /media/downloadable/        { deny all; }
    location ^~ /pkginfo/                   { deny all; }
    location ^~ /report/config.xml          { deny all; }
    location ^~ /var/                       { deny all; }
    location ^~ /downloader/                { allow 172.17.0.1; deny all; }
    location /var/export/                   { deny all; }

...
}

3) This gets me a bit closer but still fails. Now I can access Magento Connect Manager but when I do it opens a file, looks like /web/downloader/index.php

<?php
...

if (version_compare(phpversion(), '5.2.0', '<')===true) {
    echo  '<div style="font:12px/1.35em arial, helvetica, sans-serif;"><div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;"><h3 style="margin:0; font-size:1.7em; font-weight:normal; text-transform:none; text-align:left; color:#2f2f2f;">Whoops, it looks like you have an invalid PHP version.</h3></div><p>Magento supports PHP 5.2.0 or newer. <a href="http://www.magentocommerce.com/install" target="">Find out</a> how to install</a> Magento using PHP-CGI as a work-around.</p></div>';
    exit;
}

require_once("lib/Mage/Autoload/Simple.php");
Mage_Autoload_Simple::register();

umask(0);
Maged_Controller::run();

4) ls -al web/downloader (I chmod index.php and mage.php to 777), doesn't help.

drwxrwxrwx  7 root www-data 4096 Nov  7 12:33 ./
drwxrwxrwx 13 timr www-data 4096 Nov  7 12:33 ../
-rw-rw-rw-  1 root www-data   22 Nov  7 12:33 config.ini
-rw-rw-rw-  1 root www-data 1150 Nov  7 12:33 favicon.ico
-rw-rw-rw-  1 root www-data  176 Nov  7 12:33 .htaccess
-rwxrwxrwx  1 root www-data 1642 Nov  7 12:33 index.php*
drwxrwxrwx  2 root www-data 4096 Nov  7 12:33 js/
drwxrwxrwx  3 root www-data 4096 Nov  7 12:33 lib/
drwxrwxrwx  4 root www-data 4096 Nov  7 12:33 Maged/
-rwxrwxrwx  1 root www-data 4614 Nov  7 12:33 mage.php*
drwxrwxrwx  4 root www-data 4096 Nov  7 12:33 skin/
-rw-rw-rw-  1 root www-data 2018 Nov  7 12:33 target.xml
drwxrwxrwx  4 root www-data 4096 Nov  7 12:33 template/

5) .htaccess

<IfModule mod_deflate.c>

    RemoveOutputFilter DEFLATE
    RemoveOutputFilter GZIP

</IfModule>

<Files ~ "\.(cfg|ini|xml)$">
    order allow,deny
    deny from all
</Files> 

6) config.ini

root_channel=community
7
  • what error you get? Nov 8, 2016 at 6:06
  • now it literally brings up the "open file" dialog box with a random name.bin, but the contents are the index.php file. I cant save it. If I quit the file it never goes further - I don't see the Connect Manager. If I cancel the edit Im back where I started. if you have any thoughts on what I can try to get some helpful info let me know
    – mancocapac
    Nov 8, 2016 at 6:58
  • @mancocapac if you want to install extenson immediately , Alternatively you can install the extension through FTP (like FileZilla). You can paste the extension key in this unofficial link and you can download the extension files. Nov 8, 2016 at 7:57
  • @MurtuzaZabuawala the original error was 403 forbiden from access.log above: "GET /downloader/?return=http%3A%2F%2Fdockerized-magento.local%2Findex.php%2Fadmin%2F HTTP/1.1" 403 169
    – mancocapac
    Nov 8, 2016 at 16:06
  • 1
    andreaskoch - fixed the problem !
    – mancocapac
    Nov 9, 2016 at 20:33

1 Answer 1

0

andreaskoch has fixed the problem.

the file dockerized-magento/config/nginx/sites-enabled/default.conf has been updated to exclude: location ^~ /downloader/ { deny all; }. This fixes the issue.

generally, nginx does not use .htaccess files which are used by apache. I believe apache is the default for magento and is pre-packaged with these files.

you can see: Configuring nginx for Magento 1.x for a general discussion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.