This HTML page contains the basic install docs that can be found on http://purl.net/wiki/moin/MoinMoin/InstallDocs. It contains all necessary information to get your wiki up and running, even without being online. If you have a permanent internet connection, you might want to browse the docs on the HelpOnInstalling page, which might contain more up-to-date information.
After following the procedures on this page, you should have a working wiki and can browse the rest of the online docs there.
How to install your own MoinMoin Wiki
This page describes the installation procedure applying to MoinMoin version 0.11 and up. In the next section, there is a list of real-world Installation Scenarios that help you to understand how to apply the instructions in different environments.
Basic Installation explains the "setup.py" step of the installation in more detail. This applies equally to all scenarios, and you should read it before trying a live installation.
Trouble-shooting helps with fixing any general problems you might encounter, which apply to any installation platform.
After a successful installation, you might want to read more about configuration and other options that you, as the wiki administrator, can set up. HelpOnAdministration contains links to pages that cover these topics. Especially, the HelpOnConfiguration and HelpOnUpdating pages provide additional information regarding wiki setup and maintenance. MoinMoinWinCvs and MoinMoinUnixCvs describe how to run your wiki using the current development version from the SourceForge CVS repository.
Sample Installation Scenarios
The following links lead you to concrete examples of installation sessions, showing the commands used and explaining what they do. It is highly recommended that you first read the general information on installing (especially the next section of this page) before choosing an installation scenario that best fits your intended use of MoinMoin.
UNIX:
Windows:
How to do a basic installation of MoinMoin on your system.
Contents
Conteúdo
Before you can integrate MoinMoin into your web environment, you have to install the MoinMoin source code and data files using the standard Python distutils mechanism (setup.py). This page explains the steps you usually need to take to do this. For more details on the distutils installation process, consult the Installing Python Modules document in your Python documentation set.
The installation is similar on Windows and Linux (and other POSIX-type systems; for simplicity, we just say "Linux" in the docs).
We use text such as > command arguments to show what you have to type at the command prompt (also known as shell, terminal, etc.). In our examples "> " is the prompt, you don't have to type it in, you have to type what comes after it. Lines that do not begin with "> " are the answers to the commands you have typed. Read them carefully.
Check if Python is working
MoinMoin needs Python to run, so the first step is to check if an usable version of Python is installed and correctly set-up. If this is not the case, you will have to fix that before you can proceed.
The CHANGES file in the MoinMoin archive mentions what versions are supported. Python 2.3 is the minimum requirement for MoinMoin 1.7, but we suggest you use the latest Python release version.
You can download Python at http://www.python.org/download/.
If you are pretty sure an acceptable version of Python is installed but the commands below do not work, this may be because your Python files are not in the search path. Correctly setting the search path is outside the scope of this document; please ask for help on your favorite Python, Linux, or Windows discussion board.
If you have shell access, checking if Python is working is very simple. Just type the following command, and look at the result:
> python -V Python 2.4.4
If you don't have shell access, you can try using this pythontest.cgi script (it assumes that you are using a Linux kind of webserver). Upload the script to your cgi-bin directory, use chmod a+rx pythontest.cgi (or a similar command in your FTP program) to make it executable, and invoke it using your web browser.
If it doesn't display "CGI scripts work", well, then CGI scripts don't work. If it doesn't show one or more Python version numbers, then Python is not correctly installed. In both cases, before you can proceed, you will have to get in touch with the administrator of the server so that the problems get corrected.
Also be sure to read ../ApacheOnLinuxFtp after you've completed the ../BasicInstallation illustrated here.
Download MoinMoin
To download the distribution archive, go to the download page and fetch the latest archive.
The next step is to unpack the distribution archive (which you have done already if you are reading this text from your hard drive). If you read this on the web, the distribution comes in a versioned .tar.gz archive, which you can unpack as shown below.
- On Windows
- On Linux
- You can use your favorite file manager -- it should be able to unpack them.
At any shell prompt, you can use the tar command.
The distribution archive will always unpack into a directory named moin-<version>, for example moin-1.7.0.
Here is how you would unpack the archive (using GNU tar) and enter the directory with the MoinMoin files:
> tar xzf moin-1.7.0.tar.gz > cd moin-1.7.0
Install MoinMoin
You can install MoinMoin to either:
- a system location (if you have the necessary rights to do that -- on Linux you need to be root)
some specific location, like your home directory (Linux) or C:\moin (Windows).
The installation to a system location is easier, so choose that if possible.
If you have several versions of Python installed, please use the same version for setup and for running the wiki. Usually, the latest Python version will get the best results.
Recommended installation command for Linux (and MacOs X)
As you have chosen to not use a preconfigured package for your system this time it is highly recommended that you do not install MoinMoin into the default location. This is because otherwise, if you later want to install a moin package of your distribution this will overwrite your existing installation. The most common path for your own installations is below /usr/local (this is called the PREFIX). A command that should be ok for most Linux distributions and also MacOS X is
> python setup.py install --prefix='/usr/local' --record=install.log
This will install the shared files to '/usr/local/share/moin' and the moin code to /usr/local/lib/python2.x/site-packages/MoinMoin/.
Debugging setup process
If you have problems with the setup.py install step, try using the command:
> python -v setup.py --quiet install --record=install.log
The additional -v flag should provide you detailed verbose messages every step of the way.
On Linux, if you get an error like Invalid Python installation: cannot find /usr/lib/Python2.x/config/Makefile, you may not have the python module distutils installed, it's usually a part of the Python development libarary (python-dev). Some Linux distributions may not have installed it by default. For example, on Mandrake you need to install the python-devel package, on Debian it's called python-dev.
Installing to the default system location
> python setup.py --quiet install --record=install.log
This installs MoinMoin to the default system location (typically the Python directory, for example on Linux, inside /usr/lib/python2.x/site-packages/MoinMoin and /usr/share/moin). Look at the install.log file to see what was installed, and where.
Installing in the home directory or another specific location
Linux example, installing in the home directory:
> python setup.py --quiet install --prefix=$HOME --record=install.log
Windows example, installing in the C:\moin directory:
> python setup.py --quiet install --prefix="C:\moin" --record=install.log
All MoinMoin files will then be installed inside those directories, see install.log to know which files were installed, and where.
Note: You will likely see the following warning:
warning: install: modules installed to 'C:\moin\', which
is not in Python's module search path (sys.path) -- you'll
have to change the search path yourself
This means exactly what it says, you need to add your install directory to the search path of Python, or it won't find the MoinMoin code.
For example, if you are running using a webserver and standard CGI, edit moin.cgi and add your installation directory to the Python path, like this:
import sys sys.path.insert(0, 'C:/moin')
Test installation
As a final step, if you have access to the shell or the command prompt, you can check that everything is correctly installed and ready to run. Start Python and type import MoinMoin. Nothing should be displayed in response to this command. Example:
> python Python 2.4.4 (...) Type "help", "copyright", "credits" or "license" for more information. >>> import MoinMoin >>>
If you get this instead:
>>> import MoinMoin Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named MoinMoin >>>
then you have to tune your installation. Try modifying sys.path, as described above.
What has been installed
So, you have a ready-to-work MoinMoin installation now. Congratulations! Before you go on to configuring it, take a look at the various files and directories that have been installed.
It is important that you understand the different locations used in a MoinMoin setup, so read this carefully.
In the following descriptions, PREFIX is what you used with the setup.py command, or a default location if you didn't use the --prefix option. (Typical default values on Linux are /usr and /usr/local.) X.Y is the version of Python. Typically, this is 2.3, 2.4 or 2.5.
Look into install.log to find out about following important locations:
MoinMoin directory, usually PREFIX/lib/pythonX.Y/site-packages/MoinMoin -- this is where the MoinMoin source code is located
share directory, usually PREFIX/share/moin - this is where the templates are located
data directory (wiki pages, users, etc.) - only MoinMoin should access this
underlay directory (wiki pages) - only MoinMoin should access this
htdocs directory with html support files (images for the various themes, etc.) - the web server will need to access this
server - MoinMoin example startup files (like moin.cgi for CGI, and other files for other startup methods)
config - MoinMoin example configuration files (like wikiconfig.py)
bin directory with some scripts that help you use the MoinMoin shell commands
We talk of templates in the share directory because you usually will not use those files at that location, but copy them elsewhere when you need them. This way, you can set-up several wikis without problems, and easily upgrade to new MoinMoin versions.
Trouble-shooting
How to deal with common errors
First follow the instructions
Moin has provided instructions for common usage. Try creating a wiki using the default values within the instructions. Your wiki would then be stored where ours is, and named mywiki ... but you can change that place, and this name, AFTER you have a working wiki. The default values have been chosen carefully to work for most people on most platforms, or at least be a good start.
- First follow the instructions
- Do not change any configuration option unless you must.
- Play with a working wiki before you try to customize it.
Change one thing at a time
When your wiki is running, go and customize it to your needs, but remember to change only one option at a time. You probably don't fully understand how all options work, and if you go and break few things in the same step, you will have hard time to fix it.
Check That Your Webserver Can Use Python
This is also in HelpOnInstalling/BasicInstallation. Use this script:
echo Content-Type: text/plain echo echo "Your web server is running as:" id echo "CGI scripts work" echo "Now we try to invoke Python interpreters and get their versions:" python -V 2>&1 python2.3 -V 2>&1 python2.4 -V 2>&1 python2.5 -V 2>&1 echo "Finished."
to see if you can get it to announce that cgi works. Then you will also know which versions of python are usable. This is especially handy for users with no root access.
Duelling Pythons
The most common problem you might encounter is when you have an old Python version installed into "/usr", and a newer Python distribution into "/usr/local"; this is typical for GNU/Linux distributions that still come bundled with an old Python version.
In that case, if you enter "python" on your prompt, you will usually get the more recent Python interpreter, because "/usr/local/bin" is in your PATH. The situation is different in your webserver environment, and thus you might have to change the bang path of "moin.cgi", like this:
""" MoinMoin - CGI Driver Script ... """
When installing, make sure you install with the version of python you want to run moin with. python setup.py install will install with the first python in the path, which may be the version you expect or not! /usr/local/bin/python2.4 will install in specific python. You will have to use the same path in the moin server script.
Missing file permissions
If you are root, the installed files may be readable only by root, but they must also be readable by the web server before the wiki will work. This includes both the Python modules and the site itself. For the data directory, the wiki engine also needs write access. To fix this, first find out where the Python module directory is; look in install.log, or run the command:
python -c "import sys; print '%s/lib/python%s/site-packages' % ( sys.prefix, sys.version[:3] )"
For the example below, we'll assume that the Python module directory is /usr/local/lib/python2.4/site-packages. Make the files world-readable using the following commands:
cd /usr/local chmod -R a+rX lib/python2.4/site-packages/MoinMoin
Set Your Variables Carefully
Be especially careful when you retype instead of cut and paste. Quoting errors in wikiconfig.py can cause things to fail. The following items are also variable issues. Also, some features only work if they are enabled by their option in either wikiconfig.py or farmconfig.py.
moin.cgi found, Moin doesn't run
If you have to add the moin code location into the system path, make sure to specify the place above MoinMoin itself, so that the word MoinMoin is recognized during the import request.
CSS files do not work
A very common error is missing CSS styles. Your wiki looks bare and ugly, unlike this nice wiki. In most cases, you did break the configuration by not reading the instructions.
The fix is very easy: make sure your Apache Alias and ScriptAlias are NOT the same.
This Apache setup will never work:
Alias /wiki/ "/prefix/share/moin/htdocs/" ScriptAlias /wiki/ "/var/www/wiki/moin.cgi"
The Alias is used to serve static files: css, images, etc. ScriptAlias is used to hide moin.cgi from the url. You must use different values! You can use anything you like for ScriptAlias, or Alias, but Alias must match the url_prefix_static configuration option.
Here is an example that works (the default):
# Apache config Alias /moin_static170/ "/prefix/share/moin/htdocs/"
# Wiki config url_prefix_static = '/moin_static170'
Windows Installation using Apache
System Requirements & Preparation
Before you install MoinMoin, you must have the necessary infrastructure in place. This procedure explains the steps necessary to install the infrastructure and provides detailed instructions for the installation of MoinMoin.
Windows 2000, XP, or greater (including server variants, such as Windows 2000 Server).
Earlier versions of Windows (such as Win98 or WinME) are not recommended due to their obsolete and poor-performing multiple-process handling. WinNT is obsolete and Microsoft has officially dropped support for it and should not be considered a safe server platform for the Internet.
- Run Windows Update to ensure that you are running the latest service packs and security patches.
- Apache doesn't require Windows Server (unlike IIS), so it's a great way to use an older desktop without using a Server license! Apache doesn't artificially limit the number of connections, unlike personal IIS for example.
Many users prefer to install software products in a folder other than the installation default. Python typically changes the default installation folder name with each point release, and Apache has changed the default installation folder name with the release of version 2. Instead of enumerating all the possibilities at each step, this procedure will use the Reference name in the table below as the installed location for each product. Substitute your real installation location when editing configuration files and entering commands.
Reference |
Product |
Installation Default or Typical Name |
C:\Apache |
Apache |
C:\Program Files\Apache Group\Apache2 |
C:\Python |
Python |
C:\Python24 |
C:\Moin |
wiki instances |
C:\My Documents\Moin |
Downloading and installing all of the required components below will require almost 100 MB of disk space - shouldn't be a problem nowadays, right?
Installation
Installing Apache
Download & Install Apache 2.0.xx or greater
Apache2 was re-written with better support for non-unix systems, therefore the 2.0.xx series is strongly recommended for Windows users over Apache 1.3.xx.
Go to http://httpd.apache.org
download the Win32 Binary (MSI Installer) for the latest version of Apache 2.
- Read the Apache documentation to determine the correct installation procedure for your situation.
- Test your Apache installation to make sure it runs correctly before proceeding (questions and problems with the Apache installation should be resolved through the resources provided by the Apache organization).
Installing Python
There are currently two different distributions of Python available for Windows.
The normal Python distribution is available from http://www.python.org. This is distributed as a windows executable (.exe) file.
An alternative distribution called ActivePython is available from http://www.activestate.com/. This distribution uses the MSI Installer and contains some tools specific to the Windows operating system and a popular Windows IDE called Pythonwin, which may be useful if you also plan to develop in Python. ActivePython is available for free; an email address is requested (but not required) before downloading.
MoinMoin will work with either distribution, but requires Python release 2.3 or later. Download and install the distribution of your choice. Questions and problems dealing with the Python installation process should be resolved through the use of resources provided by Python.org or ActiveState. Be sure your Python installation is correct before proceeding.
Installing MoinMoin
Download MoinMoin
The most current version is here: MoinMoinDownload
Expand the archive
Note: users of older versions of WinZip report problem expanding .tar.gz files. Either upgrade or use the free 7-Zip utility.
Expand the archive into C:\TEMP or an alternative location.
You should then have a folder such as C:\TEMP\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.
Run Setup.py from the commandline
Open an DOS window (start > Run... > type cmd) and enter the commands:
C: cd \TEMP\moin-x.x C:\Python\python setup.py install --record=install.log
The above commands will add MoinMoin to your C:\Python installation and create an install.log file in C:\temp\moin-x.x listing all the copied files. You can use Windows Explorer to examine the newly created folders within C:\Python. You should find a C:\Python\share\moin folder and a C:\Python\Lib\site-packages\MoinMoin folder. The MoinMoin folder contains many Python scripts and several subfolders.
You are now ready to create a wiki instance.
Configuration
It is a good practice to try to keep all of your personal or site specific data under a few root folders. This way you can easily backup your important data on a regular basis without having to waste time either backing up static files or picking out dozens of important folders scattered throughout your folder structure. You should avoid placing your wiki data under the C:\Python folder so that you can later upgrade Python or MoinMoin without accidentally overwriting or deleting your wiki data. For the same reason, you probably don't want to place your wiki data within the C:\Apache folder.
Choose a location appropriate for you; the following instructions assume you will be creating one or more wiki instances in C:\Moin\ and the first wiki instance will be named 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.
Creating a Wiki Instance
Start an DOS window and enter the commands below. This will create a clone of the MoinMoin wiki in the mywiki folder.
cd C:\ md Moin md Moin\mywiki md Moin\mywiki\data md Moin\mywiki\underlay cd \Python\share\moin xcopy data C:\Moin\mywiki\data /E xcopy underlay C:\Moin\mywiki\underlay /E copy config\*.* C:\Moin\mywiki\*.* copy server\*.* C:\Moin\mywiki\*.*
If your server is going to run multiple wikis, you need to create additional clones. Do the same commands again, but use mywiki2 instead of mywiki.
Configuring wikiconfig.py
Edit C:\Moin\mywiki\wikiconfig.py and at least change sitename to the name of your wiki:
sitename = 'My Wiki'
Additionally, set data_dir and data_underlay_dir to the absolute paths of the particular directories. Like here:
data_dir = r'C:\Moin\mywiki\data' data_underlay_dir = r'C:\Moin\mywiki\underlay'
For a public installation, you'll normally want to forbid some of the more dangerous actions. Add a line like this to wikiconfig.py:
actions_excluded = ['AttachFile', 'DeletePage', 'RenamePage', ]
If you will not be running a Wiki farm (if you're not sure what this means, then you probably won't be), make sure to delete the farmconfig.py file from the C:\Moin\mywiki directory, or else moin.cgi will most likely give off various errors (including one about not being able to find a configuration file) and will ultimately fail to start up properly.
Additional configuration details can be found in HelpOnConfiguration.
Configuring moin.cgi
Use your editor to edit the file C:\Moin\mywiki\moin.cgi. Change the first line (the shebang statement) to point to your local Python executable program. Note the forward slashes -- Apache uses the Unix convention for folder separators. This tells Apache the moin.cgi file is an executable script that will be interpreted by a program to be loaded from C:/Python/python.
#! C:/Python/python
Configuring Apache httpd.conf
The next step is to tell Apache that is has more work to do. Use your editor to append the following lines to C:\Apache\conf\httpd.conf. Note the presence and absence of trailing slashes, it is important to enter the lines exactly as shown below.
Alias /moin_static160/ "C:/Python/share/moin/htdocs/" ScriptAlias /mywiki "C:/Moin/mywiki/moin.cgi"
The Alias line above instructs Apache to serve images, style sheets, etc. from the specified folders and subfolders. The ScriptAlias line is needed once for each wiki instance, so if you have multiple wikis, repeat the statement using mywiki2, mywiki3, etc. The ScriptAlias statement instructs Apache to execute scripts from the specified folder. See the Apache docs for a complete explanation.
Test your changes by restarting your Apache server and try to access your newborn wiki with the URL http://127.0.0.1/mywiki. You should see the FrontPage, try to edit and save it, and if that works, verify your edit is reflected on the RecentChanges page.
And now, it is up to you and your user community to transform your wiki into an informative and useful tool. You will probably want to retain most of the HelpOn~ pages dealing with editing, delete those pages with irrelevant information (like this page, don't let your users or boss know how easy it was to install MoinMoin ), and rewrite the FrontPage to introduce your wiki topic.
Troubleshooting
The first place to look for clues when the unexpected happens is to try changing your url to: http://127.0.0.1/mywiki?action=test. If Apache can find and execute the module C:/Moin/mywiki/moin.cgi, a page of diagnostics titled MoinMoin CGI Diagnosis will be displayed. Check the output for error messages.
The second place to look for is C:\Apache\logs\error.log. The following are common errors grouped by the message displayed by your browser:
Internal Server Error
If the Apache log shows a message "The system cannot find the file specified." then a possibility is the shebang statement in moin.cgi is incorrect.
If the Apache log shows a different error message, then the MoinMoin Python scripts may be abending. To determine the cause, you could try temporarily renaming moin.cgi to moin.py, loading moin.py with the Python idle IDE and executing it to determine if there are any error messages.
Not Found
If the Apache error log shows the message "File does not exist: C:/Apache/htdocs/mywiki", the ScriptAlias statement in httpd.conf may be incorrect.
The Page Cannot be found
If the Apache error log shows the message "File does not exist: C:/Apache/htdocs/????", you may have mistyped the url "http://127.0.0.1/mywiki" into your browser.
FrontPage Loads Without Icons
If the Apache Error log shows many error messages "File does not exist: C:/Apache/htdocs/wiki", then the Alias statement in httpd.conf may be incorrect.
If you did not install MoinMoin in the Python site-packages folder (i.e. only if you deviated from the above instructions), you will have to activate the lines which add a folder to the sys.path and enter your path to MoinMoin there:
import sys sys.path.insert(0, r'C:\Moin\...')
Next Steps
Authenticating MoinMoin Users Against a Domain Controller
- Many organizations are setting up wiki's for documentation on their internal network. As a result, many organizations require the security of authentication, which protects their content, as well as allowing people to work remotely on the wiki without anonymous eye's peeking at their site. Domain authentication is convenient for both the administrator and the user, because it uses the same password the user would use for other network logins. If this describes you, proceed to:
Simple Windows MoinMoin Backup
- Simple strategy for backing up your wiki:
FastCGI with Windows
- Dramatically increase performance of your wiki with the FastCGI Apache module:
Windows Installation using IIS
Index
Conteúdo
Requirements & Preparation
Before you install MoinMoin, make sure you have the necessary infrastructure in place, namely the Internet Information Services webserver (any version should be OK), and a Python installation (at least version 2.3 is required, the latest python release is recommended).
These instructions make the basic assumption that you will have these components installed in their default locations. In reality, you'll probably have them installed elsewhere (on the D: drive, for example). Be careful to substitute your drive and paths based on the following assumed default locations:
- IIS to its default location
C:\Python - the Python interpreter
C:\Moin - MoinMoin itself
Installation
Installing IIS
From Microsoft: (http://www.microsoft.com/windows2000/en/server/iis/)
- To install IIS, add components, or remove components:
Click Start => Settings => Control Panel => Add/Remove Programs.
Click 'Add/Remove Windows Components', Check 'Internet Information Services' and follow the on-screen instructions to install. ( it is also recommended to click the 'details' button and un-selecting components you will not need. This will depend on your server role; but for example, you probably will not need FTP, or "Frontpage 2000 Server Extensions").
Make sure that your webserver runs without problems before you start to install MoinMoin; problems with your webserver installation are not in the scope of this document.
Installing Python
There are currently two different distributions of Python available for Windows. Either version will work fine.
http://www.python.org - The standard open-source Python distribution.
- The installer is a windows executable (.exe) file.
http://www.activestate.com - An alternative, commercially-supported, distribution (distributed for free (email address required)).
- The installer is a Windows .MSI file.
If you are or plan to develop in the Python language, ActivePython has some tools specific to the Windows operating system and includes a popular Windows IDE called Pythonwin.
MoinMoin works with either distribution, but requires Python release 2.3 or later. Download and install the distribution of your choice. Be sure your Python installation is correct before proceeding. Installation is straightforward; however, any questions or issues regarding the Python installation process should be resolved through the use of resources provided by Python.org or ActiveState.
Installing MoinMoin
Download MoinMoin
The most current version is here: MoinMoinDownload
Expand the archive
Note: users of older versions of WinZip report problem expanding .tar.gz files. Either upgrade or use the free 7-Zip utility.
Expand the archive into C:\TEMP or an alternative location.
You should then have a folder such as C:\TEMP\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.
Run Setup.py from the commandline
Open an DOS window (start > Run... > type cmd) and enter the commands:
C: cd \temp unzip moin-1.6.zip cd moin-1.6 python setup.py install --prefix=C:\Moin --record=install.log
This will install all necessary files to the "C:\Moin" directory, and create a "install.log" file listing all the files that are created there.
You are now ready to create a wiki instance.
Configuration
Creating a Wiki Instance
Enter these commands in a console window from C:\Moin>:
cd c:\Moin md mywiki md mywiki\data md mywiki\underlay xcopy share\moin\data mywiki\data /E xcopy share\moin\underlay mywiki\underlay /E copy share\moin\server\moin.cgi mywiki\ copy share\moin\config\wikiconfig.py mywiki\ copy share\moin\htdocs\index.html mywiki\default.htm
"mywiki" is the name of your wiki instance, you might want to chose a different name best fitting the intended use of this instance; just don't name it simply "wiki", because that would result in confusion and problems later on.
We have to make sure that moin.cgi can find the MoinMoin directory, so that "import MoinMoin" will work. The easiest way to make sure MoinMoin can be imported is to append to sys.path within moin.cgi.
You can change the first two lines of code in moin.cgi to something like this:
Notice that we're pointing to the directory which contains the MoinMoin directory, not the directory itself.
Configuring IIS
Next, you'll need to create two virtual directories in IIS. One for the shared data, and one for this specific wiki instance.
Configuring IIS 5.0 and above
Open Internet Services Manager (Start > Settings > Control Panels > Administrative Tools > ...). Open up the tree to Default Web Site.
Right click on Default Web Site and choose New > Virtual directory.
- This will bring up a wizard with the mandatory useless first screen, hit next.
Enter "wiki" for the alias name, hit next.
Browse to "C:\Moin\share\moin\htdocs", hit next.
Leave the Access permissions at their defaults, hit next.
- And now you're done, hit finish!
Now follow the same steps, but set the alias to "mywiki" and the path to "C:\Moin\mywiki".
- Use IIS Admin to remove permissions to read the data directory:
expand the "mywiki" node
right click on data
select Properties
and uncheck Read.
Repeat these steps with the underlay directory.
Now you need to setup the 'mywiki' alias so that it will run Python to interpret .cgi files.
On Windows Server 2003, click the Create button under Application Settings to create an application space.
Right-click on your new 'mywiki' alias and choose Properties. On the first tab (Virtual Directory), click the Configuration button.
The first tab is the App Mappings tab, which defines which programs to use for each file extension.
Click Add. Browse to your python.exe (probably something like c:\pythonXX\python.exe).
Then add -u "%s" "%s" after the Python executable path. The Executable line will look something like this: "C:\Python22\python.exe" -u "%s" "%s". In the Extension box enter .cgi with the beginning period.
Make sure that the Check that file exists option is not checked (if it is, MoinMoin won't be able to display sub pages).
Ok, you're done with the alias configuration, click OK several times to get back out of all the dialog boxes.
If you add another wiki instance, you'll only need to setup the reference to its folder, they can safely share the "wiki" alias which points to static files only.
IIS 6.0 (Windows Server 2003)
The instructions below also apply to IIS 6.0 but the more aggressive security settings in newer version of IIS disallow the usage of unknown CGI extensions. That means you will always get a 404 error unless you do this:
Open IIS Manager (Start > Programs > Administrative Tools > IIS Manager).
Go to the Web Service Extensions folder.
Under the Action menu, select Add a new Web service extension....
For Extension name, give it a name such as .cgi or Python cgi or similar.
Under Required files click the Add... button and type in the exact command-line string you used above. Eg: c:\python24\python.exe -u "%s" "%s", then click the Ok button.
Make sure the Set extension status to Allowed checkbox is checked and click the Ok button.
Another change that may be necessary if you are receiving HTTP Error 403 19 1314 while using IIS 6.0 is to adjust the Identity settings for the Application Pool that is being used by your site. The following steps assume you are adjusting the Default Web Site.
Open IIS Manager (Start > Programs > Administrative Tools > IIS Manager).
Go to the Application Pool folder.
Select the Application Pool you wish to adjust. (likely DefaultAppPool ) When you do this on the right you will see the Application pools for each site on the server. This will include a Description (likely Default Application ) and a Path (<Default Web Site>). In this way you can be certain you are adjusting the appropriate Application Pool.
With DefaultAppPool still selected right click and select Properties.
Select the Identity tab and with Predefined clicked use the drop down box to change the Identity to Local System instead of Network Service. Please be aware that this is a workaround since you SHOULD set your group settings to allow Network Service to access the cgi scripts.
Under Windows Server 2003, you will also need to give your IUSR_MACHINENAME account Modify access to the mywiki\data and mywiki\underlay sub-directories, as file system permissions are more restricted by default than previous Windows versions.
That is all, try to access your new-born wiki with the URL http://127.0.0.1/mywiki/. You should see the FrontPage, try to edit and save it, and if that works, see if your edit is reflected on the RecentChanges page.
Configuring wikiconfig.py
Finally, edit "wikiconfig.py" and at least change "sitename" and "logo_string" to some personal values:
sitename = u'My Wiki' logo_string = u'<img src="/mywiki/images/mywiki-logo.gif" alt="MyWiki Logo">My Wiki'
Where "images" is a directory under your "mywiki" instance.
NOTE: The configuration variable "url_prefix" in "wikiconfig.py" should match the alias for "C:\Moin\share\moin\htdocs" or themes will not work ("/wiki" for the instructions above). This way, any reference in "wikiconfig.py" to "/wiki/something" will look in the shared data directory and a reference to "/mywiki/something" will look in the wiki instance directory. These are considered absolute paths because relative paths will not work correctly.
It seems you need to change the Custom Errors setting for 404 before you can create new pages. You can accomplish this by performing the following steps:
- Go into the IIS Manager, right-click on 'mywiki' (or whatever your wiki instance directory is called), and select properties.
Next, go to the Custom Errors tab and find the 404 entry, and click the Set to Default button.
Troubleshooting
If you see an error like "ImportError: No module named MoinMoin", it means that python cannot find MoinMoin. See above for how to add to sys.path.
- If you see an error like Error 13: Permission Denied, it means that your web user permissions for the files do not have write/modify enabled.
If the page never loads after hitting Save Changes, you should check the permissions of the data directory. Make sure the IUSR_COMPUTERNAME user has modify permissions.
If some images like InterWiki and WorldWideWeb don't show up, it could have been because of incorrect permissions or a bad "url_prefix" in "wikiconfig.py" or the cached pages need to be updated by an Edit or deleting them in the data folder. Or you are using MS IE which has broken CSS :before support - try another browser.
If you see an error message like:
Check your URL regular expressions in the "wikis" list in "farmconfig.py". Content-type: text/html;charset=utf-8 MoinMoin Configuration Error Could not find a match for url: "servername/wikiname/moin.cgi? Check your URL regular expressions in the "wikis" list in "farmconfig.py".
- and you don't intend on using a serverfarm, remove the farmconfig.py and farmconfig.pyc files and try again. The error message shouldn't appear when you refresh the page.
If you are using URLScan, you might have to add the following setting in the file %SystemRoot%\system32\inetsrv\urlscan\urlscan.ini:
[options] AllowHighBitCharacters=1
Next Steps
Backing up MoinMoin is simple. Look at HelpOnInstalling/Win32MoinEasyBackup for guidance (despite the somewhat misleading title, the procedure would be the same for IIS).