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