fastcgi error after migration

Discussion in 'Installation/Configuration' started by naproxes, Jun 6, 2023.

  1. naproxes

    naproxes New Member

    Hi,
    i had some issues with the base System of my old server, so i thought a migration would solve my problems. now i got new ones.
    old server was debian9, upgraded to 10, upgraded to 11 and ispconfig 3.2.9p1 (orig. installed via "perfekt server howto"). new server is a debian 11.7 with ispconfig 3.2.10 provided by the auto install script.
    Now im getting some errors with my nextcloud:
    Code:
    2023/06/06 20:37:47 [error] 1728#1728: *338 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 10.13.37.11, server: nextcloud.domain.de, request: "GET /nextcloud/status.php HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php7.4-fpm/web4.sock:", host: "nextcloud.domain.de"
    following config was imported for the website:
    PHP open_basedir:
    Code:
    /var/www/clients/client1/web4/web:/var/www/clients/client1/web4/private:/var/www/clients/client1/web4/tmp:/var/www/nextcloud.domain.de/web:/srv/www/nextcloud.domain.de/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom
    Custom php.ini settings:
    Code:
    memory_limit=1g
    upload_max_filesize=20g
    post_max_size=20g
    always_populate_raw_post_data=-1
    max_execution_time = 3600
    
    ;zend_extension=/usr/lib/php/20151012/opcache.so
    opcache.enable=1
    opcache.enable_cli=1
    opcache.interned_strings_buffer=32
    opcache.max_accelerated_files=10000
    opcache.memory_consumption=128
    opcache.save_comments=1
    opcache.revalidate_freq=1
    extension=/usr/lib/php/20220829/memcache.so
    nginx Directives:
    Code:
    add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
    # HTTP response headers borrowed from `.htaccess`
    add_header Referrer-Policy                   "no-referrer"       always;
    add_header X-Content-Type-Options            "nosniff"           always;
    add_header X-Download-Options                "noopen"            always;
    add_header X-Frame-Options                   "SAMEORIGIN"        always;
    add_header X-Permitted-Cross-Domain-Policies "none"              always;
    add_header X-Robots-Tag                      "noindex, nofollow" always;
    add_header X-XSS-Protection                  "1; mode=block"     always;
    
    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }
    location ~ \.php$ {
        try_files /b615814d8f2c19dbcb25b1fbae07ce38.htm @php2;
    }
    
    location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ { return 404; }
    location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; }
    
    # Make a regex exception for `/.well-known` so that clients can still
    # access it despite the existence of the regex rule
    # `location ~ /(\.|autotest|...)` which would otherwise handle requests
    # for `/.well-known`.
    location ^~ /.well-known {
        # The rules in this block are an adaptation of the rules
        # in `.htaccess` that concern `/.well-known`.
        location = /.well-known/carddav { return 301 /remote.php/dav/; }
        location = /.well-known/caldav  { return 301 /remote.php/dav/; }
        location /.well-known/acme-challenge    { try_files $uri $uri/ =404; }
        location /.well-known/pki-validation    { try_files $uri $uri/ =404; }
        # Let Nextcloud's API for `/.well-known` URIs handle all other
        # requests by passing them to the front-end controller.
        return 301 /index.php$request_uri;
    }
    
    # The following 2 rules are only needed for the user_webfinger app.
    # Uncomment it if you're planning to use this app.
    rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
    rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
    
    client_max_body_size 20G;
    client_body_timeout 300s;
    fastcgi_buffers 64 4K;
    fastcgi_hide_header X-Powered-By;
    
    # Enable gzip but do not remove ETag headers
    gzip on;
    gzip_vary on;
    gzip_comp_level 4;
    gzip_min_length 256;
    gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
    gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
    
    error_page 403 /core/templates/403.php;
    error_page 404 /core/templates/404.php;
    
    location / {
        rewrite ^ /index.php$uri;
    }
    
    location ~ ^(.+?\.php)(/.*)?$ {
        set $path_info $fastcgi_path_info;
        try_files $1 =404;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $2;
        fastcgi_param HTTPS $https;
        {FASTCGIPASS}
        fastcgi_intercept_errors on;
        fastcgi_index index.php;
        fastcgi_buffers 64 64K;
        fastcgi_buffer_size 256k;
        fastcgi_param modHeadersAvailable true;
        fastcgi_read_timeout 7200;
    
        fastcgi_max_temp_file_size 0;
    }
    location @php2 {
        fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param HTTPS $https;
        {FASTCGIPASS}
        fastcgi_intercept_errors on;
        fastcgi_index index.php;
        fastcgi_buffers 64 64K;
        fastcgi_buffer_size 256k;
        fastcgi_param modHeadersAvailable true;
        fastcgi_read_timeout 7200;
    }
    location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param HTTPS on;
        fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice
        fastcgi_param front_controller_active true;
        #fastcgi_pass php-handler;
    #fastcgi_pass unix:/var/run/hhvm/hhvm.sock;
        {FASTCGIPASS}
        fastcgi_intercept_errors on;
        fastcgi_request_buffering off;
    }
    
    # Rule borrowed from `.htaccess` to handle Microsoft DAV clients
    location = / {
        if ( $http_user_agent ~ ^DavClnt ) {
            return 302 /remote.php/webdav/$is_args$args;
        }
    }
    
    location ~ ^/(?:updater|ocs-provider|ocm-provider)(?:$|/) {
        try_files $uri/ =404;
        index index.php;
    }
    
    # Adding the cache control header for js and css files
    # Make sure it is BELOW the PHP block
    location ~* \.(?:css|js)$ {
        try_files $uri /index.php$uri$is_args$args;
        add_header Cache-Control "public, max-age=7200";
        # Add headers to serve security related headers (It is intended to have those duplicated to the ones above)
        # Before enabling Strict-Transport-Security headers please read into this topic first.
        # add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
        add_header X-Content-Type-Options nosniff;
        add_header X-Frame-Options "SAMEORIGIN";
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Robots-Tag none;
        add_header X-Download-Options noopen;
        add_header X-Permitted-Cross-Domain-Policies none;
        # Optional: Don't log access to assets
        access_log off;
    }
    
    location ~* \.(?:svg|gif|png|file|html|ttf|woff|ico|jpg|jpeg)$ {
        try_files $uri /index.php$uri$is_args$args;
        # Optional: Don't log access to other assets
        access_log off;
    }
    
    location ~ \.woff2?$ {
        try_files $uri /index.php$request_uri;
        expires 7d;         # Cache-Control policy borrowed from `.htaccess`
        access_log off;     # Optional: Don't log access to assets
    }
    
    location = /data/htaccesstest.txt {
      allow all;
      log_not_found off;
      access_log off;
    }
    wich results in this nginx.vhost file:
    Code:
    server {
            listen *:80;
            listen [::]:80;
            listen *:443 ssl http2;
    
            ssl_protocols TLSv1.3 TLSv1.2;
            listen [::]:443 ssl http2;
            ssl_certificate /var/www/clients/client1/web4/ssl/nextcloud.domain.de.crt;
            ssl_certificate_key /var/www/clients/client1/web4/ssl/nextcloud.domain.de.key;
    
            server_name nextcloud.domain.de xn--l3h.domain.de cloud.domain.de;
    
            root   /var/www/nextcloud.domain.de/web/;
                    disable_symlinks if_not_owner from=$document_root;
    
            if ($scheme != "https") {
                rewrite ^(?!/\.well-known/acme-challenge)/ https://$http_host$request_uri? permanent;
            }
    
            index index.html index.htm index.php index.cgi index.pl index.xhtml standard_index.html;
    
    
    
            error_log /var/log/ispconfig/httpd/nextcloud.domain.de/error.log;
            access_log /var/log/ispconfig/httpd/nextcloud.domain.de/access.log combined;
    
            location ~ /\. {
                            deny all;
            }
    
            location ^~ /.well-known/acme-challenge/ {
                            access_log off;
                            log_not_found off;
                            auth_basic off;
                            root /usr/local/ispconfig/interface/acme/;
                            autoindex off;
                            index index.html;
                            try_files $uri $uri/ =404;
            }
    
            location = /favicon.ico {
                log_not_found off;
                access_log off;
                expires max;
                add_header Cache-Control "public, must-revalidate, proxy-revalidate";
            }
    
            location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
            }
    
            location /stats/ {
    
                index index.html index.php;
                auth_basic "Members Only";
                auth_basic_user_file /var/www/clients/client1/web4/web//stats/.htpasswd_stats;
                add_header Content-Security-Policy "default-src * 'self' 'unsafe-inline' 'unsafe-eval' data:;";
            }
    
            location ^~ /awstats-icon {
                alias /usr/share/awstats/icon;
            }
    
            location ~ \.php$ {
                try_files /b615814d8f2c19dbcb25b1fbae07ce38.htm @php2;
            }
    
            location @php {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass unix:/var/lib/php7.4-fpm/web4.sock;
                fastcgi_index index.php;
                fastcgi_param DOCUMENT_ROOT /web;
                fastcgi_param HOME /web;
                fastcgi_param SCRIPT_FILENAME /web$fastcgi_script_name;
                fastcgi_intercept_errors on;
            }
    
            location /cgi-bin/ {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                root /var/www/clients/client1/web4;
                gzip off;
                fastcgi_pass  unix:/var/run/fcgiwrap.socket;
                fastcgi_index index.cgi;
                fastcgi_param DOCUMENT_ROOT /web;
                fastcgi_param HOME /web;
                fastcgi_param SCRIPT_FILENAME /web$fastcgi_script_name;
                fastcgi_intercept_errors on;
            }
    
    
    
            add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
            add_header Referrer-Policy                   "no-referrer"       always;
            add_header X-Content-Type-Options            "nosniff"           always;
            add_header X-Download-Options                "noopen"            always;
            add_header X-Frame-Options                   "SAMEORIGIN"        always;
            add_header X-Permitted-Cross-Domain-Policies "none"              always;
            add_header X-Robots-Tag                      "noindex, nofollow" always;
            add_header X-XSS-Protection                  "1; mode=block"     always;
    
    
            location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
    return 404;
            }
            location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
    return 404;
            }
    
            location ^~ /.well-known {
    location = /.well-known/carddav  {
    return 301 /remote.php/dav/;
    }
    location = /.well-known/caldav   {
    return 301 /remote.php/dav/;
    }
    location /.well-known/acme-challenge     {
    try_files $uri $uri/ =404;
    }
    location /.well-known/pki-validation     {
    try_files $uri $uri/ =404;
    }
                return 301 /index.php$request_uri;
            }
    
            rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
            rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
    
            client_max_body_size 20G;
            client_body_timeout 300s;
            fastcgi_buffers 64 4K;
            fastcgi_hide_header X-Powered-By;
    
            gzip on;
            gzip_vary on;
            gzip_comp_level 4;
            gzip_min_length 256;
            gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
            gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
    
            error_page 403 /core/templates/403.php;
            error_page 404 /core/templates/404.php;
    
            location / {
                rewrite ^ /index.php$uri;
            }
    
            location ~ ^(.+?\.php)(/.*)?$ {
                set $path_info $fastcgi_path_info;
                try_files $1 =404;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $2;
                fastcgi_param HTTPS $https;
                fastcgi_pass unix:/var/lib/php7.4-fpm/web4.sock;
                fastcgi_intercept_errors on;
                fastcgi_index index.php;
                fastcgi_buffers 64 64K;
                fastcgi_buffer_size 256k;
                fastcgi_param modHeadersAvailable true;
                fastcgi_read_timeout 7200;
    
                fastcgi_max_temp_file_size 0;
            }
            location @php2 {
                fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_param HTTPS $https;
                fastcgi_pass unix:/var/lib/php7.4-fpm/web4.sock;
                fastcgi_intercept_errors on;
                fastcgi_index index.php;
                fastcgi_buffers 64 64K;
                fastcgi_buffer_size 256k;
                fastcgi_param modHeadersAvailable true;
                fastcgi_read_timeout 7200;
            }
            location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
                fastcgi_split_path_info ^(.+\.php)(/.*)$;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_param HTTPS on;
                fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice
                fastcgi_param front_controller_active true;
                fastcgi_pass unix:/var/lib/php7.4-fpm/web4.sock;
                fastcgi_intercept_errors on;
                fastcgi_request_buffering off;
            }
    
            location = / {
                if ( $http_user_agent ~ ^DavClnt ) {
                    return 302 /remote.php/webdav/$is_args$args;
                }
            }
    
            location ~ ^/(?:updater|ocs-provider|ocm-provider)(?:$|/) {
                try_files $uri/ =404;
                index index.php;
            }
    
            location ~* \.(?:css|js)$ {
                try_files $uri /index.php$uri$is_args$args;
                add_header Cache-Control "public, max-age=7200";
                add_header X-Content-Type-Options nosniff;
                add_header X-Frame-Options "SAMEORIGIN";
                add_header X-XSS-Protection "1; mode=block";
                add_header X-Robots-Tag none;
                add_header X-Download-Options noopen;
                add_header X-Permitted-Cross-Domain-Policies none;
                access_log off;
            }
    
            location ~* \.(?:svg|gif|png|file|html|ttf|woff|ico|jpg|jpeg)$ {
                try_files $uri /index.php$uri$is_args$args;
                access_log off;
            }
    
            location ~ \.woff2?$ {
                try_files $uri /index.php$request_uri;
                expires 7d;         # Cache-Control policy borrowed from `.htaccess`
                access_log off;     # Optional: Don't log access to assets
            }
    
            location = /data/htaccesstest.txt {
              allow all;
              log_not_found off;
              access_log off;
            }
    
    
    }
    
    now i need help please :)
     
    Last edited: Jun 7, 2023
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. naproxes

    naproxes New Member

    checked the permissions at /var/lib/php7.4-fqm/
    Code:
    root@isp01:~# ls -lah /var/lib/php7.4-fpm/
    total 8.0K
    drwxr-xr-x  2 root      root      4.0K Jun  6 20:26 .
    drwxr-xr-x 52 root      root      4.0K May 29 17:51 ..
    srw-rw----  1 ispapps   ispapps      0 Jun  6 20:26 apps.sock
    srw-rw----  1 ispconfig ispconfig    0 Jun  6 20:26 ispconfig.sock
    srw-rw----  1 web11     www-data     0 Jun  6 20:26 web11.sock
    srw-rw----  1 web14     www-data     0 Jun  6 20:26 web14.sock
    srw-rw----  1 web17     www-data     0 Jun  6 20:26 web17.sock
    srw-rw----  1 web1      www-data     0 Jun  6 20:26 web1.sock
    srw-rw----  1 web20     www-data     0 Jun  6 20:26 web20.sock
    srw-rw----  1 web22     www-data     0 Jun  6 20:26 web22.sock
    srw-rw----  1 web25     www-data     0 Jun  6 20:26 web25.sock
    srw-rw----  1 web26     www-data     0 Jun  6 20:26 web26.sock
    srw-rw----  1 web30     www-data     0 Jun  6 20:26 web30.sock
    srw-rw----  1 web4      www-data     0 Jun  6 20:26 web4.sock
    srw-rw----  1 web6      www-data     0 Jun  6 20:26 web6.sock
    srw-rw----  1 web9      www-data     0 Jun  6 20:26 web9.sock
    
    and i dug out the old .vhost config. there are some minor changes but "reverting" them dosn't help :/
    Code:
    server {
            listen *:80;
            listen [2001:41d0:2:c0c7::10]:80;
            listen *:443 ssl http2;
    
        ssl_protocols TLSv1.3 TLSv1.2;
            listen [2001:41d0:2:c0c7::10]:443 ssl http2;
            ssl_certificate /var/www/clients/client1/web4/ssl/nextcloud.domain.de.crt;
            ssl_certificate_key /var/www/clients/client1/web4/ssl/nextcloud.domain.de.key;
    
            server_name nextcloud.domain.de xn--l3h.pear2pear.de cloud.pear2pear.de;
    
            root   /var/www/nextcloud.domain.de/web/;
            disable_symlinks if_not_owner from=$document_root;
    
            if ($scheme != "https") {
                rewrite ^(?!/\.well-known/acme-challenge)/ https://$http_host$request_uri? permanent;
            }
    
            index index.html index.htm index.php index.cgi index.pl index.xhtml;
    
    
    
            error_log /var/log/ispconfig/httpd/nextcloud.domain.de/error.log;
            access_log /var/log/ispconfig/httpd/nextcloud.domain.de/access.log combined;
    
    
            location ^~ /.well-known/acme-challenge/ {
                access_log off;
                log_not_found off;
                auth_basic off;
                root /usr/local/ispconfig/interface/acme/;
                autoindex off;
                index index.html;
                try_files $uri $uri/ =404;
            }
    
            location = /favicon.ico {
                log_not_found off;
                access_log off;
                expires max;
                add_header Cache-Control "public, must-revalidate, proxy-revalidate";
            }
    
            location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
            }
    
            location /stats/ {
    
                index index.html index.php;
                auth_basic "Members Only";
                auth_basic_user_file /var/www/clients/client1/web4/web//stats/.htpasswd_stats;
                add_header Content-Security-Policy "default-src * 'self' 'unsafe-inline' 'unsafe-eval' data:;";
            }
    
            location ^~ /awstats-icon {
                alias /usr/share/awstats/icon;
            }
    
            location ~ \.php$ {
                try_files /b615814d8f2c19dbcb25b1fbae07ce38.htm @php2;
            }
    
            location @php {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass unix:/var/lib/php7.3-fpm/web4.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_intercept_errors on;
            }
    
            location /cgi-bin/ {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                root /var/www/clients/client1/web4;
                gzip off;
                fastcgi_pass  unix:/var/run/fcgiwrap.socket;
                fastcgi_index index.cgi;
                fastcgi_param DOCUMENT_ROOT /web;
                fastcgi_param HOME /web;
                fastcgi_param SCRIPT_FILENAME /web$fastcgi_script_name;
                fastcgi_intercept_errors on;
            }
    
    
    
            add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
    
            add_header Referrer-Policy                   "no-referrer"       always;
            add_header X-Content-Type-Options            "nosniff"           always;
            add_header X-Download-Options                "noopen"            always;
            add_header X-Frame-Options                   "SAMEORIGIN"        always;
            add_header X-Permitted-Cross-Domain-Policies "none"              always;
            add_header X-Robots-Tag                      "noindex, nofollow" always;
            add_header X-XSS-Protection                  "1; mode=block"     always;
    
    
            location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
    return 404; 
            }
            location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
    return 404; 
            }
    
            location ^~ /.well-known {
    location = /.well-known/carddav  {
    return 301 /remote.php/dav/; 
    }
    location = /.well-known/caldav   {
    return 301 /remote.php/dav/; 
    }
    location /.well-known/acme-challenge     {
    try_files $uri $uri/ =404; 
    }
    location /.well-known/pki-validation     {
    try_files $uri $uri/ =404; 
    }
                return 301 /index.php$request_uri;
            }
    
            rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
            rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
    
            client_max_body_size 20G;
            client_body_timeout 300s;
            fastcgi_buffers 64 4K;
            fastcgi_hide_header X-Powered-By;
    
            gzip on;
            gzip_vary on;
            gzip_comp_level 4;
            gzip_min_length 256;
            gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
            gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
    
            error_page 403 /core/templates/403.php;
            error_page 404 /core/templates/404.php;
    
            location / {
                rewrite ^ /index.php$uri;
            }
    
            location ~ ^(.+?\.php)(/.*)?$ {
                set $path_info $fastcgi_path_info;
                try_files $1 =404;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $2;
                fastcgi_param HTTPS $https;
                fastcgi_pass unix:/var/lib/php7.3-fpm/web4.sock;
                fastcgi_intercept_errors on;
                fastcgi_index index.php;
                fastcgi_buffers 64 64K;
                fastcgi_buffer_size 256k;
                fastcgi_param modHeadersAvailable true;
                fastcgi_read_timeout 7200;
    
                fastcgi_max_temp_file_size 0;
            }
            location @php2 {
                fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_param HTTPS $https;
                fastcgi_pass unix:/var/lib/php7.3-fpm/web4.sock;
                fastcgi_intercept_errors on;
                fastcgi_index index.php;
                fastcgi_buffers 64 64K;
                fastcgi_buffer_size 256k;
                fastcgi_param modHeadersAvailable true;
                fastcgi_read_timeout 7200;
            }
            location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
                fastcgi_split_path_info ^(.+\.php)(/.*)$;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_param HTTPS on;
                fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice
                fastcgi_param front_controller_active true;
                fastcgi_pass unix:/var/lib/php7.3-fpm/web4.sock;
                fastcgi_intercept_errors on;
                fastcgi_request_buffering off;
            }
    
            location = / {
                if ( $http_user_agent ~ ^DavClnt ) {
                    return 302 /remote.php/webdav/$is_args$args;
                }
            }
    
            location ~ ^/(?:updater|ocs-provider|ocm-provider)(?:$|/) {
                try_files $uri/ =404;
                index index.php;
            }
    
            location ~* \.(?:css|js)$ {
                try_files $uri /index.php$uri$is_args$args;
                add_header Cache-Control "public, max-age=7200";
                add_header X-Content-Type-Options nosniff;
                add_header X-Frame-Options "SAMEORIGIN";
                add_header X-XSS-Protection "1; mode=block";
                add_header X-Robots-Tag none;
                add_header X-Download-Options noopen;
                add_header X-Permitted-Cross-Domain-Policies none;
                access_log off;
            }
    
            location ~* \.(?:svg|gif|png|file|html|ttf|woff|ico|jpg|jpeg)$ {
                try_files $uri /index.php$uri$is_args$args;
                access_log off;
            }
    
            location ~ \.woff2?$ {
                try_files $uri /index.php$request_uri;
                expires 7d;         # Cache-Control policy borrowed from `.htaccess`
                access_log off;     # Optional: Don't log access to assets
            }
    
            location = /data/htaccesstest.txt {
              allow all;
              log_not_found off;
              access_log off;
            }
    
    
    }
    
     
  4. naproxes

    naproxes New Member

    if i try to check with "occ status" i'll get this error:
    Code:
    sudo -u web4 php8.0 ./occ status
    An unhandled exception has been thrown:
    OCP\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    ACPu is normally not used anymore today. You can check if it's still available for PHP 8 and install it, or disable it in nextcloud config.
     
    naproxes likes this.
  6. naproxes

    naproxes New Member

    yeah, at least i can check my nextloud now xD
    db connection works and it seams to behave fine...
    still the same error about "Primary script unknown" with php7.4-fqm.
     
  7. naproxes

    naproxes New Member

    digging deeper into all the config files im no so sure this one ist fine:
    root@isp01:~# cat /etc/php/8.0/fpm/pool.d/web4.conf
    Code:
    [web4]
    
    listen = /var/lib/php7.4-fpm/web4.sock
    listen.owner = web4
    listen.group = www-data
    listen.mode = 0660
    
    user = web4
    group = client1
    
    pm = dynamic
    pm.max_children = 50
    pm.start_servers = 2
    pm.min_spare_servers = 1
    pm.max_spare_servers = 5
    pm.max_requests = 0
    
    chdir = /
    chroot = /var/www/clients/client1/web4
    php_admin_value[doc_root] = /web
    
    env[HOSTNAME] = $HOSTNAME
    env[TMP] = /tmp
    env[TMPDIR] = /tmp
    env[TEMP] = /tmp
    env[PATH] = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    
    php_admin_value[open_basedir] = /web:/private:/tmp:/var/www/nextcloud.domain.de/web:/srv/www/nextcloud.domain.de/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom
    php_admin_value[session.save_path] = /tmp
    php_admin_value[upload_tmp_dir] = /tmp
    php_admin_value[sendmail_path] = "/usr/sbin/sendmail -t -i -f [email protected]"
    
    php_admin_value[memory_limit] = 1g
    php_admin_value[upload_max_filesize] = 20g
    php_admin_value[post_max_size] = 20g
    php_admin_value[always_populate_raw_post_data] = -1
    php_admin_value[max_execution_time] = 3600
    php_admin_flag[opcache.enable] = 1
    php_admin_flag[opcache.enable_cli] = 1
    php_admin_value[opcache.interned_strings_buffer] = 32
    php_admin_value[opcache.max_accelerated_files] = 10000
    php_admin_value[opcache.memory_consumption] = 128
    php_admin_flag[opcache.save_comments] = 1
    php_admin_flag[opcache.revalidate_freq] = 1
    
     

Share This Page