404 not found after a first success installations

Nextcloud version : 16.0
Operating system and version : LinuxMint 19.2
Apache or nginx version : Apache 2
PHP version : 7.3
Is this the first time you’ve seen this error? : Y

Hi everyone,

After 5 hours for installing and configure Apache, MariaDB, MySQL, PHP, Nextcloud, I finally succeeded to obtain my nextcloud server, I configure my admin login, admin password, the places where my data is, and all works it (I was on the web interface).

But without apparent reasons (I think I restart the Apache Server), I obtain a

Not Found
The requested URL was not found on this server.
Apache/2.4.41 (Ubuntu) Server at Port 443

If it helps, I’ve set up an SSL connection (before Nextcloud works, so I do not think it’s related to that), hence port 443.

Also note that I got the warning

Could not reliably determine the server's fully qualified domain name,
 using Set the 'ServerName' directive globally to suppress this message

And i edit apache2.conf by adding ServerName localhost, following a tutorial, I make this after the first success on my nextcloud, maybe the problem comes from there.

Thanks to read me.

EDIT : I remove ServerName localhost of apache2.conf, but the problem persist.

Your ServerName should not be localhost. It should be the server’s hostname, or on a virtual host, it should be the virtual hosts’s FQDN.

I suspect your problem is that Apache is not passing your connection to the correct virtual host. Make sure you set ServerName on your Nextcloud virtual host.

Can you post your Apache site config and the URL giving you the 404?