moinmoin 在ubuntu 16.04 的安装
moinmoin是python写的一个wiki引擎. 应用广泛,支持多种扩展, 可二次开发。
python版本: python2.7 (monmoin目前是不支持python3)
安装python开发包与pip:
$sudo apt-get install python-dev python-pip
安装uwsgi:
$sudo pip install uwsgi
安装moinmoin
1 | $sudo wget http://static.moinmo.in/files/moin-1.9.8.tar.gz |
安装完之后,
moinmoin代码包位于 /usr/local/lib/python2.7/dist-packages/
moinmoin数据以及配置包位于 /usr/local/share/moin
配置moinmoin
1 | $sudo cd /usr/local/share/moin |
# 添加以下两行。主要配置Moinmoin的代码与配置安装路径
1 | sys.path.insert(0, '/usr/local/lib/python2.7/dist-packages/') |
创建uwsgi.ini 配置文件
1 | $sudo vi uwsgi.ini |
创建uwsgi log文件夹
1 | $sudo mkdir -p /var/log/uwsgi |
创建初始脚本用于启动moinmoin.
该脚本主要用于在server重启之后能够使用uwsgi来启动Moinmoin
1 | $sudo vi /etc/init/moin.conf |
配置wiki
1 | $sudo cd /usr/local/share/moin |
改变moin目录的Owner权限
1 | $sudo chown -R www-data: /usr/local/share/moin |
启动moin
1 | $sudo start moin |
到目前为止,moinmoin已配置完成并已经启动了。接下来搭配nginx来使用wiki
安装nginx
1 | $sudo apt-get install nginx |
配置nginx
1 | $sudo cd /etc/nginx/sites-available |
启动nginx
1 | $sudo service nginx restart |
访问moinmoin
在浏览器输入服务器的地址就可以对moinmoin进行访问了
将moinmoin配置到服务器的子路径
以上基于服务器根路径的moinmoin就已经搭建好了,但是真正用的时候,还是不会把他放到根路径,所以下面就介绍部署到子路径的方法.
如果将moinmoin的路径配置在/wiki的路径,需要修改/etc/nginx/sites-available/moin 文件中
1 | location ^~ /wiki { |
还要需要wikiconfig.py,这个文件中的url_prefix_static是他的服务器路径前缀,需要在这里进行加入子路径的字符串。
1 | $vi /usr/local/share/moin/wikiconfig.py |
启动服务
1 | $sudo start moin |
访问服务器主机的子路径就可以访问到moinmoin了