The urls have "/bin/bin" instead of "/bin"

Hi all,

I have installed Tomcat9 and Xwiki Stable 11.9 on a Ubuntu 18.04 LTS server.

On the wiki, all links have an extra “/bin” ; so they don’t work correctly.

I mean:

…/bin/view/Forums/ -> …/bin/bin/view/Forums/

On google , I see that the problem is mostly related with setting " xwiki.webapppath". I have applied that but the result hasn’t changed.

I am new to xwiki and I have no idea how could i fix that, any help would be appreciated.

Thanks…

1 Like

Yes it looks like you made XWiki the default application but did not set xwiki.webapppath accordingly in xwiki.cfg file. Maybe you forgot to uncomment it (removing the # in front of it).

1 Like

Hi,

Actually my configuration seems correct:
image

I am a bit suspicious about the way I have made installation:
I have renamed xwiki.11.9.war to ROOT.war and put it into webapps directory of tomcat. Deleted the ROOT directory and started tomcat server. Tomcat created ROOT and deployed xwiki files into that.

Is there any problem with this installation? Could that cause any problems?

Using WARs makes quite a pain to configure XWiki (you have to modify the files inside the WAR) so we tend extract it into a folder usually.

Where is the xwiki.cfg file you modified located ?

I have modified the file under ROOT/WEB-INF/xwiki.cfg:

image

Should i remove the ROOT.war after first run?

Better get rid of the WAR since it should not be needed I think (and maybe Tomcat will extract it again, not really sure what is the priority).

Thanks, I will try that

If it still does not work could you try to put the following in a wiki page and see what result you get:

{{velocity}}
$xwiki.webAppPath
{{/velocity}}

This macro results like that:
image

Does that mean something?

Means you have the right configuration so not sure where that double /bin is coming from.

I removed everything, including database. Reinstalled ; the result is same. I am suspecting about my tomcat installation.

I think there is a xwiki deployment packet containing tomcat? Where could I find it?

Maybe you are referring to http://platform.xwiki.org/xwiki/bin/view/AdminGuide/InstallationViaAPT (which does not “contains” tomcat but have it as dependency) ? It does not really configure Tomcat in any more ways than having XWiki being inserted as an application.

Before reinstalling everything here is a few more things to test:

{{velocity}}
$xwiki.webAppPath
$doc.externalURL
$xcontext.getURLFactory().getServerURL($xcontext.context)
{{/velocity}}

It was working well when XWiki was under/xwiki/ webapp, right ?

The script results like that:

image

Actually I haven’t tested that. I am using authbind with tomcat to serve the application directly on port 80. Perhaps that is causing some trouble?

According to the test the URLs generated by XWiki are right. Where are the wrong URL located exactly ?

Sorry, I think that was not clear enough. The links on the applications panel on the left are wrong:

image

OK if it’s only the panel then it looks like a bug. Would be great if you could create a new issue on https://jira.xwiki.org/browse/XWIKI for it with all the details you can think of to reproduce the issue.

Ok , thanks. I will do that.

There are two main lines that you need to uncomment to remove the above error.
Edit xwiki.cfg and uncomment following two lines:

xwiki.webapppath=
xwiki.servletpath=

No need to add anything just uncomment and restart tomcat

systemctl restart tomcat9

image

2 Likes

Thanks, its work for me!

this worked for me thanks