Domain not working after Update

hey,

i got an email, system was updated to 1.8.12…
today i noticed 1 domain isnt working anymore (the subdomain mail.XXX.net is still working).

when iam trying to connect to my domain i always got the error “file not found” , sometimes browser shows redirecting error before the the not found thing…

i checked all nginx stuff and the template i created for this domain. Everything seems to be oke. Cant find any usefull stuff in logs…

Anybody could help?

here the template, was wokring flawlessy before update

server {
	listen 185.87.21.89:80;
	server_name chiptronix.net www.chiptronix.net;
	root /home/chiptronix/web/chiptronix.net/public_html/chiptronix.net/public;
	
	add_header X-Frame-Options "SAMEORIGIN";

	add_header X-XSS-Protection "1; mode=block";
	add_header X-Content-Type-Options "nosniff";
	
	index index.html index.htm index.php;
	
	charset utf-8;
	
	location / {
		try_files $uri $uri/ /index.php?$query_string;
	}
	
	location = /favicon.ico { access_log off; log_not_found off; }
	location = /robots.txt { access_log off; log_not_found off; }
	
	error_page 404 /index.php;
	
	location ~ \.php$ {
		fastcgi_pass 127.0.0.1:9000;
		fastcgi_index index.php;
		fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
		include fastcgi_params;
	}
	
	location ~ /\.(?!well-known).* {
	deny all;
	}
}

On each template:

#=========================================================================#
# Default Web Domain Template                                             #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS   #
# https://hestiacp.com/docs/server-administration/web-templates.html      #
#=========================================================================#

i copied the default template and edit it, back when i setup hestia first…
it was working flawlessly…

after update in backend still my template was set, i set and saved again.
none of my templates was overwritten.

this i all i see, nothing in log ect…

Screenshot Error

Did you rename it?

Template should not have been touched

nope, neva touched it anymore, see:

Templates

Seems you are using Nginx standalone (you are not using Apache2) but you shown the templates for Nginx Proxy instead of the right ones (inside php-fpm).

Could you please show the output of these commands (replace YourUser by the actual user)?

