How to deploy MoinMoin on Nginx and uwsgi using Python scripts

Source: Internet
Author: User
This article describes how to deploy MoinMoin on Nginx and uwsgi using Python scripts. The example is based on the CentOS operating system, for more information about how to use apache + mod_wsgi to deploy MoinMoin in CentOS, but it is slow to edit and save the page.

This document assumes that Quick MoinMoin on CentOS has completed basic installation beyond apache and mod_wsgi following official instructions.
Install Nginx

By default, CentOS without nginx source, you need to manually add, access the http://nginx.org/en/linux_packages.html#stable to download CentOS 6 rpm package, and install

wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpmrpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm

Run the following command to install nginx:

Yum install nginx

Install uwsgi

Install python package management tool pip

yum install python-devel python-setuptoolswget https://raw.github.com/pypa/pip/master/contrib/get-pip.py -O - | python

Install uwsgi using pip (using the image of Douban)

pip install -v uwsgi -i http://pypi.douban.com/simple

Start moin with uwsgi

Create uwsgi configuration/etc/uwsgi. xml as follows

 
  
   /var/run/moin.sock
                                             
  
   666
  
  
   256
  
  
   6
  
  
  
  
  

Where 666 This statement prevents nginx from having no permission to access moin. sock.

Rename the moin wsgi STARTUP script to be recognized by uwsgi.

cd /usr/local/share/moinmv moin.wsgi moin_wsgi.py

To start uwsgi, run the following command:

uwsgi -x /etc/uwsgi/uwsgi.xml

Configure nginx to access uwsgi

Create/etc/nginx/conf. d/moin. conf as follows:

# Moinmoin VM configuration server {listen YOUR_SERVER_IP: 80; server_name localhost; access_log/var/log/nginx/moin. access_log main; error_log/var/log/nginx/moin. error_log info; location ^ ~ /{Include uwsgi_params; uwsgi_pass unix: // var/run/moin. sock; # export UWSGI_PYHOME/usr/local/lib/python2.6/; # site-packages/; export UWSGI_CHDIR/usr/local/share/moin/; uwsgi_param UWSGI_SCRIPT moin_wsgi; uwsgi_param SCRIPT_NAME/; uwsgi_modifier1 30;} location ^ ~ /Moin_static193/{alias/usr/local/lib/python2.6/site-packages/MoinMoin/web/static/htdocs/; add_header Cache-Control public; expires 1 M ;}}

Run nginx

nginx

Operation and troubleshooting

Next, you can access the Wiki through a browser. However, you find that editing and saving pages are still slow. Then, after a little Google, you will find an article to solve this problem and quickly solve the problem.

Edit wikiconfig. py and add the following Configuration:

Log_reverse_dns_lookups = False

Restart uwsgi and access Wiki again. The slow problem is solved. (why didn't I find this article before !)

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.