[Moin-devel] CVS: dist/wiki/data/text HelpOnInstalling_2fApacheOnUnix,NONE,1.1 HelpOnInstalling,1.3,1.4

J?rgen Hermann jhermann at users.sourceforge.net
Wed Jan 30 18:10:03 EST 2002


Update of /cvsroot/moin/dist/wiki/data/text
In directory usw-pr-cvs1:/tmp/cvs-serv3111

Modified Files:
	HelpOnInstalling 
Added Files:
	HelpOnInstalling_2fApacheOnUnix 
Log Message:
New install docs


--- NEW FILE: HelpOnInstalling_2fApacheOnUnix ---
## `jh at localhost:~ > `'''`...`'''[[BR]]
## `...`[[BR]]

'''Index'''
[[TableOfContents]]


== Installation into your home directory ==

Installation into your shell account's home directory is typically used on a host shared by many users and where you are ''not'' the root user. This usually implies that you cannot change the `httpd.conf` file, and also you cannot copy files into the machine's `cgi-bin` and `htdocs` directories. For this situation, Apache includes the `UserDir` directive, which maps all URLs that start with "`/~username`" to a directory in your home directory, where you have write permissions and thus can install MoinMoin.


=== Making sure /~username URLs work ===

This kind of setup can only work if your webmaster has configured the host's Apache server so that the `UserDir` mechanism works. Here's how to check for this: 

 `jh at localhost:~ > `'''`ls -ld public_html`'''[[BR]]
 `drwxr-xr-x   2 jh       users          35 Jan 31 00:29 public_html`[[BR]]

If this does not show a listing like above, then you might need to create the `public_html`directory. Note that this directory must be readable (`r-x`) by the web server.

 `jh at localhost:~ > `'''`lynx -error_file=/dev/stderr -dump http://localhost/~jh/ >/dev/null`'''[[BR]]
 `   URL=http://localhost/~jh/ (GET)`[[BR]]
 `STATUS=HTTP/1.1 200 OK`[[BR]]

You see here that we get a "`200 OK`" status response, which means that you can access your `public_html` area.
If it does not work, you will probably get a "`403 Forbidden`" or a "`404 Not Found`" response. The first one normally indicates that you need to fix the permissions of your home directory (`~`) or your `~/public_html`. But we also need to be able to execute CGI scripts, so we test that, too.

 `jh at localhost:~ > `'''`cat >~/public_html/test.cgi`'''[[BR]]
 '''`#!/bin/sh`'''[[BR]]
 '''`echo Content-Type: text/plain`'''[[BR]]
 '''`echo`'''[[BR]]
 '''`echo IT WORKS`'''[[BR]]
 '''`<CTRL-D>`'''[[BR]]
 `jh at localhost:~ > `'''`chmod a+rx ~/public_html/test.cgi`'''[[BR]]
 `jh at localhost:~ > `'''`lynx -dump http://localhost/~jh/test.cgi`'''[[BR]]
 `IT WORKS`[[BR]]

If you see anything else than "`IT WORKS`", then you are not allowed to execute CGI scripts. How you get that to work is not in the scope of this description, ask your webmaster!

A working Python installation, and a working `diff` command is also assumed.

 `jh at localhost:~ > `'''`python -V`'''[[BR]]
 `Python 2.1`[[BR]]
 `jh at localhost:~ > `'''`diff --version`'''[[BR]]
 `diff - GNU diffutils version 2.7`[[BR]]

(!) The command line examples show your input in '''`bold typewriter`''', and the sample output in `plain typewriter`. The examples use "`jh`" as the user's name, which means you have to replace your own one whereever "`jh`" appears. The same is true for version numbers (`0.11`) and download URLs.


=== Getting the distribution archive and doing the basic installation ===

The following commands will fetch and install the ''nightly CVS tarball'', i.e. the current development version. To get the official distribution version, use an appropriate URL.

 {{{
mkdir ~/tmp
cd ~/tmp
wget http://moin.sf.net/files/moin-0.11.tar.gz
tar xfz moin-0.11.tar.gz
cd moin-0.11
python setup.py --quiet install --home=$HOME --record=install.log
}}}

