newly created domains redirect to another

Discussion in 'General' started by Josie-Grace, Jan 8, 2024.

  1. Josie-Grace

    Josie-Grace New Member

    When i create a new domain and activate SSL the domain redirects to another SSL domain on the server.
    The first few minutes the actual domain showed up with the correct SSL, but then after a few minutes, checking the domain again, it redirects.

    I checked all the vhost files and they all have * and not the ip-address set.

    This is the debug from ispconfig's server.sh:
    Code:
    08.01.2024-11:22 - DEBUG [plugins.inc:155] - Calling function 'check_phpini_changes' from plugin 'webserver_plugin' raised by action 'server_plugins_loaded'.
    08.01.2024-11:22 - DEBUG [server:177] - Found 2 changes, starting update process.
    08.01.2024-11:22 - DEBUG [plugins.inc:118] - Calling function 'server_ip' from plugin 'apache2_plugin' raised by event 'server_update'.
    08.01.2024-11:22 - DEBUG [system.inc:2430] - safe_exec cmd: which 'apache2ctl' 2> /dev/null - return code: 0
    08.01.2024-11:22 - DEBUG [apache2 plugin.inc:2485] - Writing the conf file: /etc/apache2/sites-available/ispconfig.conf
    08.01.2024-11:22 - DEBUG [plugins.inc:118] - Calling function 'update' from plugin 'apps_vhost_plugin' raised by event 'server_update'.
    08.01.2024-11:22 - DEBUG [system.inc:2430] - safe_exec cmd: which 'apache2ctl' 2> /dev/null - return code: 0
    08.01.2024-11:22 - DEBUG [plugins.inc:118] - Calling function 'update' from plugin 'network_settings_plugin' raised by event 'server_update'.
    08.01.2024-11:22 - DEBUG [network settings plugin.inc:249] - Network configuration disabled in server settings.
    08.01.2024-11:22 - DEBUG [plugins.inc:118] - Calling function 'update' from plugin 'postfix_server_plugin' raised by event 'server_update'.
    postconf: warning: /etc/postfix/main.cf: undefined parameter: fitsnone
    08.01.2024-11:22 - DEBUG [system.inc:2430] - safe_exec cmd: postconf -e 'smtpd_client_restrictions = check_client_access proxy:mysql:/etc/postfix/mysql-virtual_client.cf, permit_inet_interfaces, permit_mynetworks, permit_sasl_authenticated, reject_rbl_client zen.spamhaus.org, reject_unauth_pipelining, permit' - return code: 0
    postconf: warning: /etc/postfix/main.cf: undefined parameter: fitsnone
    08.01.2024-11:22 - DEBUG [system.inc:2430] - safe_exec cmd: postconf -e 'smtpd_helo_restrictions = permit_mynetworks, check_helo_access regexp:/etc/postfix/helo_access, permit_sasl_authenticated, reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, check_helo_access regexp:/etc/postfix/blacklist_helo, reject_unknown_helo_hostname, permit' - return code: 0
    08.01.2024-11:22 - DEBUG [system.inc:2430] - safe_exec cmd: which 'dovecot' 2> /dev/null - return code: 0
    postconf: warning: /etc/postfix/main.cf: undefined parameter: fitsnone
    postconf: warning: /etc/postfix/main.cf: undefined parameter: fitsnone
    postconf: warning: /etc/postfix/main.cf: undefined parameter: fitsnone
    08.01.2024-11:22 - DEBUG [plugins.inc:118] - Calling function 'server_update' from plugin 'rspamd_plugin' raised by event 'server_update'.
    08.01.2024-11:22 - DEBUG [plugins.inc:118] - Calling function 'update' from plugin 'server_services_plugin' raised by event 'server_update'.
    08.01.2024-11:22 - DEBUG [plugins.inc:118] - Calling function 'server_update' from plugin 'webserver_plugin' raised by event 'server_update'.
    08.01.2024-11:22 - DEBUG [modules.inc:240] - Processed datalog_id 481
    08.01.2024-11:22 - DEBUG [plugins.inc:118] - Calling function 'server_ip' from plugin 'apache2_plugin' raised by event 'server_update'.
    08.01.2024-11:22 - DEBUG [system.inc:2430] - safe_exec cmd: which 'apache2ctl' 2> /dev/null - return code: 0
    08.01.2024-11:22 - DEBUG [apache2 plugin.inc:2485] - Writing the conf file: /etc/apache2/sites-available/ispconfig.conf
    08.01.2024-11:22 - DEBUG [plugins.inc:118] - Calling function 'update' from plugin 'apps_vhost_plugin' raised by event 'server_update'.
    08.01.2024-11:22 - DEBUG [system.inc:2430] - safe_exec cmd: which 'apache2ctl' 2> /dev/null - return code: 0
    08.01.2024-11:22 - DEBUG [plugins.inc:118] - Calling function 'update' from plugin 'network_settings_plugin' raised by event 'server_update'.
    08.01.2024-11:22 - DEBUG [network settings plugin.inc:249] - Network configuration disabled in server settings.
    08.01.2024-11:22 - DEBUG [plugins.inc:118] - Calling function 'update' from plugin 'postfix_server_plugin' raised by event 'server_update'.
    postconf: warning: /etc/postfix/main.cf: undefined parameter: fitsnone
    08.01.2024-11:22 - DEBUG [system.inc:2430] - safe_exec cmd: postconf -e 'smtpd_client_restrictions = check_client_access proxy:mysql:/etc/postfix/mysql-virtual_client.cf, permit_inet_interfaces, permit_mynetworks, permit_sasl_authenticated, reject_rbl_client zen.spamhaus.org, reject_unauth_pipelining, permit' - return code: 0
    postconf: warning: /etc/postfix/main.cf: undefined parameter: fitsnone
    08.01.2024-11:22 - DEBUG [system.inc:2430] - safe_exec cmd: postconf -e 'smtpd_helo_restrictions = permit_mynetworks, check_helo_access regexp:/etc/postfix/helo_access, permit_sasl_authenticated, reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, check_helo_access regexp:/etc/postfix/blacklist_helo, reject_unknown_helo_hostname, permit' - return code: 0
    08.01.2024-11:22 - DEBUG [system.inc:2430] - safe_exec cmd: which 'dovecot' 2> /dev/null - return code: 0
    postconf: warning: /etc/postfix/main.cf: undefined parameter: fitsnone
    postconf: warning: /etc/postfix/main.cf: undefined parameter: fitsnone
    postconf: warning: /etc/postfix/main.cf: undefined parameter: fitsnone
    08.01.2024-11:22 - DEBUG [plugins.inc:118] - Calling function 'server_update' from plugin 'rspamd_plugin' raised by event 'server_update'.
    08.01.2024-11:22 - DEBUG [plugins.inc:118] - Calling function 'update' from plugin 'server_services_plugin' raised by event 'server_update'.
    08.01.2024-11:22 - DEBUG [plugins.inc:118] - Calling function 'server_update' from plugin 'webserver_plugin' raised by event 'server_update'.
    08.01.2024-11:22 - DEBUG [modules.inc:240] - Processed datalog_id 482
    08.01.2024-11:22 - DEBUG [services.inc:56] - Calling function 'restartHttpd' from module 'web_module'.
    08.01.2024-11:22 - DEBUG [system.inc:2083] - Trying to use Systemd to restart service
    08.01.2024-11:22 - DEBUG [system.inc:2430] - safe_exec cmd: systemctl is-enabled 'apache2' 2>&1 - return code: 0
    08.01.2024-11:22 - DEBUG [web module.inc:246] - Restarting httpd: systemctl restart apache2.service
    08.01.2024-11:22 - DEBUG [services.inc:56] - Calling function 'restartPostfix' from module 'mail_module'.
    08.01.2024-11:22 - DEBUG [system.inc:2083] - Trying to use Systemd to restart service
    08.01.2024-11:22 - DEBUG [system.inc:2430] - safe_exec cmd: systemctl is-enabled 'postfix' 2>&1 - return code: 0
    08.01.2024-11:22 - DEBUG [server:217] - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    certbot certificates response was:

    Code:
    Certificate Name: bluevibes.link
        Domains: bluevibes.link www.bluevibes.link
        Expiry Date: 2024-04-07 09:02:07+00:00 (VALID: 89 days)
        Certificate Path: /etc/letsencrypt/live/bluevibes.link/fullchain.pem
        Private Key Path: /etc/letsencrypt/live/bluevibes.link/privkey.pem
    
    If I use an SSL-checker tool online I get the following response:

    Code:
    bluevibes.link resolves to 37.187.131.123
    Server Type: Apache
    The certificate should be trusted by all major web browsers (all the correct intermediate certificates are installed).
    The certificate will expire in 89 days.
    The hostname (bluevibes.link) is correctly listed in the certificate.
    
    Common name: bluevibes.link
    SANs: bluevibes.link, www.bluevibes.link
    Valid from January 8, 2024 to April 7, 2024
    Serial Number: 04aecd522e1d7ba933ad1172955b60d93349
    Signature Algorithm: sha256WithRSAEncryption
    Issuer: R3
    I also tried to "resync websites" in ispconfig, without result.

    Any other suggestions i might try or check ?
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  3. Josie-Grace

    Josie-Grace New Member

    Thanks for the reply. I already checked these: "I checked all the vhost files and they all have * and not the ip-address set."
    And https is enabled on all websites in ispconfig (ssl + Let's encrypt checked)

    This is the vhost file, should it help:
    Code:
    <Directory /var/www/bluevibes.link>
                    AllowOverride None
                                    Require all denied
    </Directory>
    
    <VirtualHost *:80>
    
    
                                            DocumentRoot /var/www/clients/client1/web40/web
    
                    ServerName bluevibes.link
                    ServerAlias www.bluevibes.link
                    ServerAdmin [email protected]
    
    
                    ErrorLog /var/log/ispconfig/httpd/bluevibes.link/error.log
    
                    Alias /error/ "/var/www/bluevibes.link/web/error/"
                    ErrorDocument 400 /error/400.html
                    ErrorDocument 401 /error/401.html
                    ErrorDocument 403 /error/403.html
                    ErrorDocument 404 /error/404.html
                    ErrorDocument 405 /error/405.html
                    ErrorDocument 500 /error/500.html
                    ErrorDocument 502 /error/502.html
                    ErrorDocument 503 /error/503.html
    
    
                    <Directory /var/www/bluevibes.link/web>
                                    # Clear PHP settings of this website
                                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                    SetHandler None
                                    </FilesMatch>
                                    Options +SymlinksIfOwnerMatch
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
                    <Directory /var/www/clients/client1/web40/web>
                                    # Clear PHP settings of this website
                                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                    SetHandler None
                                    </FilesMatch>
                                    Options +SymlinksIfOwnerMatch
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
    
    
    
    
                    # suexec enabled
                    <IfModule mod_suexec.c>
                            SuexecUserGroup web40 client1
                    </IfModule>
                    <IfModule mod_fastcgi.c>
                                    <Directory /var/www/clients/client1/web40/cgi-bin>
                                                                                    Require all granted
                                                                        </Directory>
                                    <Directory /var/www/bluevibes.link/web>
                                            <FilesMatch "\.php[345]?$">
                                                    <If "-f '%{REQUEST_FILENAME}'">
                                                            SetHandler php-fcgi
                                                    </If>
                                            </FilesMatch>
                                    </Directory>
                                    <Directory /var/www/clients/client1/web40/web>
                                            <FilesMatch "\.php[345]?$">
                                                    <If "-f '%{REQUEST_FILENAME}'">
                                                            SetHandler php-fcgi
                                                    </If>
                                            </FilesMatch>
                                    </Directory>
                    Action php-fcgi /php-fcgi virtual
                                    Alias /php-fcgi /var/www/clients/client1/web40/cgi-bin/php-fcgi-*-80-bluevibes.link
                    FastCgiExternalServer /var/www/clients/client1/web40/cgi-bin/php-fcgi-*-80-bluevibes.link -idle-timeout 300 -socket /var/lib/php7.4-fpm/web40.sock -pass-header Authorization  -pass-header Content-Type
                    </IfModule>
                    <IfModule mod_proxy_fcgi.c>
                            #ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ unix:///var/lib/php7.4-fpm/web40.sock|fcgi://localhost//var/www/clients/client1/web40/web/$1
                            <Directory /var/www/bluevibes.link/web>
                                    <FilesMatch "\.php[345]?$">
                                            <If "-f '%{REQUEST_FILENAME}'">
                                                    SetHandler "proxy:unix:/var/lib/php7.4-fpm/web40.sock|fcgi://localhost"
                                            </If>
                                    </FilesMatch>
                            </Directory>
                            <Directory /var/www/clients/client1/web40/web>
                                    <FilesMatch "\.php[345]?$">
                                            <If "-f '%{REQUEST_FILENAME}'">
                                                    SetHandler "proxy:unix:/var/lib/php7.4-fpm/web40.sock|fcgi://localhost"
                                            </If>
                                    </FilesMatch>
                            </Directory>
                            </IfModule>
    
    
                    RewriteEngine on
                    RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
                    RewriteRule ^ - [END]
            RewriteCond %{HTTPS} off
                    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
    
                    # add support for apache mpm_itk
                    <IfModule mpm_itk_module>
                            AssignUserId web40 client1
                    </IfModule>
    
                    <IfModule mod_dav_fs.c>
                    # Do not execute PHP files in webdav directory
                            <Directory /var/www/clients/client1/web40/webdav>
                                    <ifModule mod_security2.c>
                                            SecRuleRemoveById 960015
                                            SecRuleRemoveById 960032
                                    </ifModule>
                                    <FilesMatch "\.ph(p3?|tml)$">
                                            SetHandler None
                                    </FilesMatch>
                            </Directory>
                            DavLockDB /var/www/clients/client1/web40/tmp/DavLock
                            # DO NOT REMOVE THE COMMENTS!
                            # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
          # WEBDAV BEGIN
                            # WEBDAV END
                    </IfModule>
    
                            # skipping apache_directives, as that will be handled by the ssl vhost
    
    
    </VirtualHost>
    
    
    <VirtualHost *:443>
    
    
                                            DocumentRoot /var/www/clients/client1/web40/web
    
                    ServerName bluevibes.link
                    ServerAlias www.bluevibes.link
                    ServerAdmin [email protected]
    
                    <IfModule mod_http2.c>
                            Protocols h2 http/1.1
                    </IfModule>
    
                    <IfModule mod_brotli.c>
                            AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/x-javascript application/javascript application/xml application/xml+rss application/atom+xml application/js>
                    </IfModule>
    
                    ErrorLog /var/log/ispconfig/httpd/bluevibes.link/error.log
    
                    Alias /error/ "/var/www/bluevibes.link/web/error/"
                    ErrorDocument 400 /error/400.html
                    ErrorDocument 401 /error/401.html
                    ErrorDocument 403 /error/403.html
                    ErrorDocument 404 /error/404.html
                    ErrorDocument 405 /error/405.html
                    ErrorDocument 500 /error/500.html
                    ErrorDocument 502 /error/502.html
                    ErrorDocument 503 /error/503.html
    
      <IfModule mod_ssl.c>
                    SSLEngine on
                    SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
                    # SSLCipherSuite          ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-S>
                    SSLHonorCipherOrder     on
                    # <IfModule mod_headers.c>
                    # Header always add Strict-Transport-Security "max-age=15768000"
                    # </IfModule>
                    SSLCertificateFile /var/www/clients/client1/web40/ssl/bluevibes.link-le.crt
                    SSLCertificateKeyFile /var/www/clients/client1/web40/ssl/bluevibes.link-le.key
                                      SSLUseStapling on
                      SSLStaplingResponderTimeout 5
                      SSLStaplingReturnResponderErrors off
                          </IfModule>
    
                    <Directory /var/www/bluevibes.link/web>
                                    # Clear PHP settings of this website
                                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                    SetHandler None
                                    </FilesMatch>
                                    Options +SymlinksIfOwnerMatch
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
                    <Directory /var/www/clients/client1/web40/web>
                                    # Clear PHP settings of this website
                                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                    SetHandler None
                                    </FilesMatch>
                                    Options +SymlinksIfOwnerMatch
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
    
    
    
    
                    # suexec enabled
                    <IfModule mod_suexec.c>
                            SuexecUserGroup web40 client1
                    </IfModule>
                    <IfModule mod_fastcgi.c>
                                    <Directory /var/www/clients/client1/web40/cgi-bin>
                                                                                    Require all granted
                                                                        </Directory>
                                    <Directory /var/www/bluevibes.link/web>
                                            <FilesMatch "\.php[345]?$">
                                                    <If "-f '%{REQUEST_FILENAME}'">
                                                            SetHandler php-fcgi
                                                    </If>
                                            </FilesMatch>
                                    </Directory>
                                    <Directory /var/www/clients/client1/web40/web>
                                            <FilesMatch "\.php[345]?$">
                                                    <If "-f '%{REQUEST_FILENAME}'">
                                                            SetHandler php-fcgi
                                                    </If>
                                            </FilesMatch>
                                    </Directory>
                    Action php-fcgi /php-fcgi virtual
                                    Alias /php-fcgi /var/www/clients/client1/web40/cgi-bin/php-fcgi-*-443-bluevibes.link
                    FastCgiExternalServer /var/www/clients/client1/web40/cgi-bin/php-fcgi-*-443-bluevibes.link -idle-timeout 300 -socket /var/lib/php7.4-fpm/web40.sock -pass-header Authorization  -pass-header Content-Type
                    </IfModule>
                    <IfModule mod_proxy_fcgi.c>
                            #ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ unix:///var/lib/php7.4-fpm/web40.sock|fcgi://localhost//var/www/clients/client1/web40/web/$1
                            <Directory /var/www/bluevibes.link/web>
                                    <FilesMatch "\.php[345]?$">
                                            <If "-f '%{REQUEST_FILENAME}'">
                                                    SetHandler "proxy:unix:/var/lib/php7.4-fpm/web40.sock|fcgi://localhost"
                                            </If>
                                    </FilesMatch>
                            </Directory>
                            <Directory /var/www/clients/client1/web40/web>
                                    <FilesMatch "\.php[345]?$">
                                            <If "-f '%{REQUEST_FILENAME}'">
                                                    SetHandler "proxy:unix:/var/lib/php7.4-fpm/web40.sock|fcgi://localhost"
                                            </If>
                                    </FilesMatch>
                            </Directory>
                            </IfModule>
    
    
                    RewriteEngine on
                    RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
                    RewriteRule ^ - [END]
    
                    # add support for apache mpm_itk
                  <IfModule mpm_itk_module>
                            AssignUserId web40 client1
                    </IfModule>
    
                    <IfModule mod_dav_fs.c>
                    # Do not execute PHP files in webdav directory
                            <Directory /var/www/clients/client1/web40/webdav>
                                    <ifModule mod_security2.c>
                                            SecRuleRemoveById 960015
                                            SecRuleRemoveById 960032
                                    </ifModule>
                                    <FilesMatch "\.ph(p3?|tml)$">
                                            SetHandler None
                                    </FilesMatch>
                            </Directory>
                            DavLockDB /var/www/clients/client1/web40/tmp/DavLock
                            # DO NOT REMOVE THE COMMENTS!
                            # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
          # WEBDAV BEGIN
                            # WEBDAV END
                    </IfModule>
    
    
    
    
    </VirtualHost>
    
    <IfModule mod_ssl.c>
            SSLStaplingCache shmcb:/var/run/ocsp(128000)
    </IfModule>
    
     
    Last edited: Jan 8, 2024
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The vhost file looks fine and apache should serve this site for bluevibes dot link and www dot bluevibes dot link. What exactly did you see or which site do you see when you enter the domain in the browser? And DIY you start from a clean and completely empty server with the ISPConfig installation? If you used the server before to manually create vhosts or with another control panel, then there can be remnants of config files.

    Or did you maybe altered any apache config files manually or reinstalled apache after you installed ispconfig, as this might have wiped out the config file include.
     
  5. Josie-Grace

    Josie-Grace New Member

    I'm not 100% sure what was going on, but clearing cloudflare cache, my local cache and server cache made the problem go away.

    Thanks for the help
     
    ahrasis and till like this.

Share This Page