# 404 error Nextcloud setup

**URL:** <https://community.letsencrypt.org/t/404-error-nextcloud-setup/151574>\
**Category:** Help\
**Created:** [May 12, 2021, 3:35pm UTC](https://community.letsencrypt.org/t/404-error-nextcloud-setup/151574 "2021-05-12T15:35:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Operations](https://avatars.discourse-cdn.com/v4/letter/o/b487fb/32.png) [@Operations](https://community.letsencrypt.org/u/Operations)\
**Post date:** [May 12, 2021, 3:35pm UTC](https://community.letsencrypt.org/t/404-error-nextcloud-setup/151574/1 "2021-05-12T15:35:44Z")

</div>

Hello everybody 🙂

I am trying to finish this HowTo:

> **[Install Nextcloud 21, Collabora, and HPB on Debian 10](https://nerdonthestreet.com/wiki?find=Install%2BNextcloud%2B21%2C%2BCollabora%2C%2Band%2BHPB%2Bon%2BDebian%2B10)**

But my problem is the Let's Encrypt command doesn't work. (certbot --apache)

## The error is get is:

root@cloud:/var/www/nextcloud# certbot --apache  
Saving debug log to /var/log/letsencrypt/letsencrypt.log  
Plugins selected: Authenticator apache, Installer apache

Which names would you like to activate HTTPS for?

* * *

1: cloud.DOMAIN.nl

* * *

Select the appropriate numbers separated by commas and/or spaces, or leave input  
blank to select all options shown (Enter 'c' to cancel): 1  
Obtaining a new certificate  
Performing the following challenges:  
http-01 challenge for cloud.DOMAIN.nl  
Waiting for verification...  
Cleaning up challenges  
Failed authorization procedure. cloud.DOMAIN.nl (http-01): urn:ietf:params:acm e:error:unauthorized :: The client lacks sufficient authorization :: Invalid res ponse from [http://cloud.DOMAIN.nl/.well-known/acme-challenge/Mycrj8dvNBtG-vV53](http://cloud.DOMAIN.nl/.well-known/acme-challenge/Mycrj8dvNBtG-vV53) 0zHCUCbV61uLTaex\_dBSuajQWU [_._.\*.213]: "\n\n404 Not Found\n\n

# Not Found
\n\<p"

IMPORTANT NOTES:

- The following errors were reported by the server:

* * *

I am 100% sure i have an A record in my domain DNS. I use the same name for a different working Nextcloud ubuntu setup (which is of course off at the moment).  
So because i use the same name and internal IP address, i also know there is no firewall issue. I also tried a different hostname (with newly setup A record) and different external and internal IP. I keep getting the same error...

I have followed the HowTo to the letter, but i think something is still not right... The HowTo is pretty straight forward so to be honest i feel a bit stupid... But i just can't seem to get it right...

I am pretty novice when it comes to linux (so please be very gentle 😛 ), but i do know my way around networks/firewalls etc.

Any ideas?

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [May 12, 2021, 4:54pm UTC](https://community.letsencrypt.org/t/404-error-nextcloud-setup/151574/2 "2021-05-12T16:54:37Z")

</div>

> [@Operations](#):
>
> Any ideas?

Yes, one: "APACHE"  
Please show the output of:  
`apachectl -S`

---

<div class="post-metadata">

**Author:** ![JuergenAuer](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/juergenauer/32/26491_2.png) [@JuergenAuer](https://community.letsencrypt.org/u/JuergenAuer)\
**Post date:** [May 12, 2021, 5:02pm UTC](https://community.letsencrypt.org/t/404-error-nextcloud-setup/151574/3 "2021-05-12T17:02:36Z")

</div>

Hi @Operations

> [@Operations](#):
>
> 1: cloud.DOMAIN.nl

your domain name is required if you want help.

---

<div class="post-metadata">

**Author:** ![Operations](https://avatars.discourse-cdn.com/v4/letter/o/b487fb/32.png) [@Operations](https://community.letsencrypt.org/u/Operations)\
**Post date:** [May 12, 2021, 5:12pm UTC](https://community.letsencrypt.org/t/404-error-nextcloud-setup/151574/4 "2021-05-12T17:12:22Z")

</div>

Not necessary anymore...

---

<div class="post-metadata">

**Author:** ![Operations](https://avatars.discourse-cdn.com/v4/letter/o/b487fb/32.png) [@Operations](https://community.letsencrypt.org/u/Operations)\
**Post date:** [May 12, 2021, 5:14pm UTC](https://community.letsencrypt.org/t/404-error-nextcloud-setup/151574/5 "2021-05-12T17:14:01Z")

</div>

root@cloud:~# apachectl -S  
VirtualHost configuration:  
\*:80 is a NameVirtualHost  
default server cloud.DOMAIN.nl (/etc/apache2/sites-enabled/000-defaul t.conf:1)  
port 80 namevhost cloud.DOMAIN.nl (/etc/apache2/sites-enabled/000-def ault.conf:1)  
port 80 namevhost cloud.DOMAIN.nl (/etc/apache2/sites-enabled/nextclo ud.conf:1)  
ServerRoot: "/etc/apache2"  
Main DocumentRoot: "/var/www/html"  
Main ErrorLog: "/var/log/apache2/error.log"  
Mutex rewrite-map: using\_defaults  
Mutex default: dir="/var/run/apache2/" mechanism=default  
Mutex mpm-accept: using\_defaults  
Mutex watchdog-callback: 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  
root@cloud:~#

nano /etc/apache2/sites-available/nextcloud.conf

I entered a different DocumentRoot (/var/www/nextcloud).. I looks like it is not saving that.

\<VirtualHost \*:80\>  
# 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 cloud.DOMAIN.nl

```
    ServerAdmin webmaster@DOMAIN.nl
    DocumentRoot /var/www/nextcloud
```

---

<div class="post-metadata">

**Author:** ![JuergenAuer](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/juergenauer/32/26491_2.png) [@JuergenAuer](https://community.letsencrypt.org/u/JuergenAuer)\
**Post date:** [May 12, 2021, 5:25pm UTC](https://community.letsencrypt.org/t/404-error-nextcloud-setup/151574/6 "2021-05-12T17:25:18Z")

</div>

> [@Operations](#):
>
> port 80 namevhost cloud.DOMAIN.nl (/etc/apache2/sites-enabled/000-def ault.conf:1)  
> port 80 namevhost cloud.DOMAIN.nl (/etc/apache2/sites-enabled/nextclo ud.conf:1)

There you see your problem.

Two different vHosts with the same port and the same domain name.

Merge both in one, remove the other.

---

<div class="post-metadata">

**Author:** ![Operations](https://avatars.discourse-cdn.com/v4/letter/o/b487fb/32.png) [@Operations](https://community.letsencrypt.org/u/Operations)\
**Post date:** [May 12, 2021, 5:26pm UTC](https://community.letsencrypt.org/t/404-error-nextcloud-setup/151574/7 "2021-05-12T17:26:53Z")

</div>

Could you be so kind and to tell me how to do this? 🙂

And looking at the HowTo, how did this happen? Any idea? (To learn from my mistakes...)

And the different DocumentRoot is not the cause and of a problem ?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [June 11, 2021, 5:27pm UTC](https://community.letsencrypt.org/t/404-error-nextcloud-setup/151574/8 "2021-06-11T17:27:04Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
