Apache基础配置、wsgi、moinmoin

本文详细介绍了Apache服务器的配置方法,包括PHPMyAdmin的设置、Wsgi程序的安装与配置过程,以及MoinMoin的部署步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Apache的简单配置

phpmyadmin 的默认配置,位置在/etc/apache2/conf.d/。

# phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
    Options Indexes FollowSymLinks
    DirectoryIndex index.php

    <IfModule mod_php5.c>
        AddType application/x-httpd-php .php

        php_flag magic_quotes_gpc Off
        php_flag track_vars On
        php_flag register_globals Off
        php_value include_path .
    </IfModule>

</Directory>

# Authorize for setup
<Directory /usr/share/phpmyadmin/setup>
    <IfModule mod_authn_file.c>
    AuthType Basic
    AuthName "phpMyAdmin Setup"
    AuthUserFile /etc/phpmyadmin/htpasswd.setup
    </IfModule>
    Require valid-user
</Directory>

# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/libraries>
    Order Deny,Allow
    Deny from All
</Directory>
<Directory /usr/share/phpmyadmin/setup/lib>
    Order Deny,Allow
    Deny from All
</Directory>

模仿一例

Alias /blog /var/www/blog.mytest.com/

<Directory /var/www/blog.mytest.com/>
    Options Indexes FollowSymLinks
</Directory>

安装wsgi程序

安装mod_wsgi

apt-get install libapache2-mod-wsgi

Apache配置
# /etc/apache2/sites-available/wsgi.mytest.com
WSGIScriptAlias /wsgi /home/fruitschen/www/wsgi.mytest.com/first.wsgi
<Directory /home/fruitschen/www/wsgi.mytest.com>
    Order allow,deny
    Allow from all
</Directory>
网站文件
def application(environ, start_response):
    status = '200 OK'
    output = 'Hello World!'
    response_headers = [('Content-type', 'text/plain'),
                        ('Content-Length', str(len(output)))]
    start_response(status, response_headers)
    return [output]
Deamon模式
WSGIDaemonProcess localhost processes=2 threads=15
WSGIProcessGroup localhost
WSGIScriptAlias /wsgi /home/fruitschen/www/wsgi.mytest.com/first.wsgi
<Directory /home/fruitschen/www/wsgi.mytest.com>
    Order allow,deny
    Allow from all
</Directory>


wsgi文件被修改的时候会自动重启app,如果源代码的修改不在wsgi文件中,可以touch wsgi文件。

安装MoinMoin

下载 http://moinmo.in/MoinMoinDownload
解压,~/src/moin-1.9.3/
python setup install ...

Apache配置

/etc/apache2/sites-available/moin.mytest.com

WSGIDaemonProcess moin processes=2 threads=15
WSGIProcessGroup moin
WSGIScriptAlias /moin /home/fruitschen/www/moin.mytest.com/moin.wsgi
<Directory /home/fruitschen/www/moin.mytest.com>
    Order allow,deny
    Allow from all
</Directory>
网站文件

#moin.wsgi

import sys, os
sys.path.insert(0, '/home/fruitschen/www/moin.mytest.com/config')
from MoinMoin import log
log.load_config('/home/fruitschen/www/moin.mytest.com/log.txt')
from MoinMoin.web.serving import make_application
application = make_application(shared=True)

将~/src/moin-1.9.3/wiki 下的 config, data, underlay 文件夹复制到 /home/fruitschen/www/moin.mytest.com/。
按照注释修改config/wiki_config.py

 

安装之后有问题,没有ResentPages和HelpContents页面的默认内容。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值