## page was renamed from PyBlosxom/multuser ## page was renamed from zhArticleTemplate ##language:zh #pragma section-numbers on ''' 含有章节索引的中文 文章模板 ''' ::-- hoxide [<>] <> = PyBlosxom Multuser = ''简述'' PyBlosxom的多用户模式 == 软件环境 == * Windows 2003 * Python 2.4.1 * Pyblosxom 1.3 dev * Apache 2.0 * Mod_Python 3.2.5b * WSGI ref * mp_wsgi_handler == Apache 设置 == {{{ ServerAdmin hoxide@gmail.com DocumentRoot "g:/pyblog" ServerName blog.example.com AddDefaultCharset utf-8 PythonDebug off SetHandler python-program # set PythonPath to the folders containing the files. PythonPath "['g:/pyblog/myblog']+sys.path" PythonHandler mp_wsgi_handler::wsgi_handler # This should be the same as the Location above PythonOption ApplicationPath /weblog PythonOption application wsgi_app::application }}} == 修改 wsgi_app.py == {{{ #!python # Pyblosxom imports from Pyblosxom.pyblosxom import PyBlosxom from Pyblosxom import tools import pprint from string import find as _find from config import py as cfg if cfg.has_key("codebase"): sys.path.insert(0, cfg["codebase"]) ... def application(env, start_response): try: # regular application code here # ensure that PATH_INFO exists. a few plugins break if this is missing. if not 'PATH_INFO' in env: env['PATH_INFO'] = "" username = env['PATH_INFO'].split('/', 2)[1] cfg['datadir'] = "g:/pyblog/%s/datadir"%username cfg['comment_dir'] = "g:/pyblog/%s/comments"%username #env['SCRIPT_NANE'] = "%s/%s"%(env['SCRIPT_NAME'], username) env['PATH_INFO'] = env['PATH_INFO'][len(username)+1:] cfg['base_url'] = '%s://%s%s/%s' % (env['wsgi.url_scheme'], env['HTTP_HOST'], env['SCRIPT_NAME'],username) logger = tools.getLogger(logfilename) logger.debug(pprint.pformat( dict([(k , v) for k, v in env.items() if k in envdkeys]))) p = PyBlosxom(cfg, env) p.run() }}}