Installing MediaWiki with Lighttpd

来自开放百科 - 灰狐
跳转到: 导航, 搜索

This page presents step-by-step instructions for installing MediaWiki with Lighttpd and PHP+FastCGI. We will assume you have MySQL installed already.

http://meta.wikimedia.org/wiki/Installing_MediaWiki_with_Lighttpd

  • Download Lighttpd
  • Download PHP
  • gzip -dc lighttpd-1.3.14.tar.gz | tar xf -
  • cd lighttpd-1.3.14
  • ./configure --prefix=/opt/lighttpd
  • make all install
  • cp doc/lighttpd.conf /etc/
  • cd ..
  • gzip -dc php-5.0.4.tar.gz | tar xf -
  • cd php-5.0.4
  • ./configure --enable-fastcgi --with-mysql=<path to MySQL installation> --prefix=/opt/php-fcgi
  • make all install
  • Edit /etc/lighttpd.conf as appropriate. You will need to add at least the following lines:
fastcgi.server = ( ".php" =>
                   ( "localhost" =>
                     (
                       "host" => "127.0.0.1",
                       "port" => 1026,
                       "bin-path" => "/opt/php-fcgi/bin/php"
                     )
                   )
                )

url.rewrite-once = (
                     "^/$" => "/w/index.php",
                     "^/wiki/([^?]*)(?:\?(.*))?" => "/w/index.php?title=$1&$2"
                   )

And if you also want to support "http://yoursite/ArticleName" URLs:

url.redirect = ( "^/(?!w|wiki|robots.txt|favicon.ico)(.*)" => "/wiki/$1" )

Ensure the "rewrite", "redirect" and "fastcgi" modules are enabled.

  • Extract the MediaWiki source into your document root, and mv mediawiki-1.5beta1 w
  • Start lighttpd: /opt/lighttpd/sbin/lighttpd -f /etc/lighttpd.conf
  • Visit "http://www.yoursite.com/w/config/index.php" and configure MediaWiki as documented at Help:Installation
  • Edit LocalSettings.php and change $wgArticlePath to:
$wgArticlePath = "/wiki/$1";
  • Done!
分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