This will install the MoinMoin software into the directories 
"`~/lib/python/MoinMoin`",
"`~/bin`",
and "`~/share/moin`". You'll find a detailed file list in "`install.log`".


=== Setting up a wiki instance ===

The next step is to create a copy of the wiki data and the config file.
 {{{
mkdir ~/wiki
cd ~/wiki
cp ~/share/moin/cgi-bin/moin_config.py .
cp -r ~/share/moin/data .
chmod -R o+rwX data
vi moin_config.py
}}}

The last command starts the editor, you need to at least change the "`data_dir`" and "`url_prefix`" config values, as you can see in the following diff:
 {{{
@@ -28,4 +28,4 @@
 interwikiname = None
-data_dir = './data/'
-url_prefix = '/wiki'
+data_dir = '/home/jh/wiki/data/'
+url_prefix = '/~jh/wiki'
 logo_url = url_prefix + '/img/moinmoin.gif'
}}}


=== Setting up public_html and testing the installation ===

Now we create the public part of the wiki, which is directly accessible by the web browser. 
 {{{
cd ~/public_html
cp -r ~/share/moin/htdocs wiki
cp ~/share/moin/cgi-bin/*.cgi .
chmod a+rx *.cgi
}}}

To be able to execute the CGI scripts in your home directory, you need to extend Python's path within those scripts, and possibly adapt the ''bang path'' (that is the first line of the script). So, change "`test.cgi`" similarly to this diff:
 {{{
@@ -1,2 +1,2 @@
-#! /usr/bin/env python
+#! /usr/local/bin/python2.1

@@ -12,2 +12,3 @@
 import sys, cgi
+sys.path.extend(['/home/jh/wiki', '/home/jh/lib/python'])
}}}

Finally, you can test your wiki installation by running the ''Moin``Moin CGI Diagnosis'':
 {{{
lynx -dump http://localhost/~jh/test.cgi
}}}

If that test works, adapt your "`moin.cgi`" just like you did for " `test.cgi`":
 {{{
@@ -1,2 +1,2 @@
-#! /usr/bin/env python
+#! /usr/local/bin/python2.1

@@ -11,3 +11,4 @@

-#import sys
+import sys
+sys.path.extend(['/home/jh/wiki', '/home/jh/lib/python'])
 #sys.path.append('/usr/local/home/USERNAME/lib/python')
}}}

And now, your wiki should work and is available at the URL "`http://localhost/~jh/moin.cgi`". Conclude your tests by editing and saving the `FrontPage` and checking out `RecentChanges`, which should reflect that edit.

Index: HelpOnInstalling
===================================================================
RCS file: /cvsroot/moin/dist/wiki/data/text/HelpOnInstalling,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** HelpOnInstalling	2001/12/09 14:33:45	1.3
--- HelpOnInstalling	2002/01/31 02:09:49	1.4
***************
*** 1,115 ****
! HelpContents > HelpOnAdministration > HelpOnInstalling
! 
! == How to install your own MoinMoin wiki ==
! MoinMoin installation instructions can be found in the file '{{{INSTALL}}}' in the directory "{{{moin-}}}''version''" after unpacking the distribution archive. In the web, you can find this file [http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/moin/dist/INSTALL?rev=HEAD&content-type=text/vnd.viewcvs-markup here]. For Windows systems running IIS or PWS, consult [http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/moin/dist/INSTALL.IIS?rev=HEAD&content-type=text/vnd.viewcvs-markup INSTALL.IIS].
! 
!  <!> The INSTALL files describe the installation procedure ''before'' distutils support was added. Below you find new information describing that, but INSTALL still contains old information.
! 
! Also, consult the HelpOnConfiguration and HelpOnUpdating pages for additional information regarding wiki setup and maintenance. MoinMoin:MoinMoinWinCvs describes how to run your wiki using the current development version from the MoinMoin:SourceForge CVS repository.
! 
! (!) The '{{{INSTALL}}}' file suggests making a '''"sane installation"'''. I wrote up my idea of a sane installation in MoinMoin:SaneInstallation  -- Jeff Kunce
! 
! === Basic installation ===
! 
! Before you can integrate MoinMoin into your web environment,
! you have to do the basic installation using the standard Python
! ''distutils'' mechanism. We'll explain the usual steps you need to
! take to do this. For more details on the distutils installation
! process, consult the [http://www.python.org/doc/current/inst/inst.html Installing Python Modules] document of your
! Python manual.
! 
! The first step is to unpack the distribution archive, which you
! have done already when you loaded this instructions from your disk.
! If you read this on the web, the distribution comes in a versioned
! ZIP or TAR archive, which you can unpack in the usual ways, into a
! temporary directory (`/tmp` on UNIX, `C:\TEMP` on Windows). The
! distribution archive will always unpack into a directory named
! `moin-<version>`, for example `moin-0.11`.
! 
! After unpacking, to install into a specific directory (`C:\moin`
! in our example), call `setup.py` after changing your current
! directory to the distribution directory. The following commands
! can be used to complete theses steps:
!     {{{
!     unzip moin-0.11.zip
!     cd moin-0.11
!     python setup.py --quiet install --prefix=C:\moin
! }}}
! 
! This creates the following directories in "C:\moin" (note
! that on a UNIX system, the directory layout will be slightly
! different):
!     {{{
!     MoinMoin
!     MoinMoin/action
!     MoinMoin/formatter
!     MoinMoin/i18n
!     MoinMoin/macro
!     MoinMoin/parser
!     MoinMoin/py15
!     MoinMoin/scripts
!     MoinMoin/support
!     MoinMoin/twisted
!     MoinMoin/webapi
!     Scripts
!     share
!     share/moin
!     share/moin/cgi-bin
!     share/moin/data
!     share/moin/data/backup
!     share/moin/data/cache
!     share/moin/data/pages
!     share/moin/data/plugin
!     share/moin/data/plugin/action
!     share/moin/data/plugin/macro
!     share/moin/data/text
!     share/moin/data/user
!     share/moin/htdocs
!     share/moin/htdocs/css
!     share/moin/htdocs/img
! }}}
! 
! 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. There are several ways
! to do this:
! 
!     Environment variable:: Change `PYTHONPATH` in a way that is
!     persistent (`/etc/profile.d` on UNIX, `AUTOEXEC.BAT` on W9x,
!     the `Properties` item in the context menu of `My Computer` on NT4 and
!     W2K)
! 
!     Apache "httpd.conf":: Use the `SetEnv` directive to set
!     `PYTHONPATH` to a suitable value, for example: {{{
!     SetEnv PYTHONPATH "C:\moin"
! }}}
! 
!     "moin.cgi":: Directly add your installation directory to
!     the CGI driver script, like this: {{{
!     import sys
!     sys.path.append('C:/moin')
! }}}
! 
! If you use the following default installation command, MoinMoin
! will be installed to the Python directory:
!     {{{
!     python setup.py --quiet install
! }}}
! 
! You won't need to change your `PYTHONPATH` then, but depending
! on your system environment you might not be able to use that
! command, especially when you are not the root user on a UNIX
! system. If you don't know where your Python directory is, this
! command will tell you:
!     {{{
!     python -c "import sys; print sys.prefix"
! }}}
! 
! The directory structure we showed above will then be created
! in that directory. If you're interested in the exact list of
! files that are installed, use the `--record` option of distutils.
--- 1,139 ----
! HelpContents > HelpOnAdministration > HelpOnInstalling
! 
! [[TableOfContents]]
! 
! == How to install your own MoinMoin wiki ==
! MoinMoin installation instructions of previous versions can be found in the file '{{{INSTALL}}}' in the directory "{{{moin-}}}''version''" after unpacking the distribution archive. In the web, you can find this file [http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/moin/dist/INSTALL?rev=HEAD&content-type=text/vnd.viewcvs-markup here]. For Windows systems running IIS or PWS, consult [http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/moin/dist/INSTALL.IIS?rev=HEAD&content-type=text/vnd.viewcvs-markup INSTALL.IIS]. These INSTALL files describe the installation procedure ''before'' distutils support was added. Below you find new information applying to version 0.11 and up, but INSTALL still contains possibly valuable information.
! 
! Also, consult the HelpOnConfiguration and HelpOnUpdating pages for additional information regarding wiki setup and maintenance. MoinMoin:MoinMoinWinCvs describes how to run your wiki using the current development version from the MoinMoin:SourceForge CVS repository.
! 
! In the next section, there is a list of real-world [#installscenarios Installation Scenarios] that help you to understand how to apply the instructions in different environments.
! 
! Further down the page, [#installbasics Basic Installation] explains the "`setup.py`" step of the installation in more detail. This applies equally too all scenarios, and you should read it before trying a live installation.
! 
! 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.
! 
! 
! [[Anchor(installscenarios)]]
! === Sample Installation Scenarios ===
! 
! The following subpages will show you 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:
!  * /ApacheOnUnix
! 
! Windows:
!  * /ApacheOnWin32
!  * /InternetInformationServer
! 
! Macintosh:
!  * /ApacheOnMacOsx
! 
! 
! [[Anchor(installbasics)]]
! === Basic Installation ===
! 
! Before you can integrate MoinMoin into your web environment,
! you have to do the basic installation using the standard Python
! ''distutils'' mechanism. We'll explain the usual steps you need to
! take to do this. For more details on the distutils installation
! process, consult the [http://www.python.org/doc/current/inst/inst.html Installing Python Modules] document of your
! Python manual.
! 
! NOTE: You will need the Python Development package installed on unix systems for distutils to work right.
! 
! The first step is to unpack the distribution archive, which you
! have done already when you loaded this instructions from your disk.
! If you read this on the web, the distribution comes in a versioned
! ZIP or TAR archive, which you can unpack in the usual ways, into a
! temporary directory (`/tmp` on UNIX, `C:\TEMP` on Windows). The
! distribution archive will always unpack into a directory named
! `moin-<version>`, for example `moin-0.11`.
! 
! After unpacking, to install into a specific directory (`C:\moin`
! in our example), call `setup.py` after changing your current
! directory to the distribution directory. The following commands
! can be used to complete theses steps:
!     {{{
!     unzip moin-0.11.zip
!     cd moin-0.11
!     python setup.py --quiet install --prefix=C:\moin
! }}}
! 
! This creates the following directories in "C:\moin" (note
! that on a UNIX system, the directory layout will be slightly
! different):
!     {{{
!     MoinMoin
!     MoinMoin/action
!     MoinMoin/formatter
!     MoinMoin/i18n
!     MoinMoin/macro
!     MoinMoin/parser
!     MoinMoin/py15
!     MoinMoin/scripts
!     MoinMoin/support
!     MoinMoin/twisted
!     MoinMoin/webapi
!     Scripts
!     share
!     share/moin
!     share/moin/cgi-bin
!     share/moin/data
!     share/moin/data/backup
!     share/moin/data/cache
!     share/moin/data/pages
!     share/moin/data/plugin
!     share/moin/data/plugin/action
!     share/moin/data/plugin/macro
!     share/moin/data/text
!     share/moin/data/user
!     share/moin/htdocs
!     share/moin/htdocs/css
!     share/moin/htdocs/img
! }}}
! 
! 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. There are several ways
! to do this:
! 
!     Environment variable:: Change `PYTHONPATH` in a way that is
!     persistent (`/etc/profile.d` on UNIX, `AUTOEXEC.BAT` on W9x,
!     the `Properties` item in the context menu of `My Computer` on NT4 and
!     W2K)
! 
!     Apache "httpd.conf":: Use the `SetEnv` directive to set
!     `PYTHONPATH` to a suitable value, for example: {{{
!     SetEnv PYTHONPATH "C:\moin"
! }}}
! 
!     "moin.cgi":: Directly add your installation directory to
!     the CGI driver script, like this: {{{
!     import sys
!     sys.path.append('C:/moin')
! }}}
! 
! If you use the following default installation command, MoinMoin
! will be installed to the Python directory:
!     {{{
!     python setup.py --quiet install
! }}}
! 
! You won't need to change your `PYTHONPATH` then, but depending
! on your system environment you might not be able to use that
! command, especially when you are not the root user on a UNIX
! system. If you don't know where your Python directory is, this
! command will tell you:
!     {{{
!     python -c "import sys; print sys.prefix"
! }}}
! 
! The directory structure we showed above will then be created
! in that directory. If you're interested in the exact list of
! files that are installed, use the `--record` option of distutils.





More information about the Moin-devel mailing list