How to set up let's encrypt https after moving site to new server

It may appear that it’s not.

Please share the output from:
grep -ERi 'Listen ' /etc/apache2/

Rip

/etc/apache2/apache2.conf:# Include list of ports to listen on /etc/apache2/ports.conf:Listen 80 /etc/apache2/ports.conf: Listen 443 /etc/apache2/ports.conf: Listen 443

I need to help moving certification to a new server.

So I have created a VPS that comes with everything to get a WordPress site up and running. the server is running ubuntu 18.04, wordpress, and let’s script.

After creating the new server, I copied the web files (wordpress, etc) to the new server. Then I empty the existing database, and imported the database from the old server, which is running on https.

Then I moved the letsencrypt folder to the new server and the sites-enabled and sites-available folders from the apache2 folder in the older to the new server.

Initially, I skipped the automated Let’s Encrypt setup because it’s already running in the live site.

However, after moving all the old files, I’m still not able to load the site in the new server. I don’t know why. I have to make sure that everything is working before I change the DNS settings.

The way I’ve been trying to test the site is updating the hosts file in Windows 10 and pointing it to the new IP address, but I’m getting refused connection.

Some of those are symbolic links - you need to be sure that copied over correctly.

You should be able to find an Apache error log in /var/log/apache2 on the new server, which may contain information about why Apache wasn’t able to start (if that’s part of the problem).

This consideration is important both for /etc/apache2/sites-available and for /etc/letsencrypt. :slight_smile:

No errors, just this: AH00163: Apache/2.4.29 (Ubuntu) configured – resuming normal operations

I did done the syslink again and restarted apache.

However, I’m not sure apache is working on 443.

I do have virtual host file for 443 and ports.conf are pointing to 443, but using ss -tulpn, i don’t see the apache running on 443.

Even though I haven’t changed the DNS settings to point to the new server, if everything working ok after moving the certs to the new server, I should be able to load the site editing the hosts file in Windows 10, right?

FYI, I have merged two separate topics that @mhweb created about the same problem, so they’ll now both appear on this same thread. Thanks all for the help!

1 Like

What says?:
apachectl -S

@rg305

Main DocumentRoot: "/var/www/html" Main ErrorLog: "/var/log/apache2/error.log" Mutex watchdog-callback: using_defaults Mutex rewrite-map: using_defaults Mutex default: dir="/var/run/apache2/" mechanism=default Mutex mpm-accept: using_defaults PidFile: "/var/run/apache2/apache2.pid" Define: DUMP_VHOSTS Define: DUMP_RUN_CFG User: name="www-data" id=33 Group: name="www-data" id=33

If that is all of it, then there is definitely somethings missing from your config.
Primarily content such as:

VirtualHost configuration:
*:80      10.10.10.10 (/etc/apache2/sites-enabled/000-default.conf:1)
ServerRoot: "/etc/apache2"

Where is the location for that VirtualHost config that you’re referring too? because i’m using the same virtualhost files as in the old server.

Thanks,

Once I move the letsencrypt files to the new server, do I have to run any letsencrypt commands?

I’m not referring to any specific file.
My point is that your apachectl -S response does NOT return any bound port nor related conf file.

Your config says your NOT using any - the files may be there but they are NOT being used.

Not immediately.
But you will have to insure that (attempts to) renewal are being processed daily and do renew correctly before your certs expire.

How do I make the server use the virtualhost files?
Thanks,

Find the path where your vhost config files are and add the following in your apache.conf file:

Include /path/to/vhost/dir/*.conf

1 Like

I’m going to start over with a new vps.
Thanks,