Moinmoin1.8.3 is finally installed. Write down the steps for future use. Because you do not understand apache2, Python, and moinmoin, you can follow these steps: 1. Open the terminal and switch to Sudo-I as the administrator.

Source: Internet
Author: User

Moinmoin1.8.3 is finally installed. Write down the steps for future use. Since apache2, Python, and moinmoin are not understood, they are all rigid steps:

1. Open the terminal and switch to the administrator privilege.

Sudo-I

2. Install apache2

Apt-Get install apache2

3. Download moinmoin1.8.3

Official Website

4. Decompress moinmoin 1.8.3 tar.gz to a directory where/opt/moinmoin-1.8.3 is used. See the/opt/moinmoin-1.8.3/docs/install.html document before installation.

5. Install the/opt/moinmoin-1.8.3 directory on the terminal

CD/opt/moinmoin-1.8.3
Python-V setup. py -- Quiet install -- Record = install. Log

After installation, you can view the Installation Log File install. log in the current directory, which records some information about the installation process. The moinmoin wiki template file is installed in the/usr/local/share/Moin directory. If you want to specify the location of the moinmoininstallation, you can refer to the install.html document mentioned above to modify the installation command.

Test whether the moinmoin installation is correct:

Python

At the ">>>" prompt, enter:

Import moinmoin

If there is only a ">" prompt, it indicates that the moinmoin installation is correct. If the prompt "... Importerror: No module named moinmoin "indicates that there is a problem with moinmoin installation.

Exit Python:

Exit ()

6. Install a moinmoin instance

The template directory/usr/local/share/Moin contains the following important directories:

/Usr/local/share/Moin/data: stores Wiki pages, users, and etc. It can only be accessed by moinmoin.
/Usr/local/share/Moin/underlay: stores the default Wiki pages, help documents in multiple languages, and default page documents. It can only be accessed by moinmoin.
/Usr/local/share/Moin/htdocs: stores webpage elements, slices, and theme styles. Can be accessed by Web Server (Apache, IIS, and so on.
/Usr/local/share/Moin/Server: An example of a server startup script.
/Usr/local/share/Moin/config: Example of storing the configuration file.

By copying files in the template directory, you can generate different wiki instances (multiple wiki sites ).

First, select the installation location of the Wiki instance, assuming that the installation is in the/usr/local/var/Moin directory. Copy data, underlay, and wikiconfig. py in the moinmoin wiki template directory to the Wiki instance directory:

Mkdir/usr/local/var/Moin
CP-RF/usr/local/share/Moin/data/usr/local/var/Moin
CP-RF/usr/local/share/Moin/underlay/usr/local/var/Moin
CP/usr/local/share/Moin/config/wikiconfig. py/usr/local/var/Moin

Export install.html. To create multiple wikis, you only need to have an underlay directory in the system, but you have not tried it yet.

7. Set the permissions to access the Wiki instance directory for the user group and user of apache2. You can view the/etc/apache2/envvars file and find that the user group and User Name of apache2 are www-data.

Chown-r www-data.www-data/usr/local/var/Moin
Chmod-r ug + rwx/usr/local/var/Moin # user. Group may read and write
Chmod-R o-rwx/usr/local/var/Moin # Everybody else is rejected

8. Install Moin. cgi

CD/usr/local/var/Moin
Mkdir cgi-bin
CP/usr/local/share/Moin/Server/Moin. cgi-bin
Chown-r www-data.www-data/usr/local/var/Moin/cgi-bin
Chmod-r ug + Rx/usr/local/var/Moin/cgi-bin
Chmod-R o-rwx/usr/local/var/Moin/cgi-bin

Gedit/usr/local/var/Moin/cgi-bin/Moin. cgi

Add the following two lines at the beginning of Moin. cgi and save them.

Import sys

SYS. Path. insert (0, '/usr/local/var/Moin /')

9. Configure apache2

Gedit/etc/apache2/httpd. conf

Add the following content:
Alias/moin_static183/"/usr/local/share/Moin/htdocs/" ### moin_static183 is named differently from wikiconfig of the Wiki instance based on the Moin version. the url_prefix_static match in The py file. No matter how many wiki instances are running, you only need to define alias once
ScriptAlias/Moin "/usr/local/var/Moin/cgi-bin/Moin. cgi" ### each wiki instance defines a ScriptAlias
<Directory/usr/local/share/Moin/htdocs> ### Open Directory Permissions
Order allow, deny
Allow from all
</Directory>

<Location/Moin>
Sethandler Python-Program
Pythonpath "['/usr/local/var/Moin/'] + SYS. path"
Pythonhandler moinmoin. Request. request_modpython: request. Run
Pythoninterpreter first
</Location>

10. Configure the moinmoin Environment

Modify the wikiconfig. py file in the Wiki instance directory. Because the default file is ISO-8859-15 rather than UTF-8 encoding, to enter Chinese characters in the SAVE will appear garbled, so the file is converted to UTF-8 encoding.

The following method can be used to achieve the above purpose:

MV wikiconfig. py wikiconfig_en.py
Gedit wikiconfig_en.py

Save it as wikiconfig. py, note that you select character encoding as UTF-8.

Gedit wikiconfig. py

Modify part of wikiconfig. py:

Data_dir = '/usr/local/var/Moin/data /'
Data_underlay_dir = '/usr/local/var/Moin/underlay /'
Url_prefix_static = '/moin_static183'
Export age_default = 'zh'
Page_category_regex = U' ^ category [A-Z] | class $'
Page_dict_regex = U' [A-Z] dict $ | dictionary $'
Page_form_regex = U' [A-Z] Form $ | table $'
Page_group_regex = U' [A-Z] group $ | group $'
Page_template_regex = U' [A-Z] template $ | template $'

Depending on the Moin version, '/moin_static183' is different.
Other content can be modified later as needed.

11. Restart The apache2 server. Restart Apache after modifying wikiconfig. py.

/Etc/init. d/apache2 restart

12. Access http: // localhost/Moin

Note: python is already installed in Ubuntu. You can view the version on the terminal.

Python-V

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.