Jump to content

User talk:Svemir Brkic/archive

Add topic
From mediawiki.org
Latest comment: 16 years ago by Svemir Brkic in topic SphinxSearch

SphinxSearch

[edit]

Svemir, I have been attempting to implement SphinxSearch into my wiki. The instructions are not great for us poor windows users. How do I perform steps 5 & 6 on windows? Please let me know if this is not the correct location to ask this type question.

Steve Goble 16:17, 13 May 2008 (UTC)Reply

Correct place is Extension talk:SphinxSearch‎. Windows version of Sphinx has certain limitations, but I never installed it on Windows myself. Some other people on that talk page apparently did. Svemir Brkic 16:44, 13 May 2008 (UTC)Reply
THANKS, I'll try it. Steve Goble18:26, 14 May 2008 (UTC)Reply
Svemir, sorry to bother you. I have seen no update and am not able to find a solution to my issue. I am experiencing the blank page issue on a Windows/mediawiki installation and am unable to find a solution. I cannot be sure it is installed fully because I am not able to figure out step 5 and 6. Can you help? Steve
It seems that someone did answer after all - I just reformatted the answer a little now. However, you do not really need the step 6 to get started. That is needed for updating the index on a regular basis, but you first need to do the steps 1 through 5. You should also search the forums on the sphinx site itself for any specific problems regarding getting sphinx itself to run on Windows. I still did not find the time to try it myself. Svemir Brkic 01:41, 30 May 2008 (UTC)Reply
Thanks. That was actually me that answered it. I so still have another issue, I will post it on that site. Thanks so much for your prompt replies!

Using thttpd

[edit]

Dear Svemir, I saw you comment that you are using thttpd to serve your static content which is exactly what I am trying to achieve. Please would you consider posting a guide as to how you did it. JohnShep 22:36, 21 March 2008 (UTC)Reply

  • Install thttpd
  • Edit the configuration file, setting dir to your current $wgUploadDirectory (where images are) and port to something different than what your web server runs on:
dir=/var/www/html/d/images
port=8080
chroot
user=thttpd
logfile=/var/log/thttpd.log
pidfile=/var/run/thttpd.pid
  • thttpd needs all the files to be in the same folder, at least by default, and symlinks are not allowed. Move the skins folder into the folder specified by "dir" above
  • Just in case, create a symlink from the original skins location to the new one. You could also copy the folder instead of moving it, but then you have to maintain two copies. Whatever you do, keep it in mind next time you upgrade your wiki.
  • Set relevant paths in your LocalSettings.php (these settings may not work for you, as we have a very customized install.)
$wgStylePath = 'http://your.domain:8080/skins';
$wgUploadBaseUrl = 'http://your.domain:8080';
$wgUploadPath = '';
$wgUploadDirectory  = "/var/www/html/d/images";

Svemir Brkic 02:00, 22 March 2008 (UTC)Reply

Many thanks for getting back to me :-) I shall add what I have done and maybe after tidying up this will make a good HowTo for other people.

I already use thttpd for static images and have it configured on a different IP on the same box bound to http://static.myserver.com

$wgUploadBaseUrl = "http://static.myserver.com/wiki";
$wgUploadPath       = "";
$wgUploadDirectory  = "$IP/images"; # no change

In the root directory of thttpd I put a symlinks to the images and skins directories of mediawiki (don't want to mirror the whole structure as thttpd will serve php files as text) and therefore need the -nos option for thttpd. Also I found that thttpd runs a lot better with no log so -l /dev/null if logging is enabled sometimes it crashes during logrotate.

I edited skins/monobook/main.css and changed the url includes :-

list-style-image: url(bullet.gif);
/* to the full static path */
list-style-image: url(http://static.myserver.com/skins/monobook/bullet.gif);

This looks to have been unnecessary and I shall try your method of the $wgStylePath instead.

Again many thanks, I really appreciate you helping me with this JohnShep 09:25, 22 March 2008 (UTC)Reply

running Yslow

[edit]

I made the style path change and ran Yslow, the number of requests to apache fell from 15 to 5 there are still three css files and one js file :-

http://www.boxrec.com/media/index.php?title=MediaWiki:Common.css&usemsgcache=yes&action=raw&ctype=text/css&smaxage=18000

/* CSS placed here will be applied to all skins */


http://www.boxrec.com/media/index.php?title=MediaWiki:Monobook.css&usemsgcache=yes&action=raw&ctype=text/css&smaxage=18000

/* CSS placed here will affect users of the Monobook skin */

http://www.boxrec.com/media/index.php?title=-&action=raw&gen=css&maxage=18000&smaxage=0

/* generated user stylesheet */
a { text-decoration: underline; }
a.new, #quickbar a.new { color: #CC2200; }

http://www.boxrec.com/media/index.php?title=-&action=raw&smaxage=0&gen=js&useskin=monobook

/* generated javascript */
var skin = 'monobook';
var stylepath = 'http://static.boxrec.com/skins';

/* MediaWiki:Common.js */
/* Any JavaScript here will be loaded for all users on every page load. */

/* MediaWiki:Monobook.js (deprecated; migrate to Common.js!) */
/* Deprecated; use [[MediaWiki:common.js]] */

So there are still 5 times as many apache requests to generate the page as optimal, two of which are for empty files :-(

JohnShep 11:34, 22 March 2008 (UTC)Reply

These exists to allow adding custom CSS via the wiki itself. If you do not need to support such a feature, you can add all custom CSS to one or more of the static files and comment out these lines in Monobook.php and other skins (if you use any.) If you do need to support such a feature and still want to serve that custom CSS via thttpd, you could use a hook to write out that CSS into static files each time those pages are edited. Svemir Brkic 13:29, 22 March 2008 (UTC)Reply


OK great, I edited /includes/Skin.php and commented out two lines :-

     function getUserStylesheet() {
                global $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage, $wgStyleVersion;
                $sheet = $this->getStylesheet();
                $s = "@import \"$wgStylePath/common/shared.css?$wgStyleVersion\";\n";
                $s .= "@import \"$wgStylePath/common/oldshared.css?$wgStyleVersion\";\n";
                $s .= "@import \"$wgStylePath/$sheet?$wgStyleVersion\";\n";
                if($wgContLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css?$wgStyleVersion\";\n";

                $query = "usemsgcache=yes&action=raw&ctype=text/css&smaxage=$wgSquidMaxage";
#               $s .= '@import "' . self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI ) . "\";\n" .
#                       '@import "' . self::makeNSUrl( ucfirst( $this->getSkinName() . '.css' ), $query, NS_MEDIAWIKI ) . "\";\n";

                $s .= $this->doGetUserStyles();
                return $s."\n";
        }

I edited /includes/SkinTemplate.php and commented out two lines :-

#                       $sitecss .= '@import "' . self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI) . '";' . "\n";
#                       $sitecss .= '@import "' . self::makeNSUrl( ucfirst( $this->skinname ) . '.css', $query, NS_MEDIAWIKI ) . '";' . "\n";

which removed the two empty css files :-)

JohnShep 16:04, 23 March 2008 (UTC)Reply