No Host in ":80" of the "listen" directive in Slave Server

Discussion in 'Installation/Configuration' started by jaypabs, Jul 4, 2022.

  1. jaypabs

    jaypabs Member

    After setting up master/slave server, I manage to replicate all databases and files except that the websites configuration under /etc/nginx/sites-available/.

    The vhost file was not save under .vhost file. Instead, it was saved under vhost.err.

    The error under .vhost is:

    When I check the config on both servers, the master server has the following configuration:

    Code:
            listen 111.111.111.111:80;
            listen 111.111.111.111:443 ssl http2;
    
            ssl_protocols TLSv1.3 TLSv1.2;
            ssl_certificate /var/www/clients/client3/web22/ssl/example.com-le.crt;
            ssl_certificate_key /var/www/clients/client3/web22/ssl/example.com-le.key;
    
            server_name example.com www.example.com;
    
    While on the slave server, the IP and SSL certificate was not there:

    Code:
            listen :80;
    
            server_name example.com www.example.com;
    
    This is the error in nginx error log:

    Code:
    no host in ":80" of the "listen" directive in /etc/nginx/sites-enabled/100-example.com
    Using ISPConfig dashboard, I can't see the IP Address that belongs to the slave server. But under System > IP Address the IP is already there.

    upload_2022-7-4_18-13-28.png

    So, I'm thinking that "listen :80" has blank IP because the system can't get it from ISPConfig.

    I already turned on the debugging in ISPConfig. Here's some relevant information I found:
    Code:
    04.07.2022-09:53 - DEBUG [server:177] - Found 1 changes, starting update process.
    04.07.2022-09:53 - DEBUG [modules.inc:177] - Replicated from master: REPLACE INTO `web_domain` (`domain_id`,`sys_userid`,`sys_groupid`,`sys_
    perm_user`,`sys_perm_group`,`sys_perm_other`,`server_id`,`ip_address`,`ipv6_address`,`domain`,`type`,`parent_domain_id`,`vhost_type`,`docume
    nt_root`,`web_folder`,`system_user`,`system_group`,`hd_quota`,`traffic_quota`,`cgi`,`ssi`,`suexec`,`errordocs`,`is_subdomainwww`,`subdomain`
    ,`php`,`ruby`,`python`,`perl`,`redirect_type`,`redirect_path`,`seo_redirect`,`rewrite_to_https`,`ssl`,`ssl_letsencrypt`,`ssl_letsencrypt_exc
    lude`,`ssl_state`,`ssl_locality`,`ssl_organisation`,`ssl_organisation_unit`,`ssl_country`,`ssl_domain`,`ssl_request`,`ssl_cert`,`ssl_bundle`
    ,`ssl_key`,`ssl_action`,`stats_password`,`stats_type`,`allow_override`,`apache_directives`,`nginx_directives`,`php_fpm_use_socket`,`php_fpm_
    chroot`,`pm`,`pm_max_children`,`pm_start_servers`,`pm_min_spare_servers`,`pm_max_spare_servers`,`pm_process_idle_timeout`,`pm_max_requests`,
    `php_open_basedir`,`custom_php_ini`,`backup_interval`,`backup_copies`,`backup_format_web`,`backup_format_db`,`backup_encrypt`,`backup_passwo
    rd`,`backup_excludes`,`active`,`traffic_quota_lock`,`proxy_directives`,`last_quota_notification`,`rewrite_rules`,`added_date`,`added_by`,`di
    rective_snippets_id`,`enable_pagespeed`,`http_port`,`https_port`,`folder_directive_snippets`,`log_retention`,`proxy_protocol`,`server_php_id
    `,`jailkit_chroot_app_sections`,`jailkit_chroot_app_programs`,`delete_unused_jailkit`,`last_jailkit_update`,`last_jailkit_hash`) VALUES ('22
    ','1','4','riud','ru','',5,'23.250.91.214','','example.com','vhost','0','name','/var/www/clients/client3/web22','','web22','client3
    ','-1','-1','n','n','y','0','1','www','php-fpm','n','n','n',NULL,NULL,NULL,'n','y','y','n',NULL,NULL,NULL,NULL,NULL,NULL,'','',NULL,'','',NU
    LL,'awstats','All','','        location / {\r\n                # First attempt to serve request as file, then\r\n                # as direct
    ory, then fall back to index.html\r\n                #try_files $uri $uri/ /index.html;\r\n                try_files $uri $uri/ /index.php?$
    args;\r\n                # Uncomment to enable naxsi on this location\r\n                # include /etc/nginx/naxsi.rules\r\n        }\r\n\r
    \n      location ~ ^/\\.user\\.ini {\r\n                deny all;\r\n   }','n','n','ondemand','10','2','1','5','10','500','/var/www/clients/
    client3/web22/web:/var/www/clients/client3/web22/private:/var/www/clients/client3/web22/tmp:/var/www/example.com/web:/srv/www/janob
    esourcecode.com/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom',
    '','none','1','default','gzip','n','',NULL,'y','n','',NULL,NULL,'2022-03-09','admin','0','n','80','443',NULL,'10','n','2','','','n','2022-07
    -03','force_update1656557245')
    04.07.2022-09:53 - DEBUG [plugins.inc:118] - Calling function 'ssl' from plugin 'nginx_plugin' raised by event 'web_domain_update'.
    04.07.2022-09:53 - DEBUG [plugins.inc:118] - Calling function 'update' from plugin 'nginx_plugin' raised by event 'web_domain_update'.
    04.07.2022-09:53 - DEBUG [system.inc:2399] - safe_exec cmd: chattr -i '/var/www/clients/client3/web22' - return code: 0
    04.07.2022-09:53 - DEBUG [system.inc:2399] - safe_exec cmd: chattr +i '/var/www/clients/client3/web22' - return code: 0
    04.07.2022-09:53 - DEBUG [system.inc:2399] - safe_exec cmd: df -T '/var/www/clients/client3/web22'|awk 'END{print $2,$NF}' - return code: 0
    04.07.2022-09:53 - DEBUG [system.inc:2399] - safe_exec cmd: which 'setquota' 2> /dev/null - return code: 0
    04.07.2022-09:53 - DEBUG [system.inc:2399] - safe_exec cmd: setquota -u 'web22' '0' '0' 0 0 -a &> /dev/null - return code: 0
    04.07.2022-09:53 - DEBUG [system.inc:2399] - safe_exec cmd: setquota -T -u 'web22' 604800 604800 -a &> /dev/null - return code: 0
    04.07.2022-09:53 - DEBUG [system.inc:2399] - safe_exec cmd: chattr +i '/var/www/clients/client3/web22' - return code: 0
    04.07.2022-09:53 - DEBUG [nginx plugin.inc:1397] - SSL Disabled. example.com
    04.07.2022-09:53 - DEBUG [system.inc:2399] - safe_exec cmd: nginx -V 2>&1 | grep 'built with OpenSSL' | sed 's/.*built\([a-zA-Z ]*\)OpenSSL \([0-9.]*\).*/\2/' - return code: 0
    04.07.2022-09:53 - DEBUG [system.inc:2399] - safe_exec cmd: nginx -V 2>&1 | grep 'running with OpenSSL' | sed 's/.*running\([a-zA-Z ]*\)OpenSSL \([0-9.]*\).*/\2/' - return code: 0
    04.07.2022-09:53 - DEBUG [system.inc:2399] - safe_exec cmd: which 'nginx' 2> /dev/null - return code: 0
    04.07.2022-09:53 - DEBUG [nginx plugin.inc:1623] - Enable TLS 1.3 for: example.com
    
    This is the only problem I currently troubleshooting. I hope somebody can help me on this.
     
  2. jaypabs

    jaypabs Member

    It seems that the problem here is because I am specifying an IP address under Web Domain in master server.
    Like this:
    upload_2022-7-5_10-51-11.png
    So, when it synced on slave server, the slave server doesn't know what IP address to put there since it doesn't have that IP on the slave server.

    That's why it gives a value in listen directive as follows:

    Code:
    listen :80;
    The workaround here is not to use specific IP address in Web Domain. So that both servers will have a vhost like:
    Code:
    listen *:80;
    [​IMG]

    But I have other problem which I created in a new post at
    https://forum.howtoforge.com/thread...n-using-wildcard-instead-of-using-ipv4.89180/

    I hope somebody can reply on that post.

    Thank you
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    This is the solution and not a workaround. You selected the IP instead of * for the site, which can't work on a mirrored system as the IP is bound to the first server, so it can not be assigned to the second one.
     

Share This Page