~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to wiki/underlay/pages/HelpOnInstalling(2f)ApacheOnMacOsx/revisions/00000001

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mfrom: (0.9.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080622211713-fpo2zrq3s5dfecxg
Tags: 1.7.0-3
Simplify /etc/moin/wikilist format: "USER URL" (drop unneeded middle
CONFIG_DIR that was wrongly advertised as DATA_DIR).  Make
moin-mass-migrate handle both formats and warn about deprecation of
the old one.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
## Please edit system and help pages ONLY in the moinmaster wiki! For more
2
 
## information, please see MoinMaster:MoinPagesEditorGroup.
 
1
## Please edit system and help pages ONLY in the master wiki!
 
2
## For more information, please see MoinMoin:MoinDev/Translation.
3
3
##master-page:Unknown-Page
4
4
##master-date:Unknown-Date
5
 
#acl MoinPagesEditorGroup:read,write,delete,revert All:read
 
5
#acl -All:write Default
6
6
#format wiki
7
7
#language en
8
8
 
9
 
You must not be afraid to use the terminal. It is possible but much harder to install without using the terminal.
10
 
 
11
 
There are 2 step in the installation:
12
 
 1. Install the MoinMoin engine - once
13
 
 2. Create wiki instance. You can create and serve as many wikis as you like.
14
 
 
15
 
 
16
 
= Installing MoinMoin =
17
 
== Download ==
18
 
 
19
 
Download the source on the Desktop. You should see a `moin-1.3.tar.gz` file. Extract this file on the desktop with Stuffit Expander, or from the terminal (faster and safer):
20
 
{{{
21
 
cd ~/Desktop
22
 
tar -xzf moin-1.3.0.tar.gz
23
 
}}}
24
 
 
25
 
== Install procedure ==
26
 
 
27
 
Use these commands in the terminal to install the !MoinMoin wiki engine into the system.
28
 
 
29
 
First, open a shell as root. You will need this to install MoinMoin and configure the wiki. When asked, enter your password.
30
 
{{{
 
9
These instructions will walk you through, step by step, setting up Moin on Mac OS X
 
10
 
 
11
<<TableOfContents>>
 
12
 
 
13
 ||<bgcolor="#ffffcc" style="text-align: center;"> Apple's latest operating system, 10.5 Leopard, packs enough under-hood changes that, rather than a bunch of if/then instructions, going forward this page will be updated only for Leopard.  If you have an older system (Tiger or Panther) you can click 'info' and view revision 45 for hints for those operating systems. ||
 
14
 
 
15
== System Requirements & Preparation ==
 
16
 
 
17
MacOS 10.5 Leopard includes the latest version of Python, version 2.5.1. (Older versions 10.4-Tiger and 10.3-Panther include the minimum required versions of Python to run Moin without updating, 2.3.5 and 2.3 respectively).
 
18
 
 
19
!MoinMoin installation requires the use of the Terminal and assumes you have a basic familiarity with commands and syntax.  When you read commandline mentioned below, assume that you will enter these commands using the Terminal.app (located in /Applications/Utilities/Terminal.app).
 
20
 
 
21
Make sure Apache is started ('Apple' menu > 'System Preferences...' > 'Sharing' panel > and check "Personal Web Sharing")
 
22
 
 
23
----
 
24
 
 
25
== Installation ==
 
26
 
 
27
 
 
28
=== Installing MoinMoin ===
 
29
 1. '''Download !MoinMoin'''
 
30
  * The most current version is here: MoinMoin:MoinMoinDownload
 
31
 1. '''Expand the archive'''
 
32
  * Double-click to expand the {{{moin-X.X.tar.gz}}} archive. 
 
33
  * You should then have a folder such as {{{moin-x.x}}} where "x.x" is the current release number. This folder will contain a {{{setup.py}}} file in addition to several other files and subfolders. Optionally, you may want to move the expanded {{{moin-X.X}}} folder to a location more convenient to work from, like into a {{{temp}}} folder the root of your hard drive.
 
34
 1. '''Run Setup.py from the commandline'''
 
35
  * Open Terminal.app and enter the commands: {{{
31
36
sudo -s
32
 
... password:
33
 
}}}
34
 
Now you have root privileges in this shell.
35
 
 
36
 
Install:
37
 
{{{
38
 
cd moin-1.3.0
39
 
python setup.py install --install-data='/usr/local'
40
 
}}}
41
 
 
42
 
 (!) The --install-data='/usr/local' will put the shared data in the convenient `'/usr/local/share/moin'` folder. If you don't use it, your shared data will be at `'/System/Library/Frameworks/Python.framework/Versions/2.3/share/moin'`. On Mac OS X, '/usr' belong to Apple, and it is safer to install in '/usr/local'.
43
 
 
44
 
 (!) The default Python used by Apache is the framework one supplied by Apple.  If you have added another Python version such as through DarwinPorts or Fink, then you should substitute "/usr/bin/python" for "python" above or you should substitute the specific path for the Python that will be used by Apache.
45
 
 
46
 
Now the installation is finished. You will not have to repeat this step unless you upgrade moin.
47
 
 
48
 
== Optional Installs ==
49
 
 
50
 
=== RSS ===
51
 
 
52
 
If you want your wiki to support RSS and Mozilla Firefox Live Bookmarks features, you have to install PyXML. Get PyXML from http://sourceforge.net/projects/pyxml/ and install according to the instructions.
53
 
= Creating a wiki =
54
 
 
55
 
After you have installed the software, you need to create a wiki. You may create several wikis if you need.
56
 
 
57
 
== Copying a template wiki ==
58
 
 
59
 
Copy a template wiki from the {{{/usr/local/share/moin}}}. Do not try to run the wiki from {{{/usr/local/share/moin/data}}} because your wiki will be overwritten when you install a new version of moin.
60
 
 
61
 
 <!> '''Security warning: do not put your wiki folder where the web server can access it! Your wiki should not be at the "Sites" folder in your home folder.'''
62
 
 
63
 
The following instructions will create a wiki called "mywiki". You can choose any name you like, except the reserved name "wiki".
64
 
 
65
 
Do these commands:
66
 
{{{
67
 
cd /usr/local/share/moin
 
37
password:
 
38
}}}
 
39
  * Now you have root privileges in this shell (note: the prompt will change from a $ to a #). To install, type: {{{
 
40
cd /temp/moin-1.6
 
41
}}}
 
42
  * (!) '''Important: '''Now you have to decide where you want to install your Moin wiki installation; this will be your wiki root folder. Unix traditionalists will install this into {{{/usr/local}}} because of long standing unix conventions.  However, on Mac, this and other unix folders are typically hidden from the Finder. So, you may want to install outside this folder where you can more easily manage the files (such as drag-copy backups, editing config files using !TextEdit.app, etc).  In the examples below, Moin is installed in a folder on the root of your hard drive named {{{/moinwiki}}}. If you want to follow unix conventions, simply substitute {{{/usr/local}}} for {{{/moinwiki}}} in all the examples below. {{{
 
43
python setup.py install --install-data='/moinwiki'
 
44
}}}
 
45
  * The {{{--install-data='/moinwiki'}}} argument tells the setup script where to put the data.  In this case, it will create a folder on the root of your hard drive called 'moinwiki'.
 
46
  * (!) '''Note:''' 'moinwiki' may seem like an odd name, but there are a number 'moin' folders created, so I use 'moinwiki' to distinguish this folder from the others.  You can of course name it anything you like.
 
47
  * <!> '''Security warning:''' Your wiki should not be in the "Sites" folder of your home folder, or in the /Library/!WebServer/Documents (Apache root) folder. Do not put your wiki folder where the web server can access it!
 
48
 1. '''Add yourself access privileges for moinwiki''' 
 
49
 . Apple tightened security in 10.5 Leopard. We want to add our username to the {{{moinwiki}}} folder so that it's easier to work with.  
 
50
  i. right-click (control-click) on the moinwiki folder, and select "Get Info...".
 
51
  i. click the lock icon in the lower-right corner, enter your password to unlock.
 
52
  i. click the + icon to add a new user, from the dialog select your username.
 
53
  i. change your privileges to "Read & Write"
 
54
  i. click the gear icon and select "Apply to enclosed items".
 
55
 
 
56
 
 
57
The installation portion is now finished.
 
58
----
 
59
 
 
60
== Configuration ==
 
61
 
 
62
 
 
63
 
 
64
You are now ready to create a wiki instance! The following instructions will create a wiki called "mywiki". You may replace the name {{{mywiki}}} with almost any name you wish, but do not use {{{wiki}}} because that is used by !MoinMoin for loading standard images and style sheets. Although this can be changed later, the name you choose for {{{mywiki}}} will become part of the url used to access your site, e.g. {{{http://server.myorganization.org/mywiki/FrontPage}}}.
 
65
 
 
66
 
 
67
=== Creating a Wiki Instance ===
 
68
We now want to create our own wiki instance and copy in a default set of templates and files. Do these commands:
 
69
 
 
70
{{{
 
71
cd /moinwiki/share/moin
68
72
mkdir mywiki
69
73
cp -r data mywiki
70
74
cp -r underlay mywiki
71
75
cp server/moin.cgi mywiki
72
76
cp config/wikiconfig.py mywiki
73
77
}}}
74
 
 
75
 
== Setting Permissions ==
76
 
 
77
 
You have to make the web server the owner of the files in your wiki. Unless you changed the default configuration, both are 'www'.
78
 
{{{
 
78
You can repeat these steps for creating multiple instances, run these same commands again, substituting {{{mywiki2}}} for {{{mywiki}}}.
 
79
 
 
80
 
 
81
=== Configuring Apache httpd.conf ===
 
82
 
 
83
Apple upgraded Apache to 2.2 in Leopard, which (among other things) brings tighter security controls than previous versions. 
 
84
 
 
85
 1. '''Add yourself access privileges for apache2''' ''(alternatively, if you're comfortable with commandline (Terminal.app), you can bypass these steps and use {{{sudo}}} and {{{pico}}} instead)''
 
86
  i. From the Finder, under the 'Go' menu, select "Go to folder..." and type {{{/etc}}}. 
 
87
  i. right-click (control-click) on the apache2 folder, and select "Get Info...".
 
88
  i. click the lock icon in the lower-right corner, enter your password to unlock.
 
89
  i. click the + icon to add a new user, from the dialog select your username.
 
90
  i. change your privileges to "Read & Write"
 
91
  i. click the gear icon and select "Apply to enclosed items".
 
92
 1. '''Edit Apache's configuration file, httpd.conf'''
 
93
  i. From the Finder, under the 'Go' menu, select "Go to folder..." and type {{{/etc/Apache2}}}.  Drag the ''httpd.conf'' file onto !TextEdit.app.
 
94
  i. Go to the end of the Aliases section and edit like the example below: {{{
 
95
    Alias /moin_static160/   "/moinwiki/share/moin/htdocs/"
 
96
    ScriptAlias /mywiki      "/moinwiki/share/moin/mywiki/moin.cgi"
 
97
}}} Add the following to allow Apache to access your {{{moinwiki}}} directory (see http://httpd.apache.org/docs/2.2/mod/core.html#options for more help): {{{
 
98
<Directory "/moinwiki">
 
99
    Options Indexes FollowSymLinks MultiViews
 
100
    AllowOverride None
 
101
    Order allow,deny
 
102
    Allow from all
 
103
</Directory>
 
104
}}}
 
105
  i. Save changes
 
106
  i. Restart Apache -
 
107
   * open System Preferences, go to the Sharing page, select "Personal Web Sharing" and click "Stop" then "Start".
 
108
   * Alternatively, from Terminal.app, type {{{apachectl graceful}}}.
 
109
 
 
110
=== Configuring moin.cgi ===
 
111
 
 
112
The ''moin.cgi'' file essentially tells Apache to run all the moin wiki pages through the python interpreter. 
 
113
 
 
114
 1. Edit the moin.cgi file at the following path {{{/moinwiki/share/moin/mywiki/moin.cgi}}} (click-drag the file onto !TextEdit.app). Change the line that points to your wikiconfig.py file, like in the example below. {{{
 
115
sys.path.insert(0, '/moinwiki/share/moin/mywiki/wikiconfig.py')
 
116
}}}
 
117
 
 
118
 What to do if you get an "Internal Server Error":: This most likely means that the pathname above is not correct.
 
119
 :: You can test your pathname by opening Terminal.app and pasting in the above line without the shebang {{{#!}}} statement (using the above example, {{{/Library/Frameworks/Python.framework/Versions/2.5/bin/Python}}}. If the path is correct, you should see output indicating your Python version as well as sample commands such as "help", "copyright", "credits", etc. If you get the error "Bad executable (or shared library)" or "No such file or directory" then the path is likely wrong, and you will need to correct.  I've also noticed that it helps to point directly at the "python" executable, rather than the alias or symlinks found in the upper directories.
 
120
 
 
121
 
 
122
=== Configuring wikiconfig.py ===
 
123
 
 
124
Open {{{wikiconfig.py}}} (click-drag the file onto !TextEdit.app) and read the comments. The wiki you created is a new "Untitled Wiki", using the default configuration. You want to give a better name and setup some configuration values. 
 
125
 
 
126
 . (!) Note that the file belongs to user and group www:www. You can edit the file as root, or change the group of the file to yourself with {{{chown www:username wikiconfig.py}}}.
 
127
Edit {{{/moinwiki/share/moin/mywiki/wikiconfig.py}}} and change the {{{sitename}}} to the name of your wiki:
 
128
 
 
129
{{{
 
130
    sitename = 'My Mac Wiki'
 
131
}}}
 
132
Additionally, set {{{data_dir}}} and {{{data_underlay_dir}}} to the absolute paths of the particular directories. You can use relative paths for the directories, but note that they are relative to the CGI script, not the configuration file! Better to '''use absolute paths''', and save yourself some headaches:
 
133
{{{
 
134
    data_dir = r'/moinwiki/share/moin/mywiki/data'
 
135
    data_underlay_dir = r'/moinwiki/share/moin/mywiki/underlay'
 
136
}}}
 
137
 
 
138
Uncomment the {{{url_prefix_static}}} line: {{{
 
139
    url_prefix_static = '/moin_static160'
 
140
}}}
 
141
 
 
142
For a public installation, you'll normally want to forbid some of the more dangerous actions. Add a line like this to {{{wikiconfig.py}}}:
 
143
 
 
144
{{{
 
145
    actions_excluded = ['AttachFile', 'DeletePage', 'RenamePage', ]
 
146
}}}
 
147
Additional configuration details can be found in HelpOnConfiguration.
 
148
 
 
149
=== Setting Permissions ===
 
150
You have to make the web server the owner of the files in your wiki. Navigate to {{{/moinwiki/share/moin/}}} and run the following commands: {{{
79
151
chown -R www:www mywiki
80
 
chmod -R ug+rwX mywiki
81
 
chmod -R o-rwx mywiki
82
 
}}}
83
 
 
84
 
== Configure Apache ==
85
 
 
86
 
We'll use the pico editor:
87
 
{{{
88
 
pico /etc/httpd/httpd.conf
89
 
}}}
90
 
 
91
 
Go to the end of the Aliases section and edit like the example below:
92
 
{{{
93
 
    Alias /wiki/ "/usr/local/share/moin/htdocs/"      
94
 
    ScriptAlias /mywiki "/usr/local/share/moin/mywiki/moin.cgi"       
95
 
}}}
96
 
Use Control+O to save the file and Control+X to exit pico.
97
 
 
98
 
Restart Apache - open System Preferences, go to the Sharing page, select "Personal Web Sharing" and click "Stop" then "Start". Or just type this instead:
99
 
{{{
100
 
apachectl graceful
101
 
... /usr/sbin/apachectl graceful: httpd gracefully restarted
102
 
}}}
103
 
 
104
 
 
105
 
Instance creation finished - exit from the shell with the root privileges - working as root is dangerous.
106
 
{{{
107
 
exit
108
 
}}}
109
 
Now you are running again safely.
110
 
 
111
 
 
 
152
chmod -R 744 mywiki
 
153
}}}
 
154
 
 
155
----
112
156
== Testing Your New Wiki ==
113
 
 
114
 
In a web-browser surf to the site: http://localhost/mywiki
115
 
 
116
 
You should see the !FrontPage of your new wiki.
 
157
In a web-browser surf to the site: http://localhost/mywiki You should see the !FrontPage of your new wiki.
117
158
 
118
159
Now run the unit tests, to make sure everything is fine. Go to this address: http://localhost/mywiki?action=test
119
 
 
120
 
You should see a report on the wiki and tests results for the MoinMoin engine. If some of the tests fail, please report the problem on [http://moinmoin.wikiwikiweb.de/MoinMoinBugs MoinMoinBugs].
121
 
 
122
 
== Configuring Your wiki ==
123
 
 
124
 
The wiki you created is a new "Untitled Wiki", using the default configuration. You want to give a better name and setup some configuration values. Open {{{wikiconfig.py}}} and read the comments. You can edit the file with any text editor, like pico, emacs, or BBEdit. 
125
 
 
126
 
 (!) Note that the file belongs to user and group www:www. You can edit the file as root, or change the group of the file to yourself with {{{chown www:username wikiconfig.py}}}.
127
 
 
128
 
For more help on configuration, see HelpOnConfiguration.