Nginx Configuration for Typo3 CMS - ISPConfig

Discussion in 'Installation/Configuration' started by CrypticDesigns, Aug 15, 2015.

  1. Hello fellow linux managers,

    I've got a problem with my nginx host configuration. Currently I am trying out a CMS that i've never used before called Typo3. Its looks clean and fast, and there is a good documentation about it, but that mainly supposes your using apache. Since I am using ISPConfig with Nginx, php-fpm this doesn't work with me. There is a default .htaccess file that comes with it, and I looked into it but didn't help me yet. The default htaccess looks like:
    http://pastebin.com/X10EjvBG

    Now I have made an nginx configuration, with some rewrite rules but this doesn't work yet and gives me a "500 internal server error":
    http://pastebin.com/egqqL9TZ

    I searched the www but couldn't find anything according to this problem. Does anybody have an idea or got experience with this?
    Thank you
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to add just this into the nginx directived field of the website in ispconfig:

    Code:
    location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ {
    expires max;
    log_not_found off;
    }
    location ~* \.(cur|ico|gif|png|jpe?g|css|js|swf|woff)((\?\d\d\d\d\d\d\d\d\d\d)|(\?s=\d\d\d\d\d\d\d\d\d\d))$ {
    expires max;
    log_not_found off;
    }
    location ~* \.(cur|ico|gif|png|jpe?g|css|js|swf|woff)(\?v\d\d?\.\d\d?\.\d\d?)$ {
    expires max;
    log_not_found off;
    }
    location ~* ^(/typo3/sysext|/typo3conf/ext).*\.(cur|ico|gif|png|jpe?g|css|js|swf|woff) {
    expires max;
    log_not_found off;
    }
    location = /clear.gif {
    empty_gif;
    expires max;
    }
    location ^~ /typo3/gfx {
    expires max;
    }
    location ^~ /typo3temp/compressor {
    expires max;
    }
    location ~* \.(sql|htaccess|htpasswd|tpl|html5|xhtml) {
    deny all;
    }
    
    location / {
    if ($query_string ~ ".+") {
    return 405;
    }
    # pass requests from logged-in users to PHP
    if ($http_cookie = 'nc_staticfilecache|be_typo_user' ) {
    return 405;
    } # pass POST requests to PHP
    if ($request_method !~ ^(GET|HEAD)$ ) {
    return 405;
    }
    if ($http_pragma = 'no-cache') {
    return 405;
    }
    if ($http_cache_control = 'no-cache') {
    return 405;
    }
    error_page 405 = @nocache;
    
    # serve requested content from the cache if available, otherwise pass the request to PHP
    try_files /typo3temp/tx_ncstaticfilecache/$host${request_uri}index.html @nocache;
    }
    
    location @nocache {
    try_files $uri $uri/ /index.php?$args;
    }
    
    location ^~ /typo3temp/tx_ncstaticfilecache {
    expires 43200;
    charset utf-8;
    }
    
     
  3. itsolon

    itsolon Member

    Hello Till, thank you for sharing your config for typo3
    magento 2 runs fine with your help,
    i managed magento 1 nginx config to work fine too
    but i have still problems with
    owncloud, and typo3 6.2
    i wanted to upgrade typo3 6.2 to 7.6 with the upgrade wizard
    i can login into install tool etc.
    but the i i want to start wizard then
    error 500 internal server error
    https://typo3upgrade.itsolon.com/ty...[context]=standalone&install[controller]=tool
    this url
    its horrible
    i dont know what to set in nginx settings ...
    or how to update this
    is there something with the url sysext?
    any location directive? or is it another problem?

    i have following entry in my error log
    $, request: "GET /phpmyadmin/navigation.php?ajax_request=1&token=e2a12491559781063b23dd72154b2580&aPath=cm9vdA%3D%3D.dHlwbzN1cGdyYWRl&vPath=cm9vdA%3D%3D.dHlwbzN1cGdyYWRl&pos=0&pos2_name=&pos2_value=&searchClause=&searchClause2=&_nocache$


    and my website error .log
    "https://typo3upgrade.itsolon.com/ty...[context]=standalone&install[controller]=tool"
    2018/03/15 14:32:32 [error] 4149#4149: *185 FastCGI sent in stderr: "PHP message: PHP Warning: Declaration of TYPO3\CMS\Core\Package\FailsafePackageManager::registerPackagesFromConfiguration() should be compatible with TYPO3\CMS\Core\Package\PackageManager::registerPackagesFromConfiguration($registerOnlyNewPackages = false) in /var/www/clients/client0/web10/web/typo3_src-6.2.31/typo3/sysext/core/Classes/Package/FailsafePackageManager.php on line 24" while reading response header from upstream, client: 77.190.244.244, server: typo3upgrade.itsolon.com, request: "GET /typo3/sysext/install/Start/Install.php?install[action]=folderStructure&install[context]=standalone&install[controller]=tool&install[controller]=ajax&install[action]=folderStatus&_=1521120756550 HTTP/2.0", upstream: "fastcgi://unix:/var/lib/php7.0-fpm/web10.sock:", host: "typo3upgrade.itsolon.com", referrer: "https://typo3upgrade.itsolon.com/ty...[context]=standalone&install[controller]=tool"
    2018/03/15 14:32:33 [error] 4149#4149: *185 FastCGI sent in stderr: "PHP message: PHP Warning: Declaration of TYPO3\CMS\Core\Package\FailsafePackageManager::registerPackagesFromConfiguration() should be compatible with TYPO3\CMS\Core\Package\PackageManager::registerPackagesFromConfiguration($registerOnlyNewPackages = false) in /var/www/clients/client0/web10/web/typo3_src-6.2.31/typo3/sysext/core/Classes/Package/FailsafePackageManager.php on line 24" while reading response header from upstream, client: 77.190.244.244, server: typo3upgrade.itsolon.com, request: "GET /typo3/sysext/install/Start/Install.php?install[action]=folderStructure&install[context]=standalone&install[controller]=tool&install[controller]=ajax&install[action]=environmentStatus&_=1521120756551 HTTP/2.0", upstream: "fastcgi://unix:/var/lib/php7.0-fpm/web10.sock:", host: "typo3upgrade.itsolon.com", referrer: "https://typo3upgrade.itsolon.com/ty...[context]=standalone&install[controller]=tool"


    Could it have to do with HTTP2???
     
  4. itsolon

    itsolon Member

    UPDATE:
    i made following mistake(s):

    first of all:
    - after moving from plesk to ispconfig i did not realize that i made wrong symlink
    i had absolute symlink with /var/www/vhosts/domain.com (vhosts as in plesk usual)
    that worked: but only in plesk of course.
    now i have made following symlink structure as recommended from typo3
    ln -s typo3_src-6.2.31 typo_src
    ln -s typo3_src/typo3 typo3/src
    ln -s typo3_src/index.php index.php

    then the installation paths were set fine.

    next mistake (its a shame)
    i forgot to go to install tool
    under domain.com/typo3/install
    you can then do some checks and clear all caches
    the biggest time costing mistake i did there.
    i couldnt login anymore into the admin because did
    Reset backend user preferences

    from that point i were not sure if my installation were successfull or anything else went wrong.

    ok but now even tills small config works fine with my "old" typo3.

    next step is to update but inside there is templavoila and there is a migration neccessary with templavoilaplus or any other template solution.. i will do when i have time for this.

    best regards Markus
     

Share This Page