Clarification on multi-tenanted sites

Hey all I have created a new wiki on my base installation and enabled hostnamed based path selection, my wiki is based on bsddoc.com so I told the creation tool I want freebsd.bsddoc.com setup the appropriate vhost in my web frontend and what not…

Then when I goto freebsd.bsddoc.com I get the exact same page as if I went to bsddoc.com how do I get separate pages for each site?

Hi, maybe check your wiki descriptor from the admin UI, see https://extensions.xwiki.org/xwiki/bin/view/Extension/Wiki%20Application#HWikiAlias

Hi there thank you for the fast reply, indeed I have a different alias to my secondary (freebsd) site:
2018-07-29%20(3)

And the primary site (restricted to 1 image per post)

2018-07-29%20(2)

there is an nginx running on top of tomcat to provide these, I am simply proxypassing back to tomcat, I am not sure if that would create an issue or not the various urls are

https://bsddoc.com/wiki and http://freebsd.bsddoc.com/wiki I did not bother creating SSL certs for the sub wiki’s yet until I get this working :slight_smile: or come up with some sort of solution

I’m not really experienced with this. However last time I tested it locally, I’ve simply modified my etc/hosts file to add DNS entries:

bsddoc.com xxx.xxx.xxx.xxx
freebsd.bsddoc.com xxx.xxx.xxx.xxx

where xxx.xxx.xxx.xxx is the server’s ip address.

At least that should allow you to test that it works on the xwiki side and if it does then your issue is with your apache or nginx config.

Just to be sure: are they really the same? :slight_smile: You could change the home page content of your subwiki to make sure maybe.

Note that you can access your subwiki using the /xwiki/wiki/freebsd/view/Main/ URL.

Note: For more details on how domain-based works see https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Virtualization/AccessWiki/

Yes they are definitely the same, I added ‘welcome to bsddoc com’ to the first site and it magically appeared on the freebsd one :stuck_out_tongue:

I also had to disable the virtual path thingy to have multi site work from from the documentation: https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Virtualization/#HHostnamebasedsubwikis

That does say subwiki not ‘wiki’ though I wonder if that is relevant, on create wiki it did ask me for the domain that would be requesting it … I wonder what would happen if I forced the Host: header via nginx lets go give it a whirl :slight_smile:

And a winner, for anyone who has this issue using nginx (or anything else) as a reverse proxy this is the minimum set of headers you need(in this case tomcat is bound to 127.0.0.1:8080) :

location / {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}

No it’s not relevant. We use the two words interchangeably.

1 Like