Koozali.org: home of the SME Server

Secondary domains and ibays?

Offline DanB35

  • *****
  • 764
  • +0/-0
    • http://www.familybrown.org
Secondary domains and ibays?
« on: December 01, 2017, 02:40:54 PM »
tl;dr: Why does http://secondarydomain/ibayname return 404?

I've had Owncloud/Nextcloud running on my SME Server in an ibay for a number of years now (currently running version 12.0.3), accessible at https://primarydomain/owncloud.  It's worked fine.  I have a couple of other domains on the server, but they're pointed to their own ibays, so this is the first time I've encountered this issue.

Yesterday, I added another domain.  The only purpose of that domain was email and Nextcloud for its users, on the existing Nextcloud installation.  I registered the domain, configured DNS to point to my SME box, and set up the domain on my SME box to point to the primary ibay (which contains only an "under construction" message--the default index page).  I can reach that without a problem--https://secondarydomain/ returns that same "under construction" page.  But when I try to go to https://secondarydomain/owncloud, I get 404.  That doesn't seem like the expected behavior.  If a domain is pointed to the primary ibay, I'd expect domain/ibay to behave the same way as the primary domain.  How can I make this behave as expected?
......

Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Secondary domains and ibays?
« Reply #1 on: December 01, 2017, 06:41:41 PM »
this is because of  /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent template which will add Aliases of all the ibays for primary domain but not for others.

this was a choice I guess. For some it is as they intend it used, for others, it is an issue.
It could be an issue in other other direction : do not understand why your folder content /home/e-smith/files/ibays/Primary/html/work is not shown and in place you see the content of  /home/e-smith/files/ibays/work/html/ when pointing to http://myprimarydomain.tld/work

if your domain has as solely purpose the Nextcloud instalaltion then you should point it to the nextcloud ibays instead, and you could create a  /home/e-smith/files/ibays/nextcloud/html/nextcloud  folder with a redirection to parent folder, or create a tempalte custom to redirect  or rewrite  https://secondarydomain/owncloud to  https://secondarydomain; or even an alias if you want to keep the owncloud in the url

they should still be able to access to https://secondarydomain/webmail even if pointing to another ibay.

Offline DanB35

  • *****
  • 764
  • +0/-0
    • http://www.familybrown.org
Re: Secondary domains and ibays?
« Reply #2 on: December 02, 2017, 01:54:52 PM »
if your domain has as solely purpose the Nextcloud instalaltion then you should point it to the nextcloud ibays instead,
That's an obvious solution I hadn't thought of, and it works fine without any redirects or other trickery.  I still think the behavior here is counterintuitive, but I see how the behavior I'm expecting could cause problems as well.
......

Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Secondary domains and ibays?
« Reply #3 on: December 03, 2017, 07:45:56 AM »
That's an obvious solution I hadn't thought of, and it works fine without any redirects or other trickery.  I still think the behavior here is counterintuitive, but I see how the behavior I'm expecting could cause problems as well.

the 2 questions I see here could be :
- could we have more than one primary domain ?
- is a domain pointing to Primary ibay should be considered as Primary domain or restricted to the ibay (if not (a,the) Primary domain).

I am pretty getting your point of view. But this could be a long thread of philosophical points of view. If people steps in, I am ok to hear their ideas, and if there is a tendency to a direction different to what is the current situation, then why not make a change !

Offline DanB35

  • *****
  • 764
  • +0/-0
    • http://www.familybrown.org
Re: Secondary domains and ibays?
« Reply #4 on: December 03, 2017, 12:40:55 PM »
I'm having trouble imagining a case where someone would point a secondary domain to the primary ibay, and not want it to behave like the primary domain.  The case where you'd have the same landing page, but different sub-pages, just strikes me as foreign.  I'm sure it's possible, but it just doesn't seem that likely or common.  To me, it would make sense to simply change the behavior in that regard, which should be pretty simple.

However, if there are people who use it as you describe, changing the behavior breaks their setups.  That means it should be configurable instead, which is probably more work than it's worth.
......