[12:35] <Hinnerk> Hi. I have a question concerning propbably apache or dns configuration. Trying to manage my local network. I have a dedicated server and router in my local network. The server is running latest LTS Ubuntu, Apache2 and nextcloud (and other services of course). The router has dnsmasq (not sure if relevant). nextcloud is found under html folder, so I
[12:35] <Hinnerk> can reach nextcloud by https://myserver.local/nextcloud. I would like to reach it under https://nextcloud.local essentially hiding from users the difference whether it is a different server or subsite. Is that possible?
[12:36] <Hinnerk> Bonus question, if answer is yes: How?
[12:42] <tomreyn> Hinnerk: i guess the first question to ask is whether you are aware of the special purpose of the .local top level domain name for MDNS, and whether you chose this on purpose, or would prefer to use classic DNS.
[12:42] <Hinnerk> Oh, I wasn't. But actually I use .home Hope that'S not special too?
[12:43] <Hinnerk> Sorry, was making up names on the fly for the question to not put my stupid server names :)
[12:44] <Hinnerk> I prefer classic DNS, I understand that at least somewhat.
[12:44] <tomreyn> it's not essentially wrong to use MDNS for this purpose, it can make sense. the question now is how you want computers i your network to resolve hostnames to ip addresses
[12:44] <Hinnerk> Currently my router takes that job. It serves as DNS.
[12:45] <Hinnerk> It has hosts configured to resolve local IPs
[12:45] <tomreyn> okay, and your router lets you assign static names to ip addresses, and would resolve those for systems in your LAN?
[12:45] <Hinnerk> Yes. All servers have static IP
[12:46] <Hinnerk> And the host file knows them an the names.
[12:46] <Hinnerk> and
[12:46] <tomreyn> and can you assign multiple names to each system / LAN IP address there, too?
[12:46] <Hinnerk> I can reach them all just fine.
[12:46] <Hinnerk> I think that is standard, no?
[12:46] <Hinnerk> Just looking into the file, yes, I can.
[12:47] <tomreyn> it will depend on implementation, but yes, it's common
[12:47] <Hinnerk> Can you just append the folder on the server? So resolve nextcloud.home to serverip/nextcloud?
[12:47] <Hinnerk> That seemed too simple :)
[12:48] <tomreyn> so you should configure your router so that it will resolve DNS queries for nextcloud.home to the same IP address as that of the server hosting the nextcloud instance
[12:48] <tomreyn> either by A (and/or AAAA) or CNAME record.
[12:48] <Hinnerk> But would that not then redirect me to the html site not the nextcloud site?
[12:49] <Hinnerk> So, the parent folder, which then contains a link to nextcloud?
[12:49] <tomreyn> you need to do two configurations. one is about resolving the hostname on your LAN, i just discussed that. the other is on the webserver which hosts nextcloud
[12:49] <tomreyn> i think you mentioned you're using apache httpd there
[12:49] <Hinnerk> Yes.
[12:50] <Hinnerk> I see, two steps. First redirect via dns to the server. And then configure apache.
[12:50] <Hinnerk> So my hunch that both topics would be involved was right :)
[12:50] <tomreyn> in the virtualhost configuration file/snippet which defined the existing virtualhost for nextcloud, under the ServerName line, just add a "ServerAlias nextcloud.home" line
[12:50] <tomreyn> and you'll be done
[12:50] <Hinnerk> Awesome, thank you!
[12:51] <tomreyn> well, you need to reload the server configuration also
[12:51] <tomreyn> *webserver
[12:51] <Hinnerk> Of course, restart apache
[12:51] <tomreyn> looks like you almost solved it yourself. ;)
[12:53] <Hinnerk> Where is that file hiding again?
[12:54] <Hinnerk> the virtualhost config?
[12:54] <tomreyn> probably in /etc/apache2/sites-available/
[12:54] <Hinnerk> ah, of course.
[12:55] <tomreyn> note that if you'll create new files there or remove any you'll want to use a2ensite / a2dissite to enable / disable that sites, too
[12:56] <tomreyn> but in your case you're probably just editing an existing file
[12:59] <Hinnerk> Best to do a fresh reboot.
[13:00] <Hinnerk> Yes, just edited it. There was no Server section in the nextcloud.conf just an Alias. I added under that, is that ok?
[13:03] <tomreyn> maybe namebased virtual hosts are not enabled, yet, then
[13:03] <tomreyn> https://httpd.apache.org/docs/2.4/vhosts/name-based.html
[13:05] <Hinnerk> No, my mistake, wrong file...
[13:09] <tomreyn> i need to leave for a while, but i think you're going to make it work. ;-)
[13:24] <Hinnerk> Ah, pity. DNS is not resolving properly. Sorry for the discon, I was rebooting my router.
[13:24] <Hinnerk> But thank you for the help.
[13:24] <Hinnerk> Got me on the way.
[14:04] <tomreyn> Hinnerk: got it working then?
[15:24] <Hinnerk50> Hi. I get a technical error message from nextcloud. The log shows that some remoteAddr is unknown. And it is probably outdated. Where is this set? How can I fix the issue?
[15:24] <Hinnerk50> Maybe Apache / SSL related.
[15:50] <tomreyn> Hinnerk10: a screenshot might help here.
[15:51] <tomreyn> you will probably also find a nextcloud support channel around the corner here if you just look for it
[15:51] <tomreyn> that'd be the better place, if this is an error message generated by nextcloud.
[15:52] <Hinnerk10> https://paste.pics/f5487c7cb0a91af953302349df5625bc
[15:56] <tomreyn> Hinnerk10: hmm, i assume you will find more info on that in nextclouds error logs, or those for apache2, either the main ones, or a specific one for nextcloud, if such exists.
[15:58] <Hinnerk10> It must be related to the earlier change. I added a secons virtualhost section to apache2, since nextcloud.home uses a difference documentroot as myserver.home. So just putting a ServerAlias was not enough. Now it works, but I get the error message :)
[15:58] <Hinnerk10> sorry for the typos. I guess you'll figure it out :)
[16:11] <Hinnerk> So I really think it is less an owncloud issue rather than an apache2 issue.
[16:11] <Hinnerk> sorry, nextcloud
[16:11] <Hinnerk> had that too, a long time ago.
[16:12] <tomreyn> Hinnerk10: this is all nextcloud specific, talk to nextcloud support, please. here's something i looked up on their forum for you: https://help.nextcloud.com/t/howto-add-a-new-trusted-domain/26
[16:12] <Hinnerk> I think I already did that :)
[16:32] <Hinnerk> Interestig.If I enter myserver.home and navigate to the nextcloud plage, the error doesn't come up and nextcloud works like a charm.
[16:32] <Hinnerk> But if I enter nextcloud.home it fails.
[16:39] <tomreyn> so you edited both apache's and nextcloud's configuration files?