Apache基础配置、wsgi、moinmoin

Apache的简单配置

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

# phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin


    Options Indexes FollowSymLinks
    DirectoryIndex index.php

    
        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 .
    




# Authorize for setup

   
    AuthType Basic
    AuthName "phpMyAdmin Setup"
    AuthUserFile /etc/phpmyadmin/htpasswd.setup
   

    Require valid-user


# Disallow web access to directories that don't need it

    Order Deny,Allow
    Deny from All


    Order Deny,Allow
    Deny from All

模仿一例

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


    Options Indexes FollowSymLinks

安装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

    Order allow,deny
    Allow from all

网站文件

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

    Order allow,deny
    Allow from all


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

    Order allow,deny
    Allow from all

网站文件

#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页面的默认内容。

你可能感兴趣的:(环境配置,尝鲜,apache,phpmyadmin,application,output,php,import)