PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : MoinMoin Wiki



24dan
27.12.06, 19:36
Hallo habe nach der Anleitung von der MoinMoin Wiki Seite meine Wiki auf meinem Server installiert (Debian sarge 3.1)

http://moinmoin.wikiwikiweb.de/HelpOnInstalling/ApacheOnLinux#head-e3e9e08058bb0ae34c33f53367cd58d6c7411998

Jetzt bekomme ich aber beim letzten Schritt folgende Fehlermeldung:



ConfigurationError

ImportError: No module named wikiconfig

Check that the file is in the same directory as the server script. If it is not, you must add the path of the directory where the file is located to the python path in the server script. See the comments at the top of the server script.

Check that the configuration file name is either "wikiconfig.py" or the module name specified in the wikis list in farmconfig.py. Note that the module name does not include the ".py" suffix.

If you want to report a bug, please save this page and attach it to your bug report.


Kann jemand helfen?

delmonico
27.12.06, 19:37
Ist das Verzeichnis, in dem MoinMoin installiert wurde, in deinem PYTHONPATH?
edit: hehe, steht sogar in der Fehlermeldung ;)

fuffy
27.12.06, 19:41
Hi!

Hast du die Datei moin.cgi bearbeitet wie es in der Anleitung steht?

Gruß
fuffy

24dan
27.12.06, 19:41
Danke für die prompte Hilfe.
Wie kann ich denn die wikiconfig.py in dem PYTHONPATH bekannt machen?
etwa:


expert PYTHONPATH=/Pfad/zu/der/wikiconfig.py


???

PS: moin.cgi wurde bearbeitet...

24dan
27.12.06, 19:51
Hier meine Notizen zur Installation:
1 Moin Moin Wiki Installation als root

1. Prüfen ob Python installiert ist


> python -V
Python 2.3.4


2. Moin Moin Wiki downloaden und entpacken \\
- http://sourceforge.net/projects/moin/


> tar xzf moin-1.5.0.tar.gz
> cd moin-1.5.0


3. Installieren im /usr Verzeichnis


> export PREFIX=/usr
> python setup.py --quiet install --prefix=$PREFIX --record=install.log


4. Test der Installation\\
- hierzu gib folgendes in die Shell ein:


