I am trying to run a nextcloud server from my home laptop. I use Hover for my DNS, and had the A records:
type | host | value | ttl |
---|---|---|---|
A | @ | 108.20.147.223 | 15min |
A | www | 108.20.147.223 | 15min |
A | cloud | 108.20.147.223 | 15min |
I also have a CNAME for blog
that points to my github pages site (I don't think it's relevant, but .
Prior to running certbot, my configuration was vanilla, except for vhosts.d/bonham-ch.conf
:
<VirtualHost *:80>
DocumentRoot "/srv/www/htdocs"
ServerName www.bonham.ch
ServerAlias bonham.ch
# Other directives here
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/srv/www/htdocs/nextcloud"
ServerName cloud.bonham.ch
# Other directives here
</VirtualHost>
With this setup, I was able to go to http://www.bonham.ch, http://bonham.ch and get my root page (just an index.html
with "Hello, World!"
, and to http://cloud.bonham.ch
which opened my nextcloud installation login page.
After running certbot
(see below for outputs), my vhosts.d/bonham-ch.conf
was modified to
<VirtualHost *:80>
DocumentRoot "/srv/www/htdocs"
ServerName www.bonham.ch
ServerAlias bonham.ch
# Other directives here
RewriteEngine on
RewriteCond %{SERVER_NAME} =bonham.ch [OR]
RewriteCond %{SERVER_NAME} =www.bonham.ch
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/srv/www/htdocs/nextcloud"
ServerName cloud.bonham.ch
# Other directives here
RewriteEngine on
RewriteCond %{SERVER_NAME} =cloud.bonham.ch
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
The 3 urls above now re-route properly to https, but I get "this site can't be reached" ERR_ADDRESS_UNREACHABLE
(chrome) or "Unable to connect" (firefox).
I added
<VirtualHost *:443>
DocumentRoot "/srv/www/htdocs"
ServerName www.bonham.ch
ServerAlias bonham.ch
# Other directives here
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "/srv/www/htdocs/nextcloud"
ServerName cloud.bonham.ch
# Other directives here
</VirtualHost>
To bonham-ch.conf
, and I added 443 to port forwarding on my home router, but I'm still getting the same response.
I'm quite a newb on this stuff, so no consideration is too stupid, any help would be appreciated!
PS I read through this thread and some other threads here with similar problems, but didn't immediately see a relationship. bonham.ch - Make your website better - DNS, redirects, mixed content, certificates gives:
My domain is: bonham.ch
I ran this command:
certbot --apache -d cloud.bonham.ch
certbot --apache -d bonham.ch -d www.bonham.ch
It produced this output:
certbot output (success)
$ certbot --apache -d cloud.bonham.ch
Saving debug log to /var/log/letsencrypt/letsencrypt.log
ssl_module is statically linked but --apache-bin is missing; not disabling session tickets.
Requesting a certificate for cloud.bonham.ch
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/cloud.bonham.ch/fullchain.pem
Key is saved at: /etc/letsencrypt/live/cloud.bonham.ch/privkey.pem
This certificate expires on 2024-04-11.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
Deploying certificate
Successfully deployed certificate for cloud.bonham.ch to /etc/apache2/vhosts.d/bonham-ch-le-ssl.conf
Congratulations! You have successfully enabled HTTPS on https://cloud.bonham.ch
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
* Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
* Donating to EFF: https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$ certbot --apache -d bonham.ch -d www.bonham.ch
Saving debug log to /var/log/letsencrypt/letsencrypt.log
ssl_module is statically linked but --apache-bin is missing; not disabling session tickets.
Requesting a certificate for bonham.ch and www.bonham.ch
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/bonham.ch-0001/fullchain.pem
Key is saved at: /etc/letsencrypt/live/bonham.ch-0001/privkey.pem
This certificate expires on 2024-04-11.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
Deploying certificate
Successfully deployed certificate for bonham.ch to /etc/apache2/vhosts.d/bonham-ch-le-ssl.conf
Successfully deployed certificate for www.bonham.ch to /etc/apache2/vhosts.d/bonham-ch-le-ssl.conf
Congratulations! You have successfully enabled HTTPS on https://bonham.ch and https://www.bonham.ch
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
* Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
* Donating to EFF: https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
My web server is (include version): Apache2
$ apachectl -v
Server version: Apache/2.4.58 (Linux/SUSE)
Server built: 2023-10-19 14:26:31.000000000 +0000
The operating system my web server runs on is (include version):
$ cat /etc/os-release
NAME="openSUSE Tumbleweed"
# VERSION="20240109"
#...
My hosting provider, if applicable, is: None (home laptop)
I can login to a root shell on my machine (yes or no, or I don't know): yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no
The version of my client is (e.g. output of certbot --version
or certbot-auto --version
if you're using Certbot): certbot 2.8.0