Nginx: [emerg] no host in ":80"

Failed to restart after deploying wordpress and now gives this error
but syntax is ok

nginx: [emerg] no host in ":80" of the "listen" directive in /etc/nginx/conf.d/domains/koukisgas.gr.conf:8
nginx: configuration file /etc/nginx/nginx.conf test failed
nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
root@koukis:/etc/nginx/conf.d# 

does not declear server name in 192.168.1.20.conf

server {
        listen      192.168.1.20:80 default_server;
        server_name _;
        access_log  off;
        error_log   /dev/null;
phpMyAdmin - Error
Existing configuration file (/etc/phpmyadmin/config.inc.php) is not readable.

Hi @giormatsis,

To fix it:

chown -R root:www-data /etc/phpmyadmin/
chown -R hestiamail:www-data /usr/share/phpmyadmin/tmp/

Regarding the nginx error, I would like to debug it but meanwhile, to fix it, just edit these files:

/home/kkgs/conf/web/koukisgas.gr/nginx.conf
/home/kkgs/conf/web/koukisgas.gr/nginx.ssl.conf

Add your private ip to the listen directive and once done, restart nginx:

systemctl restart nginx
1 Like
  GNU nano 7.2                               /home/kkgs/conf/web/koukisgas.gr/nginx.conf                                        
#=========================================================================#
# 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      192.168.1.20:80;
        server_name koukisgas.gr www.koukisgas.gr;
        root        /home/kkgs/web/koukisgas.gr/public_html;
        index       index.php index.html index.htm;
        access_log  /var/log/nginx/domains/koukisgas.gr.log combined;
        access_log  /var/log/nginx/domains/koukisgas.gr.bytes bytes;
        error_log   /var/log/nginx/domains/koukisgas.gr.error.log error;

        include /home/kkgs/conf/web/koukisgas.gr/nginx.forcessl.conf*;

#=========================================================================#
# 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      192.168.1.20:443 ssl;
        server_name koukisgas.gr www.koukisgas.gr;
        root        /home/kkgs/web/koukisgas.gr/public_html;
        index       index.php index.html index.htm;
        access_log  /var/log/nginx/domains/koukisgas.gr.log combined;
        access_log  /var/log/nginx/domains/koukisgas.gr.bytes bytes;
        error_log   /var/log/nginx/domains/koukisgas.gr.error.log error;

2024/05/21 03:28:24 [error] 3903#3903: *3276 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 3.137.198.96, server: koukisgas.gr, request: "GET /wp-json/wp/v2/product_cat/21 HTTP/>
2024/05/21 04:26:27 [error] 3903#3903: *3454 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 3.147.42.163, server: koukisgas.gr, request: "GET /wp-json/wp/v2/product_cat/39 HTTP/>
2024/05/21 04:46:00 [error] 3903#3903: *3499 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 3.137.164.210, server: koukisgas.gr, request: "GET /wp-json/wp/v2/product_cat/23 HTTP>
2024/05/21 05:04:31 [error] 79160#79160: *3517 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 102.165.48.97, server: koukisgas.gr, request: "GET /wp-login.php HTTP/2.0", upstrea>
2024/05/21 07:51:29 [error] 4014#4014: *1 directory index of "/home/kkgs/web/koukisgas.gr/public_html/" is forbidden, client: 171.67.70.238, server: koukisgas.gr, request: "GET / HTTP/1.1", host: "koukisgas.gr"
2024/05/21 07:51:29 [error] 4014#4014: *4 directory index of "/home/kkgs/web/koukisgas.gr/public_html/" is forbidden, client: 171.67.70.238, server: koukisgas.gr, request: "GET / HTTP/1.1", host: "www.koukisgas.gr"
2024/05/21 07:51:58 [error] 4014#4014: *5 directory index of "/home/kkgs/web/koukisgas.gr/public_html/" is forbidden, client: 37.6.251.120, server: koukisgas.gr, request: "GET / HTTP/2.0", host: "koukisgas.gr"

Working
https://koukisgas.gr/phpmyadmin/

1 Like

Execute this:

ping -c4 koukisgas.gr

If you see your public ip instead of the private ip, edit /etc/hosts file and add in the first line this:

192.168.1.20 koukisgas.gr www.koukisgas.gr

Execute again the ping command and if you see the private ip, try to login to wordpress again.

1 Like
192.168.1.20 koukisgas.gr www.koukisgas.gr

127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

127.0.1.1       koukis
127.0.0.1 koukis.koukisgas.gr

1 Like
Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or that contact with the database server at localhost could not be established. This could mean your host’s database server is down.

Are you sure you have the correct username and password?
Are you sure you have typed the correct hostname?
Are you sure the database server is running?

And… are you sure? :wink:

1 Like

:rofl: :rofl: :rofl:
yop yop yop

nginx stays in staled state even after rebooting
i have to manual start it

systemctl status nginx --no-pager -l

root@koukis:~# systemctl status nginx --no-pager -l

● nginx.service - nginx - high performance web server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; preset: enabled)
     Active: active (running) since Tue 2024-05-21 08:37:29 EEST; 4min 47s ago
       Docs: https://nginx.org/en/docs/
    Process: 4179 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)
   Main PID: 4195 (nginx)
      Tasks: 6 (limit: 8738)
        CPU: 90ms
     CGroup: /system.slice/nginx.service
             β”œβ”€4195 "nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf"
             β”œβ”€4197 "nginx: worker process"
             β”œβ”€4198 "nginx: worker process"
             β”œβ”€4199 "nginx: worker process"
             β”œβ”€4200 "nginx: worker process"
             └─4201 "nginx: cache manager process"

May 21 08:37:29 koukis.koukisgas.gr systemd[1]: Starting nginx.service - nginx - high performance web server...
May 21 08:37:29 koukis.koukisgas.gr systemd[1]: Started nginx.service - nginx - high performance web server.

It is working fine from my side… I can see the setup page for wordpress.

me to :smiling_face:
give the credentials
but no use throes the error
cleaned database and /web three times purged nginx restarted the server
no use

states this one

nginx: [emerg] no host in ":80" of the "listen" directive in /etc/nginx/conf.d/domains/koukisgas.gr.conf:8

If you recreate/rebuild the web domain the conf will be modified again so you need to modify it again manually. I would like to debug it when have time.

you know your way in :slightly_smiling_face:

1 Like

changed to the default template no fastcgi and the only thing left is the user to get permissions to database because i gave an other user
but nginx does crazy things i have the feeling that this thing needs an expert to be solved