Hi. I hope everyone is ok.
Ok well I have a strange issue, I will tell everything.
I manually installed nextcloud, everything is working fine. i made a local domain hpcloud.com and also made a self signed certificate. The issue was that onlyoffice wasnt working so we decided to get a subdomain and forward that to our IP address. The forwarding started (when I ping it, it works).
After that I went forward and get certbot to create letsencrypt certificate, which was successful.
Now the page doesnt load from the domain. it is working on the IP address. but gives certificate error.
I have edited the config.php file and added the domain in trusted domain.
I have installed Apache and using nextcloud version 17. Ubuntu 20
I have checked the apache logs and the request is reaching there.
Can anyone please help?
Yes I am able to login via the IP address, yes it was previously working with the same domain but with self signed certificate.
Please tell me what am I missing.
Permanent redict to http://… Should it be https://?
Tried with that too. not working
config.php should http be https?
did that too. no luck
this was yesterday in the error log
[Sun Jun 07 04:19:40.199356 2020] [ssl:error] [pid 3587] [client 192.168.88.1:43130] AH02042: rejecting client initiated renegotiation
The default vhost is used whenever a client is accesing your server by direct IP-addres (http://1.2.3.4:80) and not with a domain name (http://www.somesite.com). If you only have one domain on this server it does not matter so much. However if you want to add domains in the future it is better to put each domain in their own somedomain.conf file instead.
You do have some small mistakes. Lets fix them:
First: Open default-ssl.conf
Remove the line ServerAlias www.... You cannot have the same in both ssl.conf files.
Set ServerName localhost
DocumentRoot should probably be pointing to the default apache htdocs folder, /var/www/html/ or similar. Not the nextcloud installation.
Second: open 000-default-le-ssl.conf
Remove the line Redirect permanent "/" "http...."
because that line will redirect your HTTPS requests to your HTTP instance, while your HTTP instance is redirecting you back to HTTPS. This creates a redirect-loop.
Third: Open 000-default.conf
Remove the line Redirect permanent "/" "http...."
Add these lines:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/.well-known
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [NC,NE,R=permanent,L]
This will make sure that people using HTTP will safely be redirected to your HTTPS site, while still allowing Letsencrypt/Certbot autorenewals to work (the .well-known directory).
Many thanks. Will do that in a while and let you know. Unfortunately I have a Corona patient at home, so have to take care of him also and be careful at the same time.
So, just to let you know that I will reply as soon as I have done that and get any result.
Many thanks