website rev 39

Add LightTPD to Handbook (en) & typos
author Paul Issott <paul@slitaz.org>
date Wed May 04 21:16:27 2011 +0000 (2011-05-04)
parents b0f82bed4355
children 8c689138f7fd
files en/doc/handbook/hacking-livecd.html en/doc/handbook/index.html en/doc/handbook/web-server.html en/doc/handbook/x-window.html
line diff
     1.1 --- a/en/doc/handbook/hacking-livecd.html	Fri May 02 23:14:11 2008 +0000
     1.2 +++ b/en/doc/handbook/hacking-livecd.html	Wed May 04 21:16:27 2011 +0000
     1.3 @@ -18,6 +18,7 @@
     1.4  <div id="header">
     1.5  <div id="quicknav" align="right">
     1.6      <a name="top"></a>
     1.7 +    <a href="web-server.html">Web server</a> |
     1.8      <a href="index.html">Table of contents</a>
     1.9  </div>
    1.10  <h1><font color="#3e1220">SliTaz Handbook (en)</font></h1>
    1.11 @@ -44,7 +45,7 @@
    1.12  <p>
    1.13  <em>Hacking SliTaz LiveCD</em> or how to have fun with the LiveCD ISO image. Note that you can also
    1.14  <a href="gen-livecd.html">create a custom flavor with Tazlito</a>.
    1.15 -Creating your own bootable ISO image is easily acheivable and the steps are carefully described here. The manipulation of a personal ISO image can add new files or modify existing
    1.16 +Creating your own bootable ISO image is easily achievable and the steps are carefully described here. The manipulation of a personal ISO image can add new files or modify existing
    1.17  ones found on the Slitaz Live CD. The Slitaz ISO image  is less than 30 MB and a CD-R or CD-RW provides around 700 MB,
    1.18  so there's plenty of scope for expansion. For example, you could store your images and even provide a <em>live</em> slideshow 
    1.19  using GQview. The <em>hacking</em> of the ISO image allows you to modify boot loader configuration files 
     2.1 --- a/en/doc/handbook/index.html	Fri May 02 23:14:11 2008 +0000
     2.2 +++ b/en/doc/handbook/index.html	Wed May 04 21:16:27 2011 +0000
     2.3 @@ -49,6 +49,7 @@
     2.4  	using TazUSB.</li>
     2.5  	<li><a href="hacking-livecd.html">Hacking LiveCD</a> - Manipulate and play with the ISO
     2.6  	image of LiveCD.</li>
     2.7 +	<li><a href="web-server.html">Web server</a> - Configure and use the LightTPD web server.</li>
     2.8  </ul>
     2.9  
    2.10  <h3>About this Handbook</h3>
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/en/doc/handbook/web-server.html	Wed May 04 21:16:27 2011 +0000
     3.3 @@ -0,0 +1,215 @@
     3.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     3.5 +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><title>SliTaz Handbook (en) - Template</title>
     3.6 +
     3.7 +
     3.8 +    
     3.9 +    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
    3.10 +    <meta name="description" content="slitaz English handbook" />
    3.11 +    <meta name="expires" content="never" />
    3.12 +    <meta name="modified" content="2008-02-26 18:30:00" />
    3.13 +    <meta name="publisher" content="www.slitaz.org" />
    3.14 +    <meta name="author" content="Christophe Lincoln" />
    3.15 +    <link rel="shortcut icon" href="favicon.ico" />
    3.16 +    <link rel="stylesheet" type="text/css" href="book.css" /></head><body bgcolor="#ffffff">
    3.17 +
    3.18 +<!-- Header and quick navigation -->
    3.19 +<div id="header">
    3.20 +<div id="quicknav" align="right">
    3.21 +    <a name="top"></a>
    3.22 +    <a href="index.html">Table of contents</a>
    3.23 +</div>
    3.24 +<h1><font color="#3e1220">SliTaz Handbook (en)</font></h1>
    3.25 +</div>
    3.26 +
    3.27 +<!-- Content. -->
    3.28 +<div id="content">
    3.29 +<div class="content-right"></div>
    3.30 +
    3.31 +<h2><font color="#df8f06">LightTPD Web Server</font></h2>
    3.32 +
    3.33 +<ul>
    3.34 +	<li><a href="#about">About LightTPD.</a></li>
    3.35 +	<li><a href="#var-www">/var/www</a> - Root directory of documents.</li>
    3.36 +	<li><a href="#Public">~/Public</a> - Public directory of users.</li>
    3.37 +	<li><a href="#config">lighttpd.conf</a> - LightTPD Configuration File.</li>
    3.38 +	<li><a href="#start-stop-restart">Start, stop, restart the server.</a></li>
    3.39 +	<li><a href="#cgi-perl">Scripts CGI and Perl</a> - CGI scripts using Perl.</li>
    3.40 +	<li><a href="#cgi-python">Scripts CGI and Python</a> - CGI scripts using Python.</li>
    3.41 +	<li><a href="#auth">Authentication</a> - Protect directories using username and password.</li>
    3.42 +</ul>
    3.43 +
    3.44 +<a name="about"></a>
    3.45 +<h3>About LightTPD</h3>
    3.46 +<p>
    3.47 +This chapter describes the configuration and use of the LightTPD web server. It's a fast, secure, flexible HTTP 
    3.48 +server, using a small memory footprint. It enables intelligent management of the cpu load and offers
    3.49 +FastCGI support, CGI, Auth, Output compression and the rewriting of URLs etc. LightTPD is a cheap way to host your 
    3.50 +own site on an old machine.
    3.51 +</p>
    3.52 +<p>
    3.53 +On SliTaz the server is automatically launched at system startup and is preconfigured with PHP. The root
    3.54 +of the documents served by the default server are in <code>/var/www</code> and contain a page <code>index.html</code>,
    3.55 +displayed by default, images are stored in the <code>images/</code> directory.
    3.56 +LightTPD website: <a href="http://www.lighttpd.net/">http://www.lighttpd.net/</a>
    3.57 +</p>
    3.58 +<a name="var-www"></a>
    3.59 +<h3>/var/www - Root directory of documents</h3>
    3.60 +<p>
    3.61 +The directory /var/www is the root directory of documents by default. You can access this via the URL
    3.62 +<a href="http://localhost/">http://localhost/</a>. If you want to host a site, you can save all your documents
    3.63 +in here. If you want to host multiple sites, you'll need to create virtual hosts. Note you can also check the 
    3.64 +<a href="http://localhost/server-status">http://localhost/server-status</a>. 
    3.65 +
    3.66 +</p>
    3.67 +<a name="Public"></a>
    3.68 +<h3>~/Public - Public directory of users</h3>
    3.69 +<p>
    3.70 +SliTaz offers the users of the system a public space to place documents, HTML in general. 
    3.71 +This directory is named Public and must be within the root of your user space, such as /home/hacker/Public.
    3.72 +To create this directory use the mkdir command:
    3.73 +</p>
    3.74 +<pre> $ mkdir ~/Public
    3.75 +</pre>
    3.76 +<p>
    3.77 +You can then have access via the URL: 
    3.78 +<a href="http://localhost/%7Ehacker/">http://localhost/~hacker/</a>. You can also use the machine name or IP 
    3.79 +address if you connect from another computer.
    3.80 +</p>
    3.81 +<a name="config"></a>
    3.82 +<h3>/etc/lighttpd/lighttpd.conf - LightTPD configuration file</h3>
    3.83 +<p>
    3.84 +The main configuration file for LightTPD (<code>lighttpd.conf</code>) is located in /etc/lighttpd/. This file provided by 
    3.85 +SliTaz is self-explanatory, just browse. You can find other examples on the LightTPD website. On
    3.86 +SliTaz you'll also find a <code>vhosts.conf</code> file for the configuration of any virtual hosts (hosting 
    3.87 +several sites on the same server).
    3.88 +</p>
    3.89 +<a name="start-stop-restart"></a>
    3.90 +<h3>Start, stop, restart the web server</h3>
    3.91 +<p>
    3.92 +By default, SliTaz starts the server automatically at boot, to prevent this you need to remove
    3.93 +<code>lighttpd</code> from the variable RUN_DAEMONS located in the system file
    3.94 +<code>/etc/rcS.conf</code>. To start, stop, restart the server; you can use the commands:
    3.95 +<code>/etc/init.d/lighttpd [start|stop|restart]</code>. Example to restart the server after
    3.96 +changing the configuration file:
    3.97 +</p>
    3.98 +<pre> # /etc/init.d/lighttpd restart
    3.99 +</pre>
   3.100 +
   3.101 +<a name="cgi-perl"></a>
   3.102 +<h3>CGI scripts using Perl</h3>
   3.103 +<p>
   3.104 +To configure the LightTPD server to locate the path of the <code>perl</code> binary and use CGI/Perl, you'll need to
   3.105 +install perl and modify the server configuration file. Example using Geany:
   3.106 +</p>
   3.107 +<pre> # tazpkg get-install perl
   3.108 + # geany /etc/lighttpd/lighttpd.conf &amp;
   3.109 +</pre>
   3.110 +<pre class="script"># CGI module. You can install Perl and assign .pl and .cgi scripts
   3.111 +# to /usr/bin/perl
   3.112 +$HTTP["url"] =~ "/cgi-bin/" {
   3.113 +  cgi.assign = (
   3.114 +    ".sh" =&gt; "/bin/sh",
   3.115 +    ".cgi" =&gt; "/usr/bin/perl,
   3.116 +    ".pl" =&gt; "/usr/bin/perl
   3.117 +  )
   3.118 +}
   3.119 +</pre>
   3.120 +
   3.121 +<a name="cgi-python"></a>
   3.122 +<h3>CGI scripts using Python</h3>
   3.123 +<p>
   3.124 +To configure the LightTPD server to locate the path of the <code>python</code> binary and use CGI/Python, you'll need to
   3.125 +to install python and modify the server configuration file. Example using Geany:
   3.126 +</p>
   3.127 +<pre> # tazpkg get-install python
   3.128 + # geany /etc/lighttpd/lighttpd.conf &amp;
   3.129 +</pre>
   3.130 +<pre class="script"># CGI module. You can install Python and assign .py and .cgi scripts
   3.131 +# to /usr/bin/python
   3.132 +$HTTP["url"] =~ "/cgi-bin/" {
   3.133 +  cgi.assign = (
   3.134 +    ".sh" =&gt; "/bin/sh",
   3.135 +    ".cgi" =&gt; "/usr/bin/python,
   3.136 +    ".py" =&gt; "/usr/bin/python
   3.137 +  )
   3.138 +}
   3.139 +</pre>
   3.140 +<p>
   3.141 +For the changes to be taken into effect and to use your first CGI scripts on SliTaz, just
   3.142 +restart the LightTPD server:
   3.143 +</p>
   3.144 +<pre> # /etc/init.d/lighttpd restart
   3.145 +</pre>
   3.146 +
   3.147 +<a name="auth"></a>
   3.148 +<h3>Authentication - Protection for the directories</h3>
   3.149 +<p>
   3.150 +LightTPD provides authentication modules that can for example, protect a directory. The server 
   3.151 +offers several authentication methods, but we will begin by using the basic method without encrypting any
   3.152 +passwords. In order to be able to use the module <code>mod_auth</code>, you must install the lighttpd-modules
   3.153 +package (<code>tazpkg get-install lighttpd-modules</code>), once installed <code>mod_auth</code>
   3.154 +must be added to the list of modules:
   3.155 +</p>
   3.156 +<pre class="script"># Modules to load.
   3.157 +# See /usr/lib/lighttpd for all available modules.
   3.158 +#
   3.159 +server.modules = (
   3.160 +  "mod_access",
   3.161 +  "mod_auth",
   3.162 +  "...",
   3.163 +)
   3.164 +</pre>
   3.165 +<p>
   3.166 +Now you can configure the modules by specifying the debug level and method (<code>plain</code>) and the
   3.167 +path to the file containing a list of names using a protected password to access the directories. You must also 
   3.168 +define the directories that require authorization. In this example we'll protect the <code>admin/</code> directory
   3.169 +and authorise it's access to user hacker (<code>user=hacker</code>):
   3.170 +</p>
   3.171 +<pre class="script"># Authentification for protected directory.
   3.172 +auth.debug = 2
   3.173 +auth.backend = "plain"
   3.174 +auth.backend.plain.userfile = "/etc/lighttpd/plain.passwd"
   3.175 +auth.require = ( "/admin/" =&gt;
   3.176 +(
   3.177 +"method" =&gt; "basic",
   3.178 +"realm" =&gt; "Password protected area",
   3.179 +"require" =&gt; "user=hacker"
   3.180 +)
   3.181 +)
   3.182 +</pre>
   3.183 +<p>
   3.184 +Finally, we now create the file containing the passwords, add a user and restart the server for testing.
   3.185 +The basic syntax for the file is <code>user:password</code>. You can create the file and add a user with the 
   3.186 +<code>echo</code> command or edit with your favorite text editor. To add <code>hacker:root</code>
   3.187 +to the password file <code>/etc/lighttpd/plain.passwd</code>:
   3.188 +</p>
   3.189 +<pre> # echo "hacker:root" &gt; /etc/lighttpd/plain.passwd
   3.190 + Or :
   3.191 + # nano /etc/lighttpd/plain.passwd
   3.192 +</pre>
   3.193 +<p>
   3.194 +To test the address: http://localhost/admin/, just restart the server:
   3.195 +</p>
   3.196 +<pre> # /etc/init.d/lighttpd restart
   3.197 +</pre>
   3.198 +
   3.199 +<!-- End of content -->
   3.200 +</div>
   3.201 +
   3.202 +<!-- Footer. -->
   3.203 +<div id="footer">
   3.204 +	<div class="footer-right"></div>
   3.205 +	<a href="#top">Top of the page</a> | 
   3.206 +	<a href="http://www.slitaz.org/en/doc/handbook/index.html">Table of contents</a>
   3.207 +</div>
   3.208 +
   3.209 +<div id="copy">
   3.210 +    Copyright © 2008 <a href="http://www.slitaz.org/en/">SliTaz</a> -
   3.211 +    <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br />
   3.212 +    Documentation is under
   3.213 +    <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>
   3.214 +    and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>.
   3.215 +</div>
   3.216 +
   3.217 +</body></html>
   3.218 +
     4.1 --- a/en/doc/handbook/x-window.html	Fri May 02 23:14:11 2008 +0000
     4.2 +++ b/en/doc/handbook/x-window.html	Wed May 04 21:16:27 2011 +0000
     4.3 @@ -9,15 +9,15 @@
     4.4      <meta name="modified" content="2008-03-01 22:30:00" />
     4.5      <meta name="publisher" content="www.slitaz.org" />
     4.6      <meta name="author" content="Christophe Lincoln, Paul Issot" />
     4.7 -    <link rel="shortcut icon" href="http://www.slitaz.org/en/doc/handbook/favicon.ico" />
     4.8 +    <link rel="shortcut icon" href="favicon.ico" />
     4.9      <link rel="stylesheet" type="text/css" href="book.css" /></head><body bgcolor="#ffffff">
    4.10  
    4.11  <!-- Header and quick navigation -->
    4.12  <div id="header">
    4.13  <div id="quicknav" align="right">
    4.14      <a name="top"></a>
    4.15 -    <a href="http://www.slitaz.org/en/doc/handbook/gen-livecd.html">Generate a LiveCD flavor</a> |
    4.16 -    <a href="http://www.slitaz.org/en/doc/handbook/index.html">Table of contents</a>
    4.17 +    <a href="gen-livecd.html">Generate a LiveCD flavor</a> |
    4.18 +    <a href="index.html">Table of contents</a>
    4.19  </div>
    4.20  <h1><font color="#3e1220">SliTaz Handbook (en)</font></h1>
    4.21  </div>