Revision history for LighttpdConfig
Revision [22896]
Last edited on 2016-05-20 07:38:42 by SigurdHogsbro [Replaces old-style internal links with new pipe-split links.]Additions:
This page can now be found on the [[Docs:LighttpdConfig | Wikka Documentation Server]].
An archive of [[http://wikkawiki.org/LighttpdConfig/revisions | old revisions of this page]] is still available for reference.<<
An archive of [[http://wikkawiki.org/LighttpdConfig/revisions | old revisions of this page]] is still available for reference.<<
Deletions:
An archive of [[http://wikkawiki.org/LighttpdConfig/revisions
old revisions of this page]] is still available for reference.<<
Additions:
<<===This page has moved===
This page can now be found on the [[Docs:LighttpdConfig Wikka Documentation Server]].
Thanks for updating your bookmarks!
An archive of [[http://wikkawiki.org/LighttpdConfig/revisions
old revisions of this page]] is still available for reference.<<
::c::
CategoryMigratedDocs
This page can now be found on the [[Docs:LighttpdConfig Wikka Documentation Server]].
Thanks for updating your bookmarks!
An archive of [[http://wikkawiki.org/LighttpdConfig/revisions
old revisions of this page]] is still available for reference.<<
::c::
CategoryMigratedDocs
Deletions:
=====Configuring Lighttpd for Wikka=====
>>==See also:==
~-[[ModRewrite Wikka and mod_rewrite]]
~-[[WikkaInstallation Installing Wikka]]
~-[[WikkaOnMacOSX Installing Wikka on Mac OS X]]
~-[[WikiOnAStick Installing Wikka on a USB stick]]
>>====Introduction====
I recently got Wikka running under [[http://lighttpd.org/ lighttpd]], and since I was only able to find limited documentation to support that effort either here or elsewhere, I thought I should document my experience for posterity.
Before I get started, though, I need to acknowledge JavaWoman and LadySerena from [[WikkaOnIrc #wikka]], both for their assistance in getting the URL rewriting working, and for encouraging me to record the results.
====Server Configuration====
For my particular installation, I wanted to serve Wiki content out of the document root for a dedicated subdomain. So rather than have my Wiki reside at, say, http://www.example.com/wiki, I wanted it at http://wiki.example.com/. I also wanted it to use user-friendly URLs, like http://wiki.example.com/HomePage, rather than the out-of-the-box query-string URLs, such as http://wiki.example.com/wikka.php?wakka=HomePage. Finally, to get the best performance out of the combination of lighttpd and PHP, I chose to interface them using [[http://www.fastcgi.com/ FastCGI]].
To that end, I unpacked the Wikka distribution into the directory I had selected for my subdomain's document root, and then set about editing my ##lighttpd.conf## configuration file.
====Lighttpd Configuration====
With respect to the ##server.modules## configuration parameter, you will need to include ##mod_fastcgi## for ""FastCGI"" support and, if you want user-friendly URLs, ##mod_rewrite##. You should also make sure the ##index.php## is included among the values for the ##server.indexfiles## configuration parameter.
The ##server.modules## configuration parameter applies to your overall lighttpd installation. If you're running multiple PHP applications, then adding ##index.php## to the global ##server.indexfiles## value is fine. If not, it could alternatively be set in a hostname-specific value for ##server.indexfiles##.
All of the remaining configuration values are hostname-specific, since they apply only to the hostname that is running Wikka. Here's what the hostname-specific settings should look like:
%%(code)
$HTTP["host"] =~ "wiki\.example\.com" {
server.document-root = "/full/path/to/wiki/root/"
fastcgi.server = ( ".php" =>
( "localhost" =>
( "socket" => "/tmp/wikkawiki.socket",
"max-procs" => 2,
"bin-path" => "/full/path/to/php-cgi",
"bin-environment" =>
( "PHP_FCGI_CHILDREN" => "2",
"PHP_FCGI_MAX_REQUESTS" => "5000"
)
)
)
)
url.rewrite-once = (
"^(/images/.*)$" => "$1",
"^(/css/.*)$" => "$1",
"^(/3rdparty/plugins/freemind/.*)$" => "$1",
"^(/3rdparty/plugins/wikiedit/.*)$" => "$1",
"^(.*)\?(.*)$" => "wikka.php?wakka=$1&$2",
"^(.*)$" => "wikka.php?wakka=$1"
)
}
%%
Of these, the values for the hostname, the document root, the socket file, and the path for the CGI script will need to be customized for your installation. You may also want to tweak the ##"max-procs"## and ##"bin-environment"## values, based on the expect load and the available server resources.
The hostname is specified in the first line, as a regular expression. In the example above, the hostname value is ##"wiki\.example\.com"##, where backslashes are used to indicate literal period characters.
The document root is specified via the ##server.document-root## parameter, and its value should be the full pathname for the directory from which your top-level web pages are to be served. In my case, this is the directory in which Wikka was installed, since I am mapping the hostname directly to my Wiki. If your hostname provides other content in addition to your Wiki, then your ##server.document-root## value will need to point to one of the parent directories of your Wikka installation (i.e., whichever serves as the overall document root for that hostname).
The socket file is a temporary file used for facilitating communication between lighttpd and the Wikka PHP application. The value for the ##"socket"## parameter needs to be a filename that both of these processes have permission to access. If you have a dedicated server for your website, then something in the global ##/tmp## directory (as in the example here) should be fine. If you are using a shared host, however, you should probably create a subdirectory somewhere under your home directory that can contain the socket file, to make sure there is no conflict with other users on the shared host.
Finally, the value of the ##"bin-path"## parameter indicates where the CGI script for PHP resides. This is typically in a directory on the web server that is dedicated to CGI scripts, often named ##cgi-bin##. On my hosting provider's server, for example, that directory is named ##/usr/local/www/cgi-bin/##. The specific script will typically include both ##php## and ##cgi## in its name, and may also indicate a specific version of PHP. There may also be a script that is specifically geared towards ""FastCGI"", in which case the script's name will probably include ##fcgi## rather than just ##cgi##. Potential values include ##php-cgi##, ##php4-cgi##, and ##php5-fcgi##. The value for ##"bin-path"## should be the full path name to the script, so ##/usr/local/www/cgi-bin/php5-fcgi## would be a valid example.
====References====
The [[http://gentoo-wiki.com/ Gentoo Linux Wiki]] has a good [[http://gentoo-wiki.com/HOWTO_Lighttpd overview]] of configuring Lighttpd for PHP applications. Some of the material, such as installation utilities and paths, is specific to Gentoo, but adapting this information to other Unix-based operating systems should be pretty straightforward.
With respect to URL rewriting, the information on this Wiki regarding configuration of Apache's [[ModRewrite mod_rewrite]] module for Wikka was a good reference for understanding the requirements that I needed to match in lighttpd.
----
CategoryDocumentation
Additions:
"^(.*)\?(.*)$" => "wikka.php?wakka=$1&$2",
"^(.*)$" => "wikka.php?wakka=$1"
}
%%
Of these, the values for the hostname, the document root, the socket file, and the path for the CGI script will need to be customized for your installation. You may also want to tweak the ##"max-procs"## and ##"bin-environment"## values, based on the expect load and the available server resources.
The hostname is specified in the first line, as a regular expression. In the example above, the hostname value is ##"wiki\.example\.com"##, where backslashes are used to indicate literal period characters.
The document root is specified via the ##server.document-root## parameter, and its value should be the full pathname for the directory from which your top-level web pages are to be served. In my case, this is the directory in which Wikka was installed, since I am mapping the hostname directly to my Wiki. If your hostname provides other content in addition to your Wiki, then your ##server.document-root## value will need to point to one of the parent directories of your Wikka installation (i.e., whichever serves as the overall document root for that hostname).
The socket file is a temporary file used for facilitating communication between lighttpd and the Wikka PHP application. The value for the ##"socket"## parameter needs to be a filename that both of these processes have permission to access. If you have a dedicated server for your website, then something in the global ##/tmp## directory (as in the example here) should be fine. If you are using a shared host, however, you should probably create a subdirectory somewhere under your home directory that can contain the socket file, to make sure there is no conflict with other users on the shared host.
Finally, the value of the ##"bin-path"## parameter indicates where the CGI script for PHP resides. This is typically in a directory on the web server that is dedicated to CGI scripts, often named ##cgi-bin##. On my hosting provider's server, for example, that directory is named ##/usr/local/www/cgi-bin/##. The specific script will typically include both ##php## and ##cgi## in its name, and may also indicate a specific version of PHP. There may also be a script that is specifically geared towards ""FastCGI"", in which case the script's name will probably include ##fcgi## rather than just ##cgi##. Potential values include ##php-cgi##, ##php4-cgi##, and ##php5-fcgi##. The value for ##"bin-path"## should be the full path name to the script, so ##/usr/local/www/cgi-bin/php5-fcgi## would be a valid example.
====References====
The [[http://gentoo-wiki.com/ Gentoo Linux Wiki]] has a good [[http://gentoo-wiki.com/HOWTO_Lighttpd overview]] of configuring Lighttpd for PHP applications. Some of the material, such as installation utilities and paths, is specific to Gentoo, but adapting this information to other Unix-based operating systems should be pretty straightforward.
With respect to URL rewriting, the information on this Wiki regarding configuration of Apache's [[ModRewrite mod_rewrite]] module for Wikka was a good reference for understanding the requirements that I needed to match in lighttpd.
----
CategoryDocumentation
"^(.*)$" => "wikka.php?wakka=$1"
}
%%
Of these, the values for the hostname, the document root, the socket file, and the path for the CGI script will need to be customized for your installation. You may also want to tweak the ##"max-procs"## and ##"bin-environment"## values, based on the expect load and the available server resources.
The hostname is specified in the first line, as a regular expression. In the example above, the hostname value is ##"wiki\.example\.com"##, where backslashes are used to indicate literal period characters.
The document root is specified via the ##server.document-root## parameter, and its value should be the full pathname for the directory from which your top-level web pages are to be served. In my case, this is the directory in which Wikka was installed, since I am mapping the hostname directly to my Wiki. If your hostname provides other content in addition to your Wiki, then your ##server.document-root## value will need to point to one of the parent directories of your Wikka installation (i.e., whichever serves as the overall document root for that hostname).
The socket file is a temporary file used for facilitating communication between lighttpd and the Wikka PHP application. The value for the ##"socket"## parameter needs to be a filename that both of these processes have permission to access. If you have a dedicated server for your website, then something in the global ##/tmp## directory (as in the example here) should be fine. If you are using a shared host, however, you should probably create a subdirectory somewhere under your home directory that can contain the socket file, to make sure there is no conflict with other users on the shared host.
Finally, the value of the ##"bin-path"## parameter indicates where the CGI script for PHP resides. This is typically in a directory on the web server that is dedicated to CGI scripts, often named ##cgi-bin##. On my hosting provider's server, for example, that directory is named ##/usr/local/www/cgi-bin/##. The specific script will typically include both ##php## and ##cgi## in its name, and may also indicate a specific version of PHP. There may also be a script that is specifically geared towards ""FastCGI"", in which case the script's name will probably include ##fcgi## rather than just ##cgi##. Potential values include ##php-cgi##, ##php4-cgi##, and ##php5-fcgi##. The value for ##"bin-path"## should be the full path name to the script, so ##/usr/local/www/cgi-bin/php5-fcgi## would be a valid example.
====References====
The [[http://gentoo-wiki.com/ Gentoo Linux Wiki]] has a good [[http://gentoo-wiki.com/HOWTO_Lighttpd overview]] of configuring Lighttpd for PHP applications. Some of the material, such as installation utilities and paths, is specific to Gentoo, but adapting this information to other Unix-based operating systems should be pretty straightforward.
With respect to URL rewriting, the information on this Wiki regarding configuration of Apache's [[ModRewrite mod_rewrite]] module for Wikka was a good reference for understanding the requirements that I needed to match in lighttpd.
----
CategoryDocumentation
Deletions:
Additions:
"^(.*)\?(.*)$" => "wikka.php?wakka=$1
Deletions:
"^(.*)$" => "wikka.php?wakka=$1"
}
%%
Of these, the values for the hostname, the document root, the socket file, and the path for the CGI script will need to be customized for your installation. You may also want to tweak the ##"max-procs"## and ##"bin-environment"## values, based on the expect load and the available server resources.
The hostname is specified in the first line, as a regular expression. In the example above, the hostname value is ##"wiki\.example\.com"##, where backslashes are used to indicate literal period characters.
The document root is specified via the ##server.document-root## parameter, and its value should be the full pathname for the directory from which your top-level web pages are to be served. In my case, this is the directory in which Wikka was installed, since I am mapping the hostname directly to my Wiki. If your hostname provides other content in addition to your Wiki, then your ##server.document-root## value will need to point to one of the parent directories of your Wikka installation (i.e., whichever serves as the overall document root for that hostname).
The socket file is a temporary file used for facilitating communication between lighttpd and the Wikka PHP application. The value for the ##"socket"## parameter needs to be a filename that both of these processes have permission to access. If you have a dedicated server for your website, then something in the global ##/tmp## directory (as in the example here) should be fine. If you are using a shared host, however, you should probably create a subdirectory somewhere under your home directory that can contain the socket file, to make sure there is no conflict with other users on the shared host.
Finally, the value of the ##"bin-path"## parameter indicates where the CGI script for PHP resides. This is typically in a directory on the web server that is dedicated to CGI scripts, often named ##cgi-bin##. On my hosting provider's server, for example, that directory is named ##/usr/local/www/cgi-bin/##. The specific script will typically include both ##php## and ##cgi## in its name, and may also indicate a specific version of PHP. There may also be a script that is specifically geared towards ""FastCGI"", in which case the script's name will probably include ##fcgi## rather than just ##cgi##. Potential values include ##php-cgi##, ##php4-cgi##, and ##php5-fcgi##. The value for ##"bin-path"## should be the full path name to the script, so ##/usr/local/www/cgi-bin/php5-fcgi## would be a valid example.
====References====
The [[http://gentoo-wiki.com/ Gentoo Linux Wiki]] has a good [[http://gentoo-wiki.com/HOWTO_Lighttpd overview]] of configuring Lighttpd for PHP applications. Some of the material, such as installation utilities and paths, is specific to Gentoo, but adapting this information to other Unix-based operating systems should be pretty straightforward.
With respect to URL rewriting, the information on this Wiki regarding configuration of Apache's [[ModRewrite mod_rewrite]] module for Wikka was a good reference for understanding the requirements that I needed to match in lighttpd.
----
CategoryDocumentation
Additions:
"^(.*)\?(.*)$" => "wikka.php?wakka=$1&$2",
Deletions:
Additions:
"^(.*)\?show_comments=(.*)$" => "wikka.php?wakka=$1&show_comments=$2",
Additions:
[[WikkaDocumentation Wikka Documentation]]
----
>>==See also:==
~-[[ModRewrite Wikka and mod_rewrite]]
~-[[WikkaInstallation Installing Wikka]]
~-[[WikkaOnMacOSX Installing Wikka on Mac OS X]]
~-[[WikiOnAStick Installing Wikka on a USB stick]]
>>====Introduction====
----
>>==See also:==
~-[[ModRewrite Wikka and mod_rewrite]]
~-[[WikkaInstallation Installing Wikka]]
~-[[WikkaOnMacOSX Installing Wikka on Mac OS X]]
~-[[WikiOnAStick Installing Wikka on a USB stick]]
>>====Introduction====
Deletions:
Additions:
----
CategoryDocumentation
CategoryDocumentation
Deletions:
Additions:
With respect to the ##server.modules## configuration parameter, you will need to include ##mod_fastcgi## for ""FastCGI"" support and, if you want user-friendly URLs, ##mod_rewrite##. You should also make sure the ##index.php## is included among the values for the ##server.indexfiles## configuration parameter.
Finally, the value of the ##"bin-path"## parameter indicates where the CGI script for PHP resides. This is typically in a directory on the web server that is dedicated to CGI scripts, often named ##cgi-bin##. On my hosting provider's server, for example, that directory is named ##/usr/local/www/cgi-bin/##. The specific script will typically include both ##php## and ##cgi## in its name, and may also indicate a specific version of PHP. There may also be a script that is specifically geared towards ""FastCGI"", in which case the script's name will probably include ##fcgi## rather than just ##cgi##. Potential values include ##php-cgi##, ##php4-cgi##, and ##php5-fcgi##. The value for ##"bin-path"## should be the full path name to the script, so ##/usr/local/www/cgi-bin/php5-fcgi## would be a valid example.
Finally, the value of the ##"bin-path"## parameter indicates where the CGI script for PHP resides. This is typically in a directory on the web server that is dedicated to CGI scripts, often named ##cgi-bin##. On my hosting provider's server, for example, that directory is named ##/usr/local/www/cgi-bin/##. The specific script will typically include both ##php## and ##cgi## in its name, and may also indicate a specific version of PHP. There may also be a script that is specifically geared towards ""FastCGI"", in which case the script's name will probably include ##fcgi## rather than just ##cgi##. Potential values include ##php-cgi##, ##php4-cgi##, and ##php5-fcgi##. The value for ##"bin-path"## should be the full path name to the script, so ##/usr/local/www/cgi-bin/php5-fcgi## would be a valid example.
Deletions:
Finally, the value of the ##"bin-path"## parameter indicates where the CGI script for PHP resides. This is typically in a directory on the web server that is dedicated to CGI scripts, often named ##cgi-bin##. On my hosting provider's server, for example, that directory is named ##/usr/local/www/cgi-bin/##. The specific script will typically include both ##php## and ##cgi## in its name, and may also indicate a specific version of PHP. There may also be a script that is specifically geared towards [[http://www.fastcgi.com/ FastCGI]], in which case the script's name will probably include ##fcgi## rather than just ##cgi##. Potential values include ##php-cgi##, ##php4-cgi##, and ##php5-fcgi##. The value for ##"bin-path"## should be the full path name to the script, so ##/usr/local/www/cgi-bin/php5-fcgi## would be a valid example.
Additions:
With respect to the ##server.modules## configuration parameter, you will need to include ##mod_fastcgi## for FastCGI support and, if you want user-friendly URLs, ##mod_rewrite##. You should also make sure the ##index.php## is included among the values for the ##server.indexfiles## configuration parameter.
With respect to URL rewriting, the information on this Wiki regarding configuration of Apache's [[ModRewrite mod_rewrite]] module for Wikka was a good reference for understanding the requirements that I needed to match in lighttpd.
With respect to URL rewriting, the information on this Wiki regarding configuration of Apache's [[ModRewrite mod_rewrite]] module for Wikka was a good reference for understanding the requirements that I needed to match in lighttpd.
Deletions:
With respect to URL rewriting, the information on this Wiki regarding configuration of Apache's [[ModRewrite mod_rewrite]] module for Wikka was a good reference for understanding the requirements that I needed to match in [[http://lighttpd.org/ lighttpd]].
Additions:
Of these, the values for the hostname, the document root, the socket file, and the path for the CGI script will need to be customized for your installation. You may also want to tweak the ##"max-procs"## and ##"bin-environment"## values, based on the expect load and the available server resources.
The hostname is specified in the first line, as a regular expression. In the example above, the hostname value is ##"wiki\.example\.com"##, where backslashes are used to indicate literal period characters.
The document root is specified via the ##server.document-root## parameter, and its value should be the full pathname for the directory from which your top-level web pages are to be served. In my case, this is the directory in which Wikka was installed, since I am mapping the hostname directly to my Wiki. If your hostname provides other content in addition to your Wiki, then your ##server.document-root## value will need to point to one of the parent directories of your Wikka installation (i.e., whichever serves as the overall document root for that hostname).
The socket file is a temporary file used for facilitating communication between lighttpd and the Wikka PHP application. The value for the ##"socket"## parameter needs to be a filename that both of these processes have permission to access. If you have a dedicated server for your website, then something in the global ##/tmp## directory (as in the example here) should be fine. If you are using a shared host, however, you should probably create a subdirectory somewhere under your home directory that can contain the socket file, to make sure there is no conflict with other users on the shared host.
Finally, the value of the ##"bin-path"## parameter indicates where the CGI script for PHP resides. This is typically in a directory on the web server that is dedicated to CGI scripts, often named ##cgi-bin##. On my hosting provider's server, for example, that directory is named ##/usr/local/www/cgi-bin/##. The specific script will typically include both ##php## and ##cgi## in its name, and may also indicate a specific version of PHP. There may also be a script that is specifically geared towards [[http://www.fastcgi.com/ FastCGI]], in which case the script's name will probably include ##fcgi## rather than just ##cgi##. Potential values include ##php-cgi##, ##php4-cgi##, and ##php5-fcgi##. The value for ##"bin-path"## should be the full path name to the script, so ##/usr/local/www/cgi-bin/php5-fcgi## would be a valid example.
With respect to URL rewriting, the information on this Wiki regarding configuration of Apache's [[ModRewrite mod_rewrite]] module for Wikka was a good reference for understanding the requirements that I needed to match in [[http://lighttpd.org/ lighttpd]].
The hostname is specified in the first line, as a regular expression. In the example above, the hostname value is ##"wiki\.example\.com"##, where backslashes are used to indicate literal period characters.
The document root is specified via the ##server.document-root## parameter, and its value should be the full pathname for the directory from which your top-level web pages are to be served. In my case, this is the directory in which Wikka was installed, since I am mapping the hostname directly to my Wiki. If your hostname provides other content in addition to your Wiki, then your ##server.document-root## value will need to point to one of the parent directories of your Wikka installation (i.e., whichever serves as the overall document root for that hostname).
The socket file is a temporary file used for facilitating communication between lighttpd and the Wikka PHP application. The value for the ##"socket"## parameter needs to be a filename that both of these processes have permission to access. If you have a dedicated server for your website, then something in the global ##/tmp## directory (as in the example here) should be fine. If you are using a shared host, however, you should probably create a subdirectory somewhere under your home directory that can contain the socket file, to make sure there is no conflict with other users on the shared host.
Finally, the value of the ##"bin-path"## parameter indicates where the CGI script for PHP resides. This is typically in a directory on the web server that is dedicated to CGI scripts, often named ##cgi-bin##. On my hosting provider's server, for example, that directory is named ##/usr/local/www/cgi-bin/##. The specific script will typically include both ##php## and ##cgi## in its name, and may also indicate a specific version of PHP. There may also be a script that is specifically geared towards [[http://www.fastcgi.com/ FastCGI]], in which case the script's name will probably include ##fcgi## rather than just ##cgi##. Potential values include ##php-cgi##, ##php4-cgi##, and ##php5-fcgi##. The value for ##"bin-path"## should be the full path name to the script, so ##/usr/local/www/cgi-bin/php5-fcgi## would be a valid example.
With respect to URL rewriting, the information on this Wiki regarding configuration of Apache's [[ModRewrite mod_rewrite]] module for Wikka was a good reference for understanding the requirements that I needed to match in [[http://lighttpd.org/ lighttpd]].
Deletions:
Additions:
The ##server.modules## configuration parameter applies to your overall lighttpd installation. If you're running multiple PHP applications, then adding ##index.php## to the global ##server.indexfiles## value is fine. If not, it could alternatively be set in a hostname-specific value for ##server.indexfiles##.
All of the remaining configuration values are hostname-specific, since they apply only to the hostname that is running Wikka. Here's what the hostname-specific settings should look like:
All of the remaining configuration values are hostname-specific, since they apply only to the hostname that is running Wikka. Here's what the hostname-specific settings should look like:
Additions:
( "localhost" =>
( "socket" => "/tmp/wikkawiki.socket",
"max-procs" => 2,
"bin-path" => "/full/path/to/php-cgi",
"bin-environment" =>
( "PHP_FCGI_CHILDREN" => "2",
"PHP_FCGI_MAX_REQUESTS" => "5000"
)
)
)
)
"^(/images/.*)$" => "$1",
"^(/css/.*)$" => "$1",
"^(/3rdparty/plugins/freemind/.*)$" => "$1",
"^(/3rdparty/plugins/wikiedit/.*)$" => "$1",
"^(.*)$" => "wikka.php?wakka=$1"
)
( "socket" => "/tmp/wikkawiki.socket",
"max-procs" => 2,
"bin-path" => "/full/path/to/php-cgi",
"bin-environment" =>
( "PHP_FCGI_CHILDREN" => "2",
"PHP_FCGI_MAX_REQUESTS" => "5000"
)
)
)
)
"^(/images/.*)$" => "$1",
"^(/css/.*)$" => "$1",
"^(/3rdparty/plugins/freemind/.*)$" => "$1",
"^(/3rdparty/plugins/wikiedit/.*)$" => "$1",
"^(.*)$" => "wikka.php?wakka=$1"
)
Deletions:
( "socket" => "/tmp/wikkawiki.socket",
"max-procs" => 2,
"bin-path" => "/full/path/to/php-cgi",
"bin-environment" =>
( "PHP_FCGI_CHILDREN" => "2",
"PHP_FCGI_MAX_REQUESTS" => "5000"
)
)
)
)
"^(/images/.*)$" => "$1",
"^(/css/.*)$" => "$1",
"^(/3rdparty/plugins/freemind/.*)$" => "$1",
"^(/3rdparty/plugins/wikiedit/.*)$" => "$1",
"^(.*)$" => "wikka.php?wakka=$1"
)
Additions:
server.document-root = "/full/path/to/wiki/root/"
"bin-path" => "/full/path/to/php-cgi",
"bin-path" => "/full/path/to/php-cgi",
Deletions:
"bin-path" => //"/full/path/to/php-cgi"//,
Additions:
server.document-root = //"/full/path/to/document/root/"//
( "socket" => "/tmp/wikkawiki.socket",
"bin-path" => //"/full/path/to/php-cgi"//,
( "socket" => "/tmp/wikkawiki.socket",
"bin-path" => //"/full/path/to/php-cgi"//,
Deletions:
This is just a placeholder for now. I'll finish this up soon.
server.document-root = base + "/web/wiki/"
( "socket" => base + "/tmp/wikkawiki.socket",
"bin-path" => "/usr/local/www/cgi-bin/php5-fcgi",
Additions:
For my particular installation, I wanted to serve Wiki content out of the document root for a dedicated subdomain. So rather than have my Wiki reside at, say, http://www.example.com/wiki, I wanted it at http://wiki.example.com/. I also wanted it to use user-friendly URLs, like http://wiki.example.com/HomePage, rather than the out-of-the-box query-string URLs, such as http://wiki.example.com/wikka.php?wakka=HomePage. Finally, to get the best performance out of the combination of lighttpd and PHP, I chose to interface them using [[http://www.fastcgi.com/ FastCGI]].
fastcgi.server = ( ".php" =>
( "localhost" =>
( "socket" => base + "/tmp/wikkawiki.socket",
"max-procs" => 2,
"bin-path" => "/usr/local/www/cgi-bin/php5-fcgi",
"bin-environment" =>
( "PHP_FCGI_CHILDREN" => "2",
"PHP_FCGI_MAX_REQUESTS" => "5000"
)
)
)
)
url.rewrite-once = (
"^(/images/.*)$" => "$1",
"^(/css/.*)$" => "$1",
"^(/3rdparty/plugins/freemind/.*)$" => "$1",
"^(/3rdparty/plugins/wikiedit/.*)$" => "$1",
"^(.*)$" => "wikka.php?wakka=$1"
)
====References====
The [[http://gentoo-wiki.com/ Gentoo Linux Wiki]] has a good [[http://gentoo-wiki.com/HOWTO_Lighttpd overview]] of configuring Lighttpd for PHP applications. Some of the material, such as installation utilities and paths, is specific to Gentoo, but adapting this information to other Unix-based operating systems should be pretty straightforward.
With respect to URL rewriting, the information on this Wiki regarding configuration of Apache's [[ModRewrite mod_rewrite]] module for Wikka was a good reference for understanding the requirements that I needed to match in lighttpd.
fastcgi.server = ( ".php" =>
( "localhost" =>
( "socket" => base + "/tmp/wikkawiki.socket",
"max-procs" => 2,
"bin-path" => "/usr/local/www/cgi-bin/php5-fcgi",
"bin-environment" =>
( "PHP_FCGI_CHILDREN" => "2",
"PHP_FCGI_MAX_REQUESTS" => "5000"
)
)
)
)
url.rewrite-once = (
"^(/images/.*)$" => "$1",
"^(/css/.*)$" => "$1",
"^(/3rdparty/plugins/freemind/.*)$" => "$1",
"^(/3rdparty/plugins/wikiedit/.*)$" => "$1",
"^(.*)$" => "wikka.php?wakka=$1"
)
====References====
The [[http://gentoo-wiki.com/ Gentoo Linux Wiki]] has a good [[http://gentoo-wiki.com/HOWTO_Lighttpd overview]] of configuring Lighttpd for PHP applications. Some of the material, such as installation utilities and paths, is specific to Gentoo, but adapting this information to other Unix-based operating systems should be pretty straightforward.
With respect to URL rewriting, the information on this Wiki regarding configuration of Apache's [[ModRewrite mod_rewrite]] module for Wikka was a good reference for understanding the requirements that I needed to match in lighttpd.
Deletions:
fastcgi.server = ( ".php" =>
( "localhost" =>
( "socket" => base + "/tmp/wikkawiki.socket",
"max-procs" => 2,
"bin-path" => "/usr/local/www/cgi-bin/php5-fcgi",
"bin-environment" =>
( "PHP_FCGI_CHILDREN" => "2",
"PHP_FCGI_MAX_REQUESTS" => "5000"
)
)
)
)
url.rewrite-once = (
"^(/images/.*)$" => "$1",
"^(/css/.*)$" => "$1",
"^(/3rdparty/plugins/freemind/.*)$" => "$1",
"^(/3rdparty/plugins/wikiedit/.*)$" => "$1",
"^(.*)$" => "wikka.php?wakka=$1"
)
Additions:
====Lighttpd Configuration====
With respect to the ##server.modules## configuration parameter, you will need to include ##mod_fastcgi## for [[http://www.fastcgi.com/ FastCGI]] support and, if you want user-friendly URLs, ##mod_rewrite##. You should also make sure the ##index.php## is included among the values for the ##server.indexfiles## configuration parameter.
$HTTP["host"] =~ "wiki\.example\.com" {
server.document-root = base + "/web/wiki/"
fastcgi.server = ( ".php" =>
( "localhost" =>
( "socket" => base + "/tmp/wikkawiki.socket",
"max-procs" => 2,
"bin-path" => "/usr/local/www/cgi-bin/php5-fcgi",
"bin-environment" =>
( "PHP_FCGI_CHILDREN" => "2",
"PHP_FCGI_MAX_REQUESTS" => "5000"
)
)
)
)
url.rewrite-once = (
"^(/images/.*)$" => "$1",
"^(/css/.*)$" => "$1",
"^(/3rdparty/plugins/freemind/.*)$" => "$1",
"^(/3rdparty/plugins/wikiedit/.*)$" => "$1",
"^(.*)$" => "wikka.php?wakka=$1"
)
With respect to the ##server.modules## configuration parameter, you will need to include ##mod_fastcgi## for [[http://www.fastcgi.com/ FastCGI]] support and, if you want user-friendly URLs, ##mod_rewrite##. You should also make sure the ##index.php## is included among the values for the ##server.indexfiles## configuration parameter.
$HTTP["host"] =~ "wiki\.example\.com" {
server.document-root = base + "/web/wiki/"
fastcgi.server = ( ".php" =>
( "localhost" =>
( "socket" => base + "/tmp/wikkawiki.socket",
"max-procs" => 2,
"bin-path" => "/usr/local/www/cgi-bin/php5-fcgi",
"bin-environment" =>
( "PHP_FCGI_CHILDREN" => "2",
"PHP_FCGI_MAX_REQUESTS" => "5000"
)
)
)
)
url.rewrite-once = (
"^(/images/.*)$" => "$1",
"^(/css/.*)$" => "$1",
"^(/3rdparty/plugins/freemind/.*)$" => "$1",
"^(/3rdparty/plugins/wikiedit/.*)$" => "$1",
"^(.*)$" => "wikka.php?wakka=$1"
)
Deletions:
Line 2
Line 3 {
Line 4
}
Additions:
To that end, I unpacked the Wikka distribution into the directory I had selected for my subdomain's document root, and then set about editing my ##lighttpd.conf## configuration file.
Deletions:
Additions:
For my particular installation, I wanted to serve Wiki content out of the document root for a dedicated subdomain. So rather than have my Wiki reside at, say, http://www.example.com/wiki, I wanted it at http://wiki.example.com/. I also wanted it to use user-friendly URLs, like http://wiki.example.com/HomePage, rather than the out-of-the-box query-string URLs, such as http://wiki.example.com/wikka.php?wakka=HomePage. Finally, to get the best performance out of the combination of lighttpd and PHP, I chose to interface them using [[http://www.fastcgi.com/ FastCGI]].
Deletions:
Additions:
====Server Configuration====
For my particular installation, I wanted to serve Wiki content out of the document root for a dedicated subdomain. So rather than have my Wiki reside at, say, http://www.example.com/wiki, I wanted it at http://wiki.example.com/. I also wanted it to use user-friendly URLs, like http://wiki.example.com/HomePage, rather than the out-of-the-box query-string URLs, such as http://wiki.example.com/wikka.php?wakka=HomePage.
To that end, I unpacked the Wikka distribution into the directory I had selected for my subdomain's document root, and then set about configuring lighttpd.
For my particular installation, I wanted to serve Wiki content out of the document root for a dedicated subdomain. So rather than have my Wiki reside at, say, http://www.example.com/wiki, I wanted it at http://wiki.example.com/. I also wanted it to use user-friendly URLs, like http://wiki.example.com/HomePage, rather than the out-of-the-box query-string URLs, such as http://wiki.example.com/wikka.php?wakka=HomePage.
To that end, I unpacked the Wikka distribution into the directory I had selected for my subdomain's document root, and then set about configuring lighttpd.
Additions:
%%(code)
Code sample {
Line 2
Line 3 {
Line 4
}
}
%%
Code sample {
Line 2
Line 3 {
Line 4
}
}
%%
Additions:
Before I get started, though, I need to acknowledge JavaWoman and LadySerena from [[WikkaOnIrc #wikka]], both for their assistance in getting the URL rewriting working, and for encouraging me to record the results.