Install Magento 2 with ISPConfig 3.11 difficult or simple out of the box? Error 500

Discussion in 'ISPConfig 3 Priority Support' started by itsolon, Mar 8, 2018.

  1. itsolon

    itsolon Member

    Hello yesterday i tried to install Magento 2 from your APS List:
    i think the process itself should have worked due to the reason that files are copied and database is made.
    The database keeps empty and i get Error 500 with nice Error page without information.
    Searching for the switch display_errors and error_reporting i found a post from till where he explains, that i can simply include php.ini code on the options tab of each vhost inside ISPConfig 3.11 no need to go with putty.
    i made a directive snippet called errors on with following content

    display_errors = On

    there i could see that some rights were not set and i set it to the vhosts for example
    web3:client1
    then i tried again but now i get blank page on two ISPConfig installations.

    The question is:
    what did i wrong, i have standard php7 from your the perfect server installation for debian with nginx
    should i set any nginx value prior to installation
    or should i make letsencrypt later on?
    what is the suggested way to get this to work.

    Best regards Markus
     
    Last edited: Mar 8, 2018
  2. itsolon

    itsolon Member

    OK i compared the phpinfo from both old plesk server and new one, as far as i can say:
    soap was missing on new one which i simply could install

    In Ubuntu/Debian you can install with:
    $ sudo apt-get install php-soap
    Or in RHEL/Fedora you can install with:
    $ sudo yum install php-soap

    then im going on comparing, and huch.. how blind i can be:rolleyes:.. the allowed php memory value is 128 M in standard, on old server i ve set 4096M :) i know magento sure needs much more than 128 but i assume that 4096 is enough - my server has 32 GB and therefore it should work.

    will report if i could start installation

    by the way, the aps-installation from wordress was a success out of the box!!! with 128 MB
    ;)
     
  3. itsolon

    itsolon Member

    okay i set to 1024MB but still have white page, hmm installing the APP with aps package magento 2.1 fails too.
    error 500, with display errors on i get this
    okay now im sure that it must have to do with nginx

    **********************
    2018/03/08 11:24:55 [error] 2931#2931: *18 open() "/var/www/newall-digitalanzeigen.de/web/setup/index.php/session/prolong" failed (20: Not a directory), client: IPADRESS, server: newall-digitalanzeigen.de, request: "POST /setup/index.php/session/prolong HTTP/1.1", host: "newall-digitalanzeigen.de", referrer: "http://newall-digitalanzeigen.de/setup/"

    var/www/newall-digitalanzeigen.de/web/setup/index.php/navigation/side-menu" failed (20: Not a directory), client: ************
    Der kann den Pfad nicht finden!
    i need help at this point.
    Can anyone give me an hint what to post inside the nginx directives?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The APS packages are not made for nginx servers as far as I know, they are from apsstandard.org and probably contain apache configs only (.htaccess files). Beside that, not all of them are working, so it might always be that some of them cause problems, especially when a software is more complicated. I installed Magento 2 two weeks ago, but I use the normal Magento installation process with their install script and not an APS package. I used this nginx config in the nginx directives field which works pretty well here:

    Code:
    location ~ \.php$ { ##delete##
    }
    location @php { ##delete##
    }
    
    set $MAGE_ROOT {DOCROOT};
    
    ##subroot pub ##
    
    index index.php;
    autoindex off;
    charset UTF-8;
    error_page 404 403 = /errors/404.php;
    
    location ~* ^/setup($|/) {
        root $MAGE_ROOT;
        location ~ ^/setup/index.php {
            {FASTCGIPASS}
    
            fastcgi_param  PHP_FLAG  "session.auto_start=off \nsuhosin.session.cryptua=off";
            fastcgi_param  PHP_VALUE "memory_limit=768M \nmax_execution_time=600";
            fastcgi_read_timeout 600s;
            fastcgi_connect_timeout 600s;
    
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        /etc/nginx/fastcgi_params;
        }
    
        location ~ ^/setup/(?!pub/). {
            deny all;
        }
    
        location ~ ^/setup/pub/ {
            add_header X-Frame-Options "SAMEORIGIN";
        }
    }
    
    location ~* ^/update($|/) {
        root $MAGE_ROOT;
    
        location ~ ^/update/index.php {
            fastcgi_split_path_info ^(/update/index.php)(/.+)$;
            {FASTCGIPASS}
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO        $fastcgi_path_info;
            include        /etc/nginx/fastcgi_params;
        }
    
        # Deny everything but index.php
        location ~ ^/update/(?!pub/). {
            deny all;
        }
    
        location ~ ^/update/pub/ {
            add_header X-Frame-Options "SAMEORIGIN";
        }
    }
    
    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }
    
    location /pub/ {
        location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*\.xml) {
            deny all;
        }
        alias $MAGE_ROOT/pub/;
        add_header X-Frame-Options "SAMEORIGIN";
    }
    
    location /static/ {
        # Uncomment the following line in production mode
        # expires max;
    
        # Remove signature of the static files that is used to overcome the browser cache
        location ~ ^/static/version {
            rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last;
        }
    
        location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
            add_header Cache-Control "public";
            add_header X-Frame-Options "SAMEORIGIN";
            expires +1y;
    
            if (!-f $request_filename) {
                rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
            }
        }
        location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
            add_header Cache-Control "no-store";
            add_header X-Frame-Options "SAMEORIGIN";
            expires    off;
    
            if (!-f $request_filename) {
               rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
            }
        }
        if (!-f $request_filename) {
            rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
        }
        add_header X-Frame-Options "SAMEORIGIN";
    }
    
    location /media/ {
        try_files $uri $uri/ /get.php$is_args$args;
    
        location ~ ^/media/theme_customization/.*\.xml {
            deny all;
        }
    
        location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
            add_header Cache-Control "public";
            add_header X-Frame-Options "SAMEORIGIN";
            expires +1y;
            try_files $uri $uri/ /get.php$is_args$args;
        }
        location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
            add_header Cache-Control "no-store";
            add_header X-Frame-Options "SAMEORIGIN";
            expires    off;
            try_files $uri $uri/ /get.php$is_args$args;
        }
        add_header X-Frame-Options "SAMEORIGIN";
    }
    
    location /media/customer/ {
        deny all;
    }
    
    location /media/downloadable/ {
        deny all;
    }
    
    location /media/import/ {
        deny all;
    }
    
    # PHP entry point for main application
    location ~ (index|get|static|report|404|503)\.php$ {
        try_files $uri =404;
        {FASTCGIPASS}
        fastcgi_buffers 1024 4k;
    
        fastcgi_param  PHP_FLAG  "session.auto_start=off \nsuhosin.session.cryptua=off";
        fastcgi_param  PHP_VALUE "memory_limit=768M \nmax_execution_time=18000";
        fastcgi_read_timeout 600s;
        fastcgi_connect_timeout 600s;
    
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        /etc/nginx/fastcgi_params;
    }
    
    location ~* (\.php$|\.htaccess$|\.git) {
        deny all;
    }
     
    franciscopereira likes this.
  5. itsolon

    itsolon Member

    Thank you till the white page is still here but error has changed

    2018/03/08 13:07:53 [error] 7425#7425: *125 FastCGI sent in stderr: "Access to the script '/var/www/newall-digitalanzeigen.de/web//setup/index.php/session/prolong' has been denied (see security.limit_extensions)" while reading response header from upstream, client: 85.183.140.97, server: newall-digitalanzeigen.de, request: "POST /setup/index.php/session/prolong HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php7.0-fpm/web8.sock:", host: "newall-digitalanzeigen.de", referrer: "http://newall-digitalanzeigen.de/setup/"
     
    Last edited: Mar 8, 2018
  6. itsolon

    itsolon Member

    I assume it hast something to do with that
    ... and set cgi.fix_pathinfo=0 and your timezone:

    [...]
    cgi.fix_pathinfo=0
    [...]

    i had done it from your tutorial the perfect server
     
    Last edited: Mar 8, 2018
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Not sure why you assume that as the error message mentions something different:

    When you google for security.limit_extensions then you will see that this is neither related to the timezone nor the cgi.fix_pathinfo setting.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    As a side note as you seem to have this issue in /setup URL's, did you notice in the magento2 docs that Magento2 on nginx servers has to be installed by using their shell install script as the web installer is not compatible with nginx according to the Magento developers?

    From Magento docs:

    "You cannot use the Web Setup Wizard when installing Magento on nginx. You must use the command line."

    http://devdocs.magento.com/guides/v2.0/install-gde/prereq/nginx.html

    that's why I installed magento2 on my server as described in the official docs with:

    Code:
    ./magento setup:install --base-url=http://www.magento-dev.com/ --db-host=localhost --db-name=magento --db-user=magento --db-password=magento --admin-firstname=admin --admin-lastname=admin [email protected] --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1
    command after I uploading magento to the website and intalling the dependencies with "composer install -v"
     
  9. itsolon

    itsolon Member

    ok. thats important sidenote, i remember some post -someone asked why he cannot install magento -
    in your forum where you answered that web install is possible on nginx too .. but i cannot refind:( it because it is sure an older post-answer from you. with that in mind i was convinced that installation should work for nginx too.

    but i thank you very much :) that you showed me that very important note where i can see that this nginx web installation is not possible. i already installed composer in order to use it for the extensions etc. so im sure with your hint and the dev-docs it will be good to make it like this. I loved web interface installations, but some programs (i. e. the more complex ones) must have special treatment with nginx.
    http://devdocs.magento.com/guides/v2.2/install-gde/prereq/nginx.html

    i assumed it for that reason that i thought that you perhaps install php 7.1.14 without that cgi.fix = 0 thing.. if i remove the cgi.fix then this security feature is off and i can go further to check page even in PHP 7.0. As you can see on the image. (i show only for your interest)
    https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/

    but that all looses in sense when considering that even magento developers tell on their dev docs not to install it via webinterface. Commandline rules there ;)

    OK the next steps are - deleting the magento files and preparing new test.
    1. create new website in ISPConfig 3.11
    2. create ftp user
    3. create database and database user
    4. create mailbox (optional)
    5. doing commandline install with http://devdocs.magento.com/guides/v2.2/install-gde/prereq/nginx.html
    Best regards Markus
     

    Attached Files:

    • php.PNG
      php.PNG
      File size:
      181.3 KB
      Views:
      5
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    You are free to set that option to whatever works best for you.
     
  11. itsolon

    itsolon Member

    For your interest i managed the installation with following way:
    i gave magento 2 the 7.1.14 and recompiled it because --enable-intl was missing for me
    i installed it with the help of your tutorial
    https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/
    then the installer (with your nginx directives s. u. ) worked best.
    as far as i can see magento is up and running..
    in this tutorial the cgi.fix is not inside thats the reason this was possible even though magento developers say no.

    upload_2018-3-9_12-1-51.png
     

    Attached Files:

    Last edited: Mar 9, 2018

Share This Page