Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:handbook:webserver [2010/07/08 15:14] – external edit 127.0.0.1 | en:handbook:webserver [2012/12/24 16:52] (current) – [CGI scripts using Python] trixar_za | ||
|---|---|---|---|
| Line 35: | Line 35: | ||
| < | < | ||
| - | # geany / | + | # geany / |
| + | |||
| + | < | ||
| # CGI module. You can install Perl and assign .pl and .cgi scripts | # CGI module. You can install Perl and assign .pl and .cgi scripts | ||
| # to / | # to / | ||
| Line 42: | Line 44: | ||
| cgi.assign = ( | cgi.assign = ( | ||
| " | " | ||
| - | " | + | " |
| - | " | + | " |
| ) | ) | ||
| } | } | ||
| - | </code> | + | </file> |
| ===== CGI scripts using Python ===== | ===== CGI scripts using Python ===== | ||
| Line 55: | Line 57: | ||
| # tazpkg get-install python | # tazpkg get-install python | ||
| # geany / | # geany / | ||
| + | </ | ||
| + | < | ||
| # CGI module. You can install Python and assign .py and .cgi scripts | # CGI module. You can install Python and assign .py and .cgi scripts | ||
| # to / | # to / | ||
| Line 61: | Line 65: | ||
| cgi.assign = ( | cgi.assign = ( | ||
| " | " | ||
| - | " | + | " |
| - | " | + | " |
| ) | ) | ||
| } | } | ||
| - | </code> | + | </file> |
| For the changes to be taken into effect and to use your first CGI scripts on SliTaz, just restart the LightTPD server: | For the changes to be taken into effect and to use your first CGI scripts on SliTaz, just restart the LightTPD server: | ||
| Line 75: | Line 79: | ||
| LightTPD provides authentication modules that can for example, protect a directory. The server offers several authentication methods, but we will begin by using the basic method without encrypting any passwords. In order to be able to use the module mod_auth, you must install the lighttpd-modules package (tazpkg get-install lighttpd-modules). Once installed mod_auth must be added to the list of modules: | LightTPD provides authentication modules that can for example, protect a directory. The server offers several authentication methods, but we will begin by using the basic method without encrypting any passwords. In order to be able to use the module mod_auth, you must install the lighttpd-modules package (tazpkg get-install lighttpd-modules). Once installed mod_auth must be added to the list of modules: | ||
| - | <code> | + | <file> |
| # Modules to load. | # Modules to load. | ||
| # See / | # See / | ||
| Line 84: | Line 88: | ||
| " | " | ||
| ) | ) | ||
| - | </code> | + | </file> |
| - | Now you can configure the modules by specifying the debug level and method (plain) and the path to the file containing a list of names using a protected password to access the directories. You must also define the directories that require authorization. In this example we'll protect the admin/ directory and authorize its access to user hacker | + | Now you can configure the modules by specifying the debug level and method (plain) and the path to the file containing a list of names using a protected password to access the directories. You must also define the directories that require authorization. In this example we'll protect the admin/ directory and authorize its access to user tux (//user=tux//): |
| - | <code> | + | <file> |
| # Authentication for protected directory. | # Authentication for protected directory. | ||
| auth.debug = 2 | auth.debug = 2 | ||
| Line 97: | Line 101: | ||
| " | " | ||
| " | " | ||
| - | " | + | " |
| ) | ) | ||
| ) | ) | ||
| - | </code> | + | </file> |
| - | Finally, we now create the file containing the passwords, add a user and restart the server for testing. The basic syntax for the file is user: | + | Finally, we now create the file containing the passwords, add a user and restart the server for testing. The basic syntax for the file is user: |
| < | < | ||
| - | # echo "hacker:root" > / | + | # echo "tux:root" > / |
| Or : | Or : | ||
| # nano / | # nano / | ||