Easy Web based install
It is not easy to install Moin on a typical web hosting service and this is a problem for Moin wide trial and adoption. We should provide a web based form that runs on those hosts, that installs Moin and creates the first wiki instance.
Even if it is not what the same type of Wikiengine, MediaWiki was running in 2 minutes in a very standard host with a typical web based panel. In contrast, a Moin installation needs more skill and access (basically shell access) that most of our possible users have.
In this context a typical web host service means that it:
- has ftp access,
comes with a panel (like Cpanel for example)1,
- runs Apache,
- is administrated by a user with no linux nor any type of administration knowledge or experience, and
- has no ssh or shell access.
We should provide an easier installation script that runs on these web hosting services. Installing Moin should be something like:
- Download the compressed file.
- Decompress it locally.
- Upload to the public html directory.
Point the browser to http://mydomain.tld/moinmoin/install.cgi
- Follow the instructions.
The script functions, or steps, could be:
Check if a python with the required version is present2.
Ask for the basic information3:
- Apache user/group.
- Wiki name.
- A logo to upload (optional).
- First user name, mail and password.
- Select language (so it installs the right lang in /underlay)
- Ask if there are more wikis planned in the near future (in order to make an initial farm configuration).
- Optional smtp and return address for mail support.
- Create the first wiki instance.
- Create a basic wikiconfig.py and set:
sitename and logo_string.
acl_rights_before for that first user.
page_front_page to wiki_name_wiki or similar.
default_lang the specified one.
mail_smarthost if it was specified and mail_from.
- Send him/her to the home page with pointers for more info in the Moin site.
- Delete the install directory or points the user to do so.
What follows is a rough user interface prototype:
Comments
If someone wants to start on this, please split this into multiple parts:
- a install cgi script doing the necessary install steps and uses a manually edited/uploaded config file
- migration/upgrade cgi
- backup / restore cgi
- (later and optional) a form based config cgi script
The config cgi is optional and can be done later. Everything it could do can be done easily (and far more flexible) with a local text editor and the resulting config ftped / POSTed to the server.
Since I am not programmer, does any of the scripts like ScriptMarket/WikiCreationScript or ScriptMarket/MakeWiki (maybe modified) works?
I think that if this is run as a cgi you would not need to know the apache user/group. Not absolutely sure though. I really like the mock-up! -- TimCera 2006-04-18 21:37:20
Thanks. More kudos to Inkscape than to me. -- EduardoMercovich 2006-04-18 22:06:26
See also SaneInstall.
A plan page from an SoC applicant: PeterBurns/EasyWebBasedInstall
Project size estimation
ThomasWaldmann guesses that this is a 100% GoogleSoc2006 project, as it includes install, upgrade, backup, restore and config sub-tasks, plus web-based UI for that, plus web-based moin config UI (amount of that can be adjusted to some degree), plus quite some testing, plus good end-user level documentation about how to use it.
If the project size seems to large, backup/restore/etc. should not be considered as a necessary part of an installer. -- AlexanderSchremmer 2006-04-27 22:25:32
- (please add your SOC size guess here).
Hi, I'm Vincenzo Ampolo. 2 days ago i installed MoinMoin on a debian system and i've created a python script to install MoinMoin with easy steps. This script can be good for the new web based installation.
On a debian system after that you do: apt-get install python-2.3-moinmoin you can execute this script:
1 import os
2 import sys
3 import shutil
4 import re
5 import getopt
6 import pwd #only on linux
7 def CommandSubstitute(fileToOpen, pattern, with, number):
8 """Substitute a pattern in a file
9 Returs a list of string containing all the Text file, one line for each element."""
10 f = open(fileToOpen, "r+")
11 output = []
12 for line in f.readlines():
13 if number:
14 if re.search(pattern, line) is not None:
15 line = re.sub(pattern, with, line)
16 if number is True:
17 pass
18 else:
19 number -= 1
20 output.append(line)
21 f.close()
22 return output
23 def WriteToFile(fileToOpen, output):
24 """Write a list of lines in a file
25 """
26 f = open(fileToOpen, "w")
27 for line_out in output:
28 f.write(line_out)
29 f.close()
30 #Get informations
31 path = raw_input("Enter the PATH in which you would set up a wiki instance: ")
32 instance = raw_input("Enter the name of your instance: ")
33 username = raw_input("Enter the name of the user that will own the wiki: ")
34 #Check and create directories
35 if not os.path.isdir(path):
36 os.mkdir(path)
37 if instance is not '':
38 root = path + '/' + instance
39 os.mkdir(root)
40 else:
41 root = path
42 #Copy all the moin structure into the istance (for debian systems only)
43 shutil.copytree('/usr/share/moin/data', root+'/data', True)
44 shutil.copytree('/usr/share/moin/underlay', root+'/underlay', True)
45 shutil.copy('/usr/share/doc/python2.3-moinmoin/examples/server/moinmodpy.py', root)
46 shutil.copy('/usr/share/moin/config/wikiconfig.py', root)
47 #set the correct permissions and owners
48 server = pwd.getpwnam('www-data')
49 user = pwd.getpwnam(username)
50 for place, dirs, files in os.walk(root):
51 for dire in dirs:
52 for name in files:
53 os.chmod(os.path.join(place, name), 0774)
54 os.chown(os.path.join(place, name), user[2], server[3])
55 os.chmod(place, 0774)
56 os.chown(place, user[2], server[3])
57 newFile = CommandSubstitute(os.path.join(root, 'wikiconfig.py'), './data/', os.path.join(root, 'data'), True)
58 WriteToFile(os.path.join(root, 'wikiconfig.py'), newFile)
59 newFile = CommandSubstitute(os.path.join(root, 'wikiconfig.py'), './underlay/', os.path.join(root, 'underlay'), True)
60 WriteToFile(os.path.join(root, 'wikiconfig.py'), newFile)
61 newFile = CommandSubstitute(os.path.join(root, 'moinmodpy.py'), '/path/to/wikiconfig', '.', True)
62 WriteToFile(os.path.join(root, 'moinmodpy.py'), newFile)
63 #installation finished
64 print ''
65 print ''
66 print ''
67 print '----------'
68 print "Congratulations, you have installed MoinMoin. There is just one little thing to do: make your web server able to use MoinMoin. If you use apache2 and you use VirtualHosts you can add a new VirtualHost with this configuration:"
Then you must configure your apache web server to work with mod_python as described upper and you can start creating new pages.
http://www.cpanel.net/ is a web based control panel for frequent admin functions like managing mail and ftp accounts, databases, spam filters, apache configuration, a file manager, etc. (1)
If not, send to a special page in MoinMaster. (2)
Each input has to have a link to more explanation for the non-expert user, maybe in MoinMaster too. (3)