Not logged in. · Lost password · Register
Forum: General Help and Support Server Setup RSS
[solved] serverless setup and bootstrap3 template
Avatar
schplurtz (Moderator) #1
Member since Nov 2009 · 437 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
Subject: [solved] serverless setup and bootstrap3 template
Hi,

Recently I've been experimenting an installation with no webserver on
my laptop. Directly use php embedded webserver :
1) define DOKU_SCRIPT in inc/preload.php, so I can use userewrite=2 and
    get nice URL such as http://127.0.0.1:8502/foo:bar:baz
  1. <?php
  2. if(!defined('DOKU_SCRIPT')) define('DOKU_SCRIPT','.');
2) Just run nohup php -S 127.0.0.1:8502 >/tmp/mydok.log 2>&1 &
    from within dokuwiki directory, and I can use this local doku simply by
    pointing my browser at http://127.0.0.1:8502/

With default dokuwiki template, everything just work great. I can
add and remove pages, media, templates, plugins. And the search
function is OK. I get the security warning about unprotected data
directory, but, as I am the only user on this computer, it does not
matter (and can be fixed easily).

If I switch to bootstrap3 template, the search function stops working.
Any search simply jumps to the start page The q=searched-text is not
present in the request. See attached images.

Any idea how to fix this ?
The author has attached one file to this post:
searches.png 265.1 kBytes
You have no permission to open this file.
This post was edited on 2018-10-21, 00:09 by schplurtz.
Avatar
andi (Administrator) #2
User title: splitbrain
Member since May 2006 · 3432 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by schplurtz on 2018-10-18, 18:51:
Recently I've been experimenting an installation with no webserver on
my laptop. Directly use php embedded webserver :
1) define DOKU_SCRIPT in inc/preload.php, so I can use userewrite=2

There's no need for any of that. See: https://github.com/splitbrain/dokuwiki/blob/master/index.p…

Use php -S localhost:8000 index.php and use userewrite=1
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
schplurtz (Moderator) #3
Member since Nov 2009 · 437 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
Thank you andy for this information.

I don't know how I missed that, because I'm sure I saw this php server
thing while browsing DokuWiki code. Anyway, same result. everything just
work great with default template. And search is broken with bootstrap3
template. I am starting to think this could be a bootstrap3 issue. Going
to take a look.

Thanks again for the tip.
Avatar
andi (Administrator) #4
User title: splitbrain
Member since May 2006 · 3432 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Looking at your screenshot, it seems the template is building an outdated search URL. Are you sure the template is uptodate?
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
schplurtz (Moderator) #5
Member since Nov 2009 · 437 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
I think so. I installed it from within DW : admin => extension manager => search and install
Avatar
schplurtz (Moderator) #6
Member since Nov 2009 · 437 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
You are right. bootstrap3 uses its own searchform. https://github.com/LotarProject/dokuwiki-template-bootstra…

I did not suspect that the problem could come from the template, because this search problem does not exists when you use standard installation. For example, on my pi, with nginx, bootstrap3 template search function works. However, after having investigated how this works, I find it very weird :

1) browser GETs /default?id=searchedtext&do=search
2) server answers with a 302 redirect. Location: doku.php?id=default&do=search&q=searchedtext
3) browser resends request
4) server serves the search result
As can be seen on the attached screen capture.

When using php embedded server, this 302 redirect does not happen, and so, I  am stuck at the start page (which is named "default" on this server).

Note that DW sends a strange redirect. On this server I use userewrite=1. Why do I get a redirect to doku.php?id=default instead of /default ?



Bootstrap3 template should send "do=search&q=searchedtext", not "do=search&id=searchtext". It should also use wl($ID), not wl(), since this latter jumps to the start page.

Although there is some difference in behaviour between php embedded server and standard installation,
this issue is clearly caused by bootstrap3 template not sending the right query. I'll file a bug report on bootstrap3 github site.
The author has attached one file to this post:
search-bizarre.png 331.7 kBytes
You have no permission to open this file.
Avatar
andi (Administrator) #7
User title: splitbrain
Member since May 2006 · 3432 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by schplurtz:
When using php embedded server, this 302 redirect does not happen, and so, I  am stuck at the start page (which is named "default" on this server).

Hmm, that's weird. I wonder why. Can you open a bug report for that?

Quote by schplurtz:
Note that DW sends a strange redirect. On this server I use userewrite=1. Why do I get a redirect to doku.php?id=default instead of /default ?

Can you open another bug report? This https://github.com/splitbrain/dokuwiki/blob/master/inc/Act… should use wl()
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
schplurtz (Moderator) #8
Member since Nov 2009 · 437 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
bugs reports opened.

no redirect issue 2548
incorrect redirect issue 2547
Avatar
lotar #9
Member since Apr 2015 · 8 posts · Location: Rome, Italy
Group memberships: Members
Show profile · Link to this post
Hi,
fixed in develop branch using schplurtz PR.

Thanks!
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-06-17, 21:05:44 (UTC +02:00)