Changes to virtual host config in 6.9.1

Enonic version: 6.9.1
OS: Windows 7

Hi. After upgrading to Enonic XP 6.9.1 we’ve encountered some issues with the virtual host configuration. We get 404 on all resources in the Enonic admin panel after logging in.

This is what we have used so far in our com.enonic.xp.web.vhost file:

enabled = true
mapping.localhost.host = localhost
mapping.localhost.source = /admin
mapping.localhost.target = /admin
mapping.localhost.userStore = system

mapping.test.host = d-114-270-089
mapping.test.source = /pilot/admin
mapping.test.target = /admin
mapping.test.userStore = system

This is what it looks like after logging in now:

Any idea what we’re doing wrong here?

It is problable that it fails because it does not find the corresponding Vhost mapping as you mentionned.

Do you have access to the logs?
If you do, do you see logs similar to: “Virtual host mapping could not be resolved:”
It should describe the host and path it was looking for

Yes, I forgot to mention what’s in the log. Here you go:

13:54:44.990 WARN c.e.x.w.vhost.impl.VirtualHostFilter - Virtual host mapping could not be resolved: d-114-270-089/admin/assets/6.9.1/common/styles/_all.css
13:54:44.990 WARN c.e.x.w.vhost.impl.VirtualHostFilter - Virtual host mapping could not be resolved: d-114-270-089/admin/assets/6.9.1/common/styles/_home.css
13:54:44.990 WARN c.e.x.w.vhost.impl.VirtualHostFilter - Virtual host mapping could not be resolved: d-114-270-089/admin/assets/6.9.1/common/lib/_all.js
13:54:44.990 WARN c.e.x.w.vhost.impl.VirtualHostFilter - Virtual host mapping could not be resolved: d-114-270-089/admin/assets/6.9.1/common/js/_all.js
13:54:44.990 WARN c.e.x.w.vhost.impl.VirtualHostFilter - Virtual host mapping could not be resolved: d-114-270-089/admin/assets/6.9.1/apps/home/js/_all.js
13:54:45.021 WARN c.e.x.w.vhost.impl.VirtualHostFilter - Virtual host mapping could not be resolved: d-114-270-089/admin/common/images/background-1920.jpg

Do I need to specifically set up additional vhost-mappings in addition to the ones I already posted?

No finally, I do not think it is linked to a vhost mapping missing.
There seems to be a bug in the way admin assets are rendered in 6.9 when the “/admin” is renamed (in your case to “/pilot/admin”)
I will forward the problem and it should be fixed in a 6.9.2
If you can, you could map “/admin” to “/admin” to unblock the situation for now

Okay, thanks for the quick response.

We’re having the same issue!

It also seems that you are no longer redirected to /admin/tool when accessing your admin hostname?

given this mapping

mapping.admin-ldap.host = xp.no
mapping.admin-ldap.source = /admin 
mapping.admin-ldap.target = /admin
mapping.admin-ldap.userStore = active-directory

In 6.8 you get redirected to http://xp.no/admin/tool when accessing http://xp.no. But in 6.9 you just get a 404 unless you explicitly access http://xp.no/admin

Is this the same issue? probably should never have worked in 6.8 either?

The fact that the redirection “http://xp.no” -> “http://xp.no/admin/tool” you mention does not work anymore is done on purpose.
It is now stricter. If the virtual hosting is enabled, Enonic XP will not serve a resource accessed outside of a VHost mapping (like “http://xp.no” in your case)

Ok. This is now fixed in 6.9.2 and 6.10.0. 6.9.2 will be released very soon.

1 Like

What does “very soon” mean? We need the fix by today because we are going in prod on Monday. Doable?

Best regards
Sverre Stornes
Project Manager - Intranett - Gjensidige

For urgent issues subscription customers are adviced to file issues on support.enonic.com.

We have fixed three issues and were hoping to release 6.9.2 today, but testing revealed a critical bug.
The bug has been fixed, and we are now testing again. Unless we find more bugs, 6.9.2 should be out today, but we can not make any guarantees. We must make sure there are no other critical bugs.

The very latest version, including the bugfix on the bug found today can be found here: http://repo.enonic.com/public/com/enonic/xp/install/enonic-xp/6.9.2-RC2/

If we find no more bugs, the release will be based on the exact same code which is in RC2.

All tests have passed! The build should be ready in about 15-20 minutes.

The main build with the distro has completed and is ready for use: http://repo.enonic.com/public/com/enonic/xp/distro/6.9.2/

Docker containers and installers for Windows, Mac and Java are coming up.

3 Likes

Piggy-backing this thread since we have some similiar issues regarding the vhost-configuration.

Enonic Version: 6.9.2

We are trying to reach: <host>/admin/rest/security/principals/<userkey>?memberships=true from /admin but this results to a 404.

A user has been created and is visible from /admin in Users. However, when I try to edit the recently created user I get the notification-error: Principal [<userkey>] was not found.

I suspect that is something to do with the vhost-configuration, but I’m not sure how I should proceed.

Hi,

I do not think it is linked to Vhost. It is a 404 yes but with an error message actually generated by Enonic XP.
I suppose it is linked to the user key that you pass. It should have the following format: “user:[userstore]:[username]”

Example for super user:
[host]/admin/rest/security/principals/user:system:su?memberships=true

If the problem persist: Does it contains a capital letter or a special character?

A post was split to a new topic: Vhost and ranges of IP