> python
Python 2.3.4 (#1, May 29 2004, 17:05:23)
[GCC 3.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MoinMoin
>>>

- Verlassen kannst Du python mit "STRG"+"D"

5. Wichtige Ordner des MoinMoinWiki prüfen:\\
- 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
\\

- Siehe in die Datei install.log wo die Daten jetzt fürs Wiki liegen


> egrep "data" install.log


6. Sicherheitshinweise:

7. Erstellen einer Instance von MoinMoinWiki
- Finde heraus welcher User bei Dir Dein Apache-Server am laufen hält:


> egrep "^User|^Group" /etc/httpd/httpd.conf
User www-data
Group www-data

- TIP: es kann sein, dass "httpd" durch "apache" oder "apache2" ersetzt werden muss.

- Suche Dir einen Namen für Dein Wiki aus: z.B. rechnerwiki
- dann setzte folgendes als root in der shell ab:


> export PREFIX=/usr # this might be something else
> export SHARE=$PREFIX/share/moin # this should be correct for most people
> export WIKILOCATION=$SHARE # this is just an example
> export INSTANCE=rechnerwiki # this is just an example
> export USER=www-data
> export GROUP=www-data


8.1 kopieren der Dateien


> cd $WIKILOCATION
> mkdir $INSTANCE # make a directory for this instance
> cp -R $SHARE/data $INSTANCE # copy template data directory
> cp -R $SHARE/underlay $INSTANCE # copy underlay data directory
> cp $SHARE/config/wikiconfig.py $INSTANCE # copy wiki configuration sample file

8.2 Rechte vergeben:


> chown -R $USER.$GROUP $INSTANCE # check that USER and GROUP are correct
> chmod -R ug+rwX $INSTANCE # USER.GROUP may read and write
> chmod -R o-rwx $INSTANCE # everybody else is rejected


9. moin.cgi script erstellen zur Verknüpfung von Apache mit dem Wiki
- über diese script werden alle Anfrage an das Wiki gehändelt:


> cd $WIKILOCATION/$INSTANCE
> mkdir cgi-bin
> cp $SHARE/server/moin.cgi cgi-bin
> chown -R $USER.$GROUP cgi-bin
> chmod -R ug+rx cgi-bin
> chmod -R o-rwx cgi-bin


- Ändern der sys Pfade in der moin.cgi Datei unter $WIKILOCATION/$INSTANCE/cgi-bin/
- Suchen nach den zu ändernden Pfaden:


> find / -name "site-packages" # Ausgaben merken höhere Versionsnummer eintragen
> find / -name "wikiconfig*" # Ausgaben merken

- jetzt die Datei ändern:

> pico /Pfad/zu/rechnerwiki/cgi-bin/moin.cgi

- Ausschnitt aus der bearbeiteten Datei mit den neuen Pfaden



...
# System path configuration

import sys

# Path to MoinMoin package, needed if you installed with --prefix=PREFIX
# or if you did not use setup.py.
sys.path.insert(0, '/usr/local/lib/python2.4/site-packages')

# Path of the directory where wikiconfig.py is located.
# YOU NEED TO CHANGE THIS TO MATCH YOUR SETUP.
sys.path.insert(0, '/usr/share/moin/rechnerwiki')

...


10. Apache konfigurieren:
- Datei: /etc/apache2/apache2.conf


> echo "" >>/etc/httpd/httpd.conf
> echo "Alias /wiki/ \"$SHARE/htdocs/\"" >>/etc/httpd/httpd.conf
> echo "ScriptAlias /rechnerwiki \"$WIKILOCATION/$INSTANCE/cgi-bin/moin.cgi\"" >>/etc/httpd/httpd.conf

- httpd kann evt. durch apache oder apache2 ersetzt werden

11 MoinMoin konfigurieren
- ändern der Datei wikiconfig.py unter /Pfad/zu/rechnerwiki/


...
# Location of your STATIC files (css/png/js/...) - you must NOT use the
# same for invoking moin.cgi (or, in general, the moin code).
# url_prefix must be '/wiki' for Twisted and standalone servers.
# For CGI, it should match your Apache Alias setting.
url_prefix = '/rechnerwiki'
...


12. Testen
- Neustarten des Apache2 servers:


> invoke-rc.d apache2 restart

- MoinMoin CGI Diagnosis aufrufen:


"http://127.0.0.1/rechnerwiki?action=test"

fuffy
27.12.06, 19:55
Die Datei /usr/share/moin/rechnerwiki/wikiconfig/wikiconfig.py existiert?

Gruß
fuffy

24dan
27.12.06, 20:06
Oh, vielen Dank für die richtige Frage.

Okay, hier habe ich mich vertan: Ich dachte nicht das rechnerwiki/wikiconfig als Ordner angesehen wird und wikiconfig.py darin gesucht und entspechend nicht gefunden wird.

24dan
27.12.06, 20:09
Ja es funktioniert ... so dass war ja richtig schnelle, tolle Hilfe. Danke.

Also die obenstehende Anleitung habe ich jetzt entsprechend geändert.
Die ist jetzt für mich so zum Abschluss gebracht und hilft hoffentlich auch anderen.

czerwinski1977
08.01.07, 18:51
Hallo,

ich stehe vor dem gleichen Problem: Fehlermeldung wie im 1. Posting beschrieben. Soweit ich es verstanden habe, ist das Problem, dass die Datei wikiconfig.py nicht gefunden werden kann. Der Pfad zu dieser Datei wird in main.cgi durch das sys.path.insert statement angegeben -- oder geht es um eine übergeordnetes Verzeichnis?
Wie kann ich das Problem beheben?

Danke!

Cz.

fuffy
08.01.07, 19:45
Hi!

Wie in der Dokumentation beschrieben, musst du in der main.cgi den Pfad zu dem Verzeichnis, in dem sich die wikiconfig.py befindet, angeben, also den kompletten Pfad ausschließlich "/wikiconfig.py". Dafür nimmst du einen Texteditor. ;)

Gruß
fuffy

czerwinski1977
12.01.07, 12:56
Sorry, es funktioniert nicht.

moin.cgi:
sys.path.insert(0, 'D:\FileSe~1\ZBNALL~1\wiki\cytowiki')

Rufe ich aus diesem Verzeichnis python moin.cgi auf, dann erhalte ich ein HTML das auch die Einstellungen aus wikiconfig.py übernimmt.

Versuche ich die Seite über den Browser zu öffnen, dann kommt wieder die Fehlermeldung.

Verwende ich allerdings den Pfad der wikiConfig Vorlage, dann kann ich die Seite öffnen:
sys.path.insert(0, 'c:\programme\moin\share\moin\config')

Woran kann das liegen?

Danke für Tipps & Links!

Cz.

czerwinski1977
12.01.07, 13:58
I was able to fix the situation. It seems as if spaces in paths trouble python, even if they are hidden by the 8.3 notation (xxxxxx~1). I had to move the directory to a location where it is reachable w/o spaces -- works.

Ach ja, nochmals auf Deutsch: Das Problem waren die Leerzeichen im Pfad, die selbst bei Verwendung der 8.3 Schreibweise (xxxxxx~1) Probleme machen. Hab das Verzeichnis an einen Ort ohne Spaces verschoben -> läuft.