v-list-web-domain YourUser chiptronix.net json
cat /home/*/conf/web/chiptronix.net/nginx.conf
{
    "chiptronix.net": {
        "IP": "185.87.21.89",
        "IP6": "",
        "DOCUMENT_ROOT": "/home/chiptronix/web/chiptronix.net/public_html/",
        "U_DISK": "450",
        "U_BANDWIDTH": "0",
        "TPL": "default",
        "ALIAS": "www.chiptronix.net",
        "STATS": "",
        "STATS_USER": "",
        "SSL": "no",
        "SSL_FORCE": "no",
        "SSL_HSTS": "",
        "SSL_HOME": "same",
        "LETSENCRYPT": "no",
        "FTP_USER": "",
        "FTP_PATH": "",
        "AUTH_USER": "",
        "BACKEND": "PHP-8_2",
        "PROXY": "portal",
        "PROXY_EXT": "css,htm,html,js,json,xml,apng,avif,bmp,cur,gif,ico,jfif,jpg,jpeg,pjp,pjpeg,png,svg,tif,tiff,webp,aac,caf,flac,m4a,midi,mp3,ogg,opus,wav,3gp,av1,avi,m4v,mkv,mov,mpg,mpeg,mp4,mp4v,webm,otf,ttf,woff,woff2,doc,docx,odf,odp,ods,odt,pdf,ppt,pptx,rtf,txt,xls,xlsx,7z,bz2,gz,rar,tar,tgz,zip,apk,appx,bin,dmg,exe,img,iso,jar,msi,webmanifest",
        "FASTCGI_CACHE": "no",
        "FASTCGI_DURATION": "0s",
        "REDIRECT": "",
        "REDIRECT_CODE": "",
        "CUSTOM_DOCROOT": "",
        "SUSPENDED": "no",
        "TIME": "18:45:34",
        "DATE": "2024-02-28"
    }
}
#=========================================================================#
# Default Web Domain Template                                             #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS   #
# https://hestiacp.com/docs/server-administration/web-templates.html      #
#=========================================================================#
server {
        listen 185.87.21.89:80;
        server_name chiptronix.net www.chiptronix.net;
        root /home/chiptronix/web/chiptronix.net/public_html/chiptronix.net/public;

        add_header X-Frame-Options "SAMEORIGIN";
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Content-Type-Options "nosniff";

        index index.html index.htm index.php;

        charset utf-8;

        location / {
                try_files $uri $uri/ /index.php?$query_string;
        }

        location = /favicon.ico { access_log off; log_not_found off; }
        location = /robots.txt { access_log off; log_not_found off; }

        error_page 404 /index.php;

        location ~ \.php$ {
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
                include fastcgi_params;
        }

        location ~ /\.(?!well-known).* {
        deny all;
        }

i see the document root in the first one isnt correct, where i find this?

Edit web domain → Advanced Options → Custom Document Root

1 Like

path is correct now, there’s the index.php… still get error “File not found” mhmmm

{
    "chiptronix.net": {
        "IP": "185.87.21.89",
        "IP6": "",
        "DOCUMENT_ROOT": "/home/chiptronix/web/chiptronix.net/public_html/chiptronix.net/public",
        "U_DISK": "450",
        "U_BANDWIDTH": "0",
        "TPL": "default",
        "ALIAS": "www.chiptronix.net",
        "STATS": "",
        "STATS_USER": "",
        "SSL": "no",
        "SSL_FORCE": "no",
        "SSL_HSTS": "",
        "SSL_HOME": "same",
        "LETSENCRYPT": "no",
        "FTP_USER": "",
        "FTP_PATH": "",
        "AUTH_USER": "",
        "BACKEND": "PHP-8_2",
        "PROXY": "portal",
        "PROXY_EXT": "css,htm,html,js,json,xml,apng,avif,bmp,cur,gif,ico,jfif,jpg,jpeg,pjp,pjpeg,png,svg,tif,tiff,webp,aac,caf,flac,m4a,midi,mp3,ogg,opus,wav,3gp,av1,avi,m4v,mkv,mov,mpg,mpeg,mp4,mp4v,webm,otf,ttf,woff,woff2,doc,docx,odf,odp,ods,odt,pdf,ppt,pptx,rtf,txt,xls,xlsx,7z,bz2,gz,rar,tar,tgz,zip,apk,appx,bin,dmg,exe,img,iso,jar,msi,webmanifest",
        "FASTCGI_CACHE": "no",
        "FASTCGI_DURATION": "0s",
        "REDIRECT": "",
        "REDIRECT_CODE": "",
        "CUSTOM_DOCROOT": "/home/chiptronix/web/chiptronix.net/public_html/chiptronix.net/public",
        "SUSPENDED": "no",
        "TIME": "18:45:34",
        "DATE": "2024-02-28"
    }
}

Show the output of these commands:

namei -mo /home/chiptronix/web/chiptronix.net/public_html/chiptronix.net/public/index.php
tail /var/log/apache2/domains/example.com.log
tail /var/log/apache2/domains/example.com.error.log
f: /home/chiptronix/web/chiptronix.net/public_html/chiptronix.net/public/index.php
 drwxr-xr-x root       root       /
 drwxr-xr-x root       root       home
 drwxr-xr-x root       root       chiptronix
 drwxr-x--x root       chiptronix web
 dr-xr-x--x chiptronix chiptronix chiptronix.net
 drwxr-x--x chiptronix www-data   public_html
 drwxrwxr-x chiptronix www-data   chiptronix.net
 drwxrwxr-x chiptronix www-data   public
 -rw-r--r-- chiptronix www-data   index.php

logs in var/apache2/domains/chiptronix.net.log and error.log are 0KB, nothing in there…

Do you see any error in /var/log/nginx/error.log ?

Also, show the output of this command:

lsof -Pn +c0 -iTCP:9000 -sTCP:LISTEN

You can also try to rebuild your site:

v-rebuild-web-domain chiptronix chiptronix.net yes
root@patricksenton:~# ls -al /run/php/
total 8
drwxr-xr-x  2 www-data   www-data 140 Sep  1 01:22 .
drwxr-xr-x 28 root       root     860 Sep  1 01:33 ..
srw-rw----  1 chiptronix www-data   0 Sep  1 01:22 php8.2-fpm-chiptronix.net.sock
srw-rw----  1 admin      www-data   0 Sep  1 01:22 php8.2-fpm-patricksenton.de.sock
-rw-r--r--  1 root       root       3 Sep  1 01:22 php8.2-fpm.pid
-rw-r--r--  1 root       root       3 Sep  1 01:22 php8.3-fpm.pid
srw-rw----  1 hestiamail www-data   0 Sep  1 01:22 php%backend_version%-fpm.dummy.sock

root@patricksenton:~# lsof -Pn +c0 -iTCP:9000 -sTCP:LISTEN
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
php-fpm8.2 519 root    9u  IPv4  14051      0t0  TCP 127.0.0.1:9000 (LISTEN)

yes there these errors, seems to be something with nginx

`2024/09/01 01:28:19 [error] 586#586: *18 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 198.235.24.51, server: chiptronix.net, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "chiptronix.net"
2024/09/01 01:28:29 [error] 586#586: *21 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 84.129.207.108, server: chiptronix.net, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "chiptronix.net"
2024/09/01 01:38:20 [error] 586#586: *29 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 84.129.207.108, server: chiptronix.net, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "chiptronix.net"
2024/09/01 01:38:22 [error] 586#586: *29 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 84.129.207.108, server: chiptronix.net, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "chiptronix.net"
2024/09/01 01:38:24 [error] 586#586: *29 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 84.129.207.108, server: chiptronix.net, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "chiptronix.net"
2024/09/01 01:38:24 [error] 586#586: *29 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 84.129.207.108, server: chiptronix.net, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "chiptronix.net"
`

That isn’t good.

cat /etc/php/8.2/fpm/pool.d/dummy.conf
cat /etc/php/8.2/fpm/pool.d/www.conf

[www]
listen = /run/php/php8.2-fpm.dummy.sock
listen.owner = hestiamail
listen.group = www-data
listen.mode = 0660

;"hestiamail" user created to prevent users from abusing this config
user = hestiamail
group = www-data

pm = ondemand
pm.max_children = 4
pm.max_requests = 4000
pm.process_idle_timeout = 10s

[www]
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1

;"hestiamail" user created to prevent users from abusing this config
user = hestiamail
group = www-data

pm = ondemand
pm.max_children = 4
pm.max_requests = 4000
pm.process_idle_timeout = 10s

grep -r backend_version /etc/php/
/etc/php/8.3/fpm/pool.d/dummy.conf:listen = /run/php/php%backend_version%-fpm.dummy.sock

sed -i "s/%backend_version%/8\.3/g" /etc/php/8.3/fpm/pool.d/dummy.conf
systemctl restart php8.3-fpm
systemctl restart php8.2-fpm

did what to do then?