Issues when transfering servers

contents of 000-default-le-ssl.conf in sites-available of old working linux install:

<IfModule mod_ssl.c>
<VirtualHost *:443>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        ServerName www.techmasterdesign.com
        ServerAlias techmasterdesign.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf

        
        #enable SSL
        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLOptions +StrictRequire
        
        SSLCertificateFile /etc/letsencrypt/live/www.techmasterdesign.com/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/www.techmasterdesign.com/privkey.pem
</VirtualHost>
</IfModule>

Those are redundant; As there are no other possible names that could be matched [and must match before they can even be compared].

2 Likes

Those need to be corrected to where the new cert is located [without the "www."]:

2 Likes

the only two files in the live folder are:

root@lenovo-server:/etc/letsencrypt/live# ls

README and techmasterdesign.com which looks like it contains the keys and such.

Don't touch those files.
Edit the file:

[remove the "www." from the cert paths]

2 Likes

when making the .conf file for the ssl-le, i should point to /etc/letsencrypt/live key yes?

Yes, they are here:

[shown by the output of certbot certificates]

Which are slightly different than what's in the file now:

2 Likes

Ok perfect. I just created that 000-default-le-ssl.conf file and copied from the old install, but removed the www. before in the path.

2 Likes

ready to enable it:
a2ensite 000-default-le-ssl.conf

2 Likes

Now presumably would be a2ensite 000-default-le-ssl.conf and then rerun certbot? THen if that works, repeat steps for other domains.

2 Likes

No need to run certbot anymore.
Just get apache to use the cert already obtained.

3 Likes

I just restarted apache, and checked port forwarding and DNS update for IP. Seems that I can only access the site from the local IP. Might just have to wait for the godaddy DNS server to update :p. I also wanted to say thank you in advance for all of your help <3

" This site can’t be reached

techmasterdesign.com refused to connect.

Try:

ERR_CONNECTION_REFUSED"

This is how 000-default-le-ssl.conf is supposed to look, right? Lol

<IfModule mod_ssl.c>
<VirtualHost *:443>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        ServerName www.techmasterdesign.com
        ServerAlias techmasterdesign.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf


        #enable SSL
        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLOptions +StrictRequire

        SSLCertificateFile /etc/letsencrypt/live/techmasterdesign.com/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/techmasterdesign.com/privkey.pem
</VirtualHost>
</IfModule>

That's a good file.

The port 443 problem is not a godaddy issue.

Name:    techmasterdesign.com
Address:  47.6.106.221
Name:    047-006-106-221.res.spectrum.com

The router needs to port forward 443 as it does 80.
The firewall needs to accept 443 as it does 80.

2 Likes

port forwarding is good. I haven't messed with the linux firewall rules yet, that might be it.

just ran:
sudo iptables -I INPUT -p tcp -m tcp --dport 443 -j ACCEPT
sudo iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT

Still refusing connection, weird.

Reboot the entire Internet - LOL

3 Likes

I'm still getting "Connection refused" on port 443.

IPS?
Geolocation/fencing blocking?

2 Likes

I port forwarded 443 and 80 and added them to the iptables. Lol. Let me try a different terminal command for linux.

have you rebooted?

What shows?:
ufw status

2 Likes