2004.04_Wikis-Discover How to Build Wikis with Moinmoin.pdf
(
3831 KB
)
Pobierz
Layout 1
KNOW HOW
MoinMoin Wiki
Creative Group Writing
The members of a project team can
profit from collecting their ideas, or
any loose ends, in a central repository.
Wikis are tailor-made for this task.
BY HEIKE JURZIK
ment systems started to
appear for website manage-
ment, Wikis provided a kind of “open
door” to HTML pages, allowing any visi-
tor to click and edit the HTML content.
Wiki is the abbreviation for WikiWiki-
Web – “wiki wiki” is derived from
Hawaiian and means “quick” or
“quickly”. And the open authoring sys-
tem certainly is quick. The MoinMoin
Wiki engine is one of the better-known
implementations of this technology.
Users can click to launch the embed-
ded editor and access the content and
structure of the page they want to mod-
ify. Typically, an
Edit
link is provided to
make things easier.
In contrast to “real” HTML, which
uses format tags, wikis have a special
syntax that needs only a few simple for-
matting commands.
The wiki web page version control sys-
tems ensure that older versions can be
restored at any time, should a page be
deleted or damaged by mistake. Also,
wikis allow you to assign special access
controls that can restrict editing to regis-
tered users, if required.
The first wiki website was published
by Ward Cunningham in 1995, and it is
still online [1]. At the time, Cunningham
wrote an email message saying that he
had programmed a new kind of database
“I’ve put up a new database on my web
server(…). It’s a web of people, projects
and patterns accessed through a
cgi
-bin
script.” [2].
This meant opening up his HTML
pages to the general public. The foot of
each wiki page contains a link that takes
users to the editor where they can add
to, or modify, pages. Fortunately, there is
no need to write HTML code to do so.
Cunningham wanted to make things eas-
ier for the authors and so chose a
simpler syntax.
The Wiki engine stores the content
input either as ASCII text, or externally
using a relational database such as
MySQL, Oracle, or PostgreSQL. The soft-
ware then uses this data to create the
public HTML pages.
Besides taking a look at the original
wiki, you might like to visit what is cur-
rently the biggest wiki on the Web, the
Wikipedia [3], which offers innumerable
articles on pages in multiple languages.
It is an example of how well information
can be organized with a wiki.
If you are thinking of running a wiki
yourself, you will be spoilt for choice of
software – there are over 100 different
wiki engines [4], most of which are
Open Source. In this article we will be
looking at the MoinMoin engine, and
introducing its syntax.
GLOSSARY
CGI
:CGI is the abbreviation for
C
ommon
G
ateway
I
nterface. It provides an interface
between external programs, or scripts, and
the web server. While HTML pages are static,
CGIs allow for content generation at runtime.
Programs in the web server’s “cgi-bin” direc-
tory are run automatically by the server
when requested by a browser. For example,
CGI scripts process the input from forms on
HTML pages.
Pre-Flight Check
Before we launch into the wiki installa-
tion, let’s first ensure that a few other
services are running on your machine.
These include Apache [5], for example.
Most current distributions include pack-
ages with versions 1 and 2 of the web
server. You will not normally need to
52
April 2004
www.linux-magazine.com
Building wikis with MoinMoin Wiki
W
ay before content manage-
MoinMoin Wiki
KNOW HOW
Figure 1: Good morning – MoinMoin shortly after take off.
Figure 2: Using MoinMoin as a template.
compile the sources manually. Moin-
Moin [6] is a Wiki based on the Python
[7] scripting language. Make sure that
Python is installed on your machine, by
typing
python -V
, and if not, install the
Python packages from your distribu-
tion’s installation CDs.
huhnix:/moin-1.1 #
egrep "^User
U
|^Group" /etc/httpd/httpd.conf
User wwwrun
Group nogroup
ScriptAlias /mywiki "/usr/local
U
/share/moin/mywiki/moin.cgi"
You only need the first line once in the
configuration file; the second line is
required for each wiki instance on the
server – make sure you change the name
and path. Avoid calling your wiki
wiki
if
you can, as this can cause name conflicts
with internal software components.
Finally, re-launch the web server
(
/etc/init.d/apache2 restart
for Apache 2,
/etc/init.d/apache restart
for Apache 1,
and
/etc/init.d/httpd restart
for Red Hat
Linux). If you then access the URL
http://localhost/mywiki/
with your brow-
ser, you should see the wiki welcome
page (see Figure 1).
Red Hat Linux users will need to parse
/etc/httpd/conf/httpd.conf
instead, and
Debian Linux uses
/etc/apache/httpd.
conf
.
Now change to the
moin
directory (
cd
/usr/share/moin/
or
cd /usr/local/share/
moin/
) to create a new Wiki instance:
MoinMoin Sources
The MoinMoin sources can be down-
loaded from the project homepage. Type
tar xzvf moin-1.1.tar.gz
to unpack the
archive, then change to the new direc-
tory created by this process (
cd
moin-1.1
) and assume
root
privileges.
Python can help you install the software.
The command is as follows:
mkdir mywiki
cp -r data mywiki
cp cgi-bin/* mywiki
chown -R wwwrun.nogroup mywiki
chmod a+rx mywiki/*.cgi
huhnix:/moin-1.1 #
python setup
U
.py install --record=install.log
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/MoinMoin
[...]
Debian users will need to change the IDs
in the
chown
line to
www-data.www-
data
, and Red Hat Linux users to
apache.
apache
. The two entries then
need to be added to the
Apache configuration file (this
is
/etc/httpd/httpd.conf
for
Apache 1 and
/etc/apache2/
httpd.conf
for Apache 2 on
Suse Linux,
/etc/apache/httpd.
conf
for Debian, and
/etc/
httpd/conf/httpd.conf
for Red
Hat Linux):
Sandbox
When you are trying out your new wiki,
it makes sense to take your first steps in
Table 1: MoinMoin Syntax
Wiki Syntax
HTML Syntax
Displays as
"italics"
<em>italics</em>
italics
"'bold'"
<b>bold</b>
bold
##comment
<!-->comment<-->
not displayed as output
The
--record=install.log
parameter
writes an overview of the steps to the
install.log
file. The next step is to dis-
cover the user and group IDs that your
Apache server uses. You can grep the
Apache configuration file to find these
values. On Suse Linux 8.2, for example,
type the following:
[[BR]]
<br>
hard newline
New line
<p>
Paragraph
= Heading =
<h1>Heading</h1>
Heading
== Subheading ==
<h2>Subheading</h2> Subheading
=== Level 3 ===
<h3>Level 3</h3>
Level 3
Alias /wiki/
U
"/usr/share/moin/
U
htdocs/"
==== Level 4 ====
<h4>Level 4 </h4>
Level 4
===== Level 5 ===== <h5>Level 5</h5>
Level 5
—- (four dashes)
<hr>
horizontal line
www.linux-magazine.com
April 2004
53
KNOW HOW
MoinMoin Wiki
the so-called sandbox,
which you can access
via a link on the wel-
come page (
http://local
host/mywiki/WikiSand
Box
). Click on the
Edit
this page
link to open a
window within the win-
dow. Most formatting
commands are intuitive
and you will soon dis-
cover that you have
mastered them. Table 1
provides on overview of
the most important com-
mands.
There are different
techniques for creating
links. To refer to an
external page on the
Web, simply supply the
URL, but make sure that you include
http://
. For example,
http://www.
linux-magazine.com
is a valid reference,
but not
www.linux-magazine.com
.
You can use straight brackets to
provide an additional description of the
link –
[http://www.linux-magazine.com
Linux Magazine homepage]
. This would
be written as
<a href="http://www.
linux-magazine.com">Linux Magazine
Homepage</a>
in HTML.
Internal links to wiki pages use the so-
called “CamelCase” notation with a
capital letter at the start of, and some-
where inside the word. For example, you
could easily use
LinuxMagazine
as a link
to the page
http://localhost/mywiki/
LinuxMagazine
.
If this does not currently exist, Moin-
Moin will help you create it (see Figure
2). Incidentally, if you add the
Moin-
Moin:
prefix to an internal link, the wiki
engine will create a link to the official
MoinMoin wiki. Thus, the following
link,
MoinMoin:LinuxMagazine
, would
take you to the following page
http://
purl.net/wiki/moin/LinuxMagazine
.
tent directly from the
server. Normal users are
not allowed to delete
pages, unless you explic-
itly allow them to do so
in the configuration file,
/usr/share/moin/
mywiki/moin_config.py
.
Should you require this,
add the following line:
allowed_actions=
U
['DeletePage']
Figure 3: Using your own logo.
This displays a
Delete
Page
link to visitors of
the wiki site. If a user
clicks on the link, Moin-
Moin ask them to con-
firm and then enter a
reason for this action.
To prevent pages disappearing mysteri-
ously, the software saves backup copies
of deleted pages in
/usr/share/moin/
mywiki/data/backup/
. If you want to
check on recent developments, you can
click on
RecentChanges
at the top of any
page to see where people are currently
working.
The MoinMoin developers are working
on individual user account based access
privileges, and this feature is already
available in the 1.1 version along with
ACL support.
Wikis basically do not provide security
– this is something all administrators
should be aware of. If you run an open
wiki on the Web, you are practically ask-
ing for graffiti.
However, a wiki on your Intranet can
be a useful thing. The ease of use, and
the fact that users do not need an
account on the web server to edit a page,
mean that a wiki software makes a lot of
sense for non-technical users.
the warning sign. A table with the avail-
able smileys and a note on how to
produce them is available at
http://
localhost/mywiki/HelpOnSmileys
.
/usr/share/moin/htdocs/img/
contains
miscellaneous images, such as the Moin-
Moin logo,
moinmoin.gif
. If you want to
use your own logo or image (see Figure
3) on your wiki pages, rather than the
man with the “Moin, Moin!” sign, sim-
ply save the image file in
/usr/share/
moin/htdocs/img/
and the edit the
/usr/
share/moin/mywiki/moin_config.py
file.
The entry will need to read:
logo_url = url_prefix + '/img
U
/
Your_Imagefile
'
This allows you to reflect corporate, or
organizational, identity when designing
a wiki site for a project or your organiza-
tion’s Intranet.
Use the
/usr/share/moin/mywiki/moin
_config.py
file to edit the name of your
wiki instance. To do so, replace the
default value, which is represented by
the
sitename
variable, with your choice
of name, as in
sitename = ‘Brainstorm-
ing Special Issue
. This will display the
name as a heading in your browser.
■
INFO
[1] WikiWikiWeb:
http://c2.com/cgi/wiki
[2] Email announcement:
http://c2.com/
wiki/mail-history.txt
[3] Wikipedia:
http://en.wikipedia.org/
[4] Wiki engines:
http://c2.com/cgi/
wiki?WikiEngines
[5] Apache:
http://www.apache.org
[6] MoinMoin:
http://moin.sourceforge.net
[7] Python:
http://www.python.org
Under the Hood
/usr/share/moin/htdocs/img/
contains a
number of GIF-formatted image files
which the wiki uses. These include all
kinds of smileys (emoticons). The wiki
software uses these images if certain
character strings appear in the text. The
wiki also adds a few symbols of its own,
such as the Python logo on each page, or
Open Wikis, Open Doors?
Wiki administrators have a few impor-
tant tasks to take care of, such as
maintaining the pages. Pages are located
in the wiki’s
data/text/
subdirectory. You
can use the
rm
command to delete con-
54
April 2004
www.linux-magazine.com
Plik z chomika:
Kapy97
Inne pliki z tego folderu:
2010.06_Git in Control-Flexible, Powerful, and Usable Version Control.pdf
(564 KB)
2010.05_Tunnel Vision-Slipping Past the Hotel Login Page with Some Simple Tunneling Tricks.pdf
(493 KB)
2010.05_Guest Services-Passing Host Pci Devices Through to the Kvm Guest.pdf
(461 KB)
2010.04_Table Map-Planning a Database with Mysql Workbench.pdf
(560 KB)
2010.04_On the Dvd-Knoppix Version 6.3 Highlights.pdf
(688 KB)
Inne foldery tego chomika:
Beginners
Business News
Comment
Community
Community Notebook
Zgłoś jeśli
naruszono regulamin