## Please edit system and help pages ONLY in the moinmaster wiki! For more ## information, please see MoinMaster:MoinPagesEditorGroup. ##master-page:Unknown-Page ##master-date:Unknown-Date #acl MoinPagesEditorGroup:read,write,delete,revert All:read #format wiki #language en These instructions will walk you through, step by step, setting up Moin on Mac OS X <> == System Requirements & Preparation == All recent versions of MacOS X already includes a version of Python current enough to support !MoinMoin. Earlier MacOS releases (Panther and Tiger) can still be upgraded to the latest Python, which benefits from having the latest bug fixes, as well as increases performance (see "Upgrading Python" below). ||__'''Operating System'''__ ||__'''Included Python Version'''__ || || MacOS X 10.3 Panther || Python 2.3 || || MacOS X 10.4 Tiger || Python 2.3.5 || || MacOS X 10.5 Leopard || Python 2.5.1 || /!\ Mac OSX 10.5.x (Leopard) includes Python 2.5. However, the Apache installation has been upgraded to version 2.2.6, and file layout is significantly different than older versions. If you are running 10.5 and unsure of your skills, better wait until this page is updated. !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). Make sure Apache is started ('Apple' menu > 'System Preferences...' > 'Sharing' panel > and check "Personal Web Sharing") ---- == Installation == === Upgrading Python === Upgrading Python is optional because the Apple-provided version of Python meets the minimum requirements of !MoinMoin. However, upgrading to the current version will offer faster performance and improved memory usage (as well as the usual round of bug fixes). Version 2.5 is the latest as of this writing. 1. '''Download Python''' <
>The python site (http://www.python.org) has Mac-native installers supporting both PowerPC and Intel Macs. 1. '''Install'''<
>The software is a standard easy Mac-install process. Because Apple ships MacOS X with a version of Python, it's standard practice for developers to "do no harm" to the existing Apple install and instead install their version outside the normal Apple framework. 1. '''Configure'''<
>The installer configures your user account to use the version of Python you just installed. However, the system is still configured to use the Apple-supplied version. We will have to make a change to the {{{moin.cgi}}} file so that your wiki will use the new version as well (the first-line shebang will need to be changed to {{{#!/Library/Frameworks/Python.framework/Versions/2.5/bin/Python).}}} This is will be covered in more detail below in the 'Configuring moin.cgi' section. === Installing MoinMoin === 1. '''Download !MoinMoin''' * The most current version is here: MoinMoin:MoinMoinDownload 1. '''Expand the archive''' * Double-click to expand the {{{moin-X.X.tar.gz}}} archive. * 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. 1. '''Run Setup.py from the commandline''' * Open Terminal.app and enter the commands:<
> {{{ sudo -s password: }}} * Now you have root privileges in this shell (note: the prompt will change from a $ to a #). To install, type:<
> {{{ cd /temp/moin-1.6 }}} * (!) '''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.<
> {{{ python setup.py install --install-data='/moinwiki' }}} * 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'. * (!) '''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. * '''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! The installation portion is now finished. ---- == Configuration == 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}}}. === Creating a Wiki Instance === We now want to create our own wiki instance and copy in a default set of templates and files. Do these commands: {{{ cd /moinwiki/share/moin mkdir mywiki cp -r data mywiki cp -r underlay mywiki cp server/moin.cgi mywiki cp config/wikiconfig.py mywiki }}} You can repeat these steps for creating multiple instances, run these same commands again, substituting {{{mywiki2}}} for {{{mywiki}}}. === Configuring Apache httpd.conf === 1. We now need to edit Apache's configuration file, httpd.conf. Pick one of the methods below to open the file (whichever is more comfortable for you): * From the Finder, under the 'Go' menu, select "Go to folder..." and type {{{/etc/httpd}}}. Drag the ''httpd.conf'' file onto !TextEdit.app. * Or, within Terminal.app, we'll use the pico editor. At the commandline, type: {{{pico /etc/httpd/httpd.conf}}} 1. Go to the end of the Aliases section and edit like the example below:<
> {{{ Alias /wiki/ "/moinwiki/share/moin/htdocs/" ScriptAlias /mywiki "/moinwiki/share/moin/mywiki/moin.cgi" }}} 1. Save changes - * If using !TextEdit.app: save and close the file. * If using pico: type control-O to save the file and Control-X to exit pico. 1. Restart Apache - * open System Preferences, go to the Sharing page, select "Personal Web Sharing" and click "Stop" then "Start". * Alternatively, you can type {{{apachectl graceful}}} (this command tells Apache to reload its' configuration file). === Configuring moin.cgi === The moin.cgi file essentially tells Apache to run all the moin wiki pages through the python interpreter. We're simply using Python to interpret the page code, similar to how other pages are built using PHP or other language. 1. Edit the moin.cgi file at the following path {{{/moinwiki/share/moin/mywiki/moin.cgi}}}. You can use the text editor of your choice; pico or vi from within Terminal.app, or a more Mac-native editor like !TextEdit.app. Change the line that points to your wikiconfig.py file, like in the example below. <
> {{{ sys.path.insert(0, '/moinwiki/share/moin/mywiki/wikiconfig.py') }}} 1. Edit the shebang statement, if necessary: * If you did not upgrade Python - Then at this point your wiki probably works and is ready to test. Simply point your browser at http://localhost/mywiki. If that didn't work, see troubleshooting below. * If you upgraded Python - Change the first line (the shebang statement) to point to your local Python interpreter.<
>{{{ #!/Library/Frameworks/Python.framework/Versions/2.5/bin/Python }}} What to do if you get an "Internal Server Error":: This most likely means that the pathname above is not correct. :: 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. === Configuring wikiconfig.py === 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 a more Mac-native editor like !TextEdit.app. . (!) 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}}}. Edit {{{/moinwiki/share/moin/mywiki/wikiconfig.py}}} and at least change {{{sitename}}} to the name of your wiki: {{{ sitename = 'My Mac Wiki' }}} 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: {{{ data_dir = r'/moinwiki/share/moin/mywiki/data' data_underlay_dir = r'/moinwiki/share/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', ] }}} Additional configuration details can be found in HelpOnConfiguration. === Setting Permissions === You have to make the web server the owner of the files in your wiki. Unless you changed the default configuration, both are 'www'. {{{ chown -R www:www mywiki chmod -R ug+rwX mywiki chmod -R o-rwx mywiki }}} ---- == Testing Your New Wiki == In a web-browser surf to the site: http://localhost/mywiki You should see the !FrontPage of your new wiki. Now run the unit tests, to make sure everything is fine. Go to this address: http://localhost/mywiki?action=test