首页 > 技术文章 > 在apache2.4.6中配置虚拟主机支持web.py

lihuanhuan 2019-02-24 23:26 原文

 

web.py 是一个简单好用的python web框架。 (http://webpy.org/)
apache httpd是一款开源配置简单的web容器。 (http://apache.org/)

假设您使用的是apache2.4.6,您可以通过以下配置支持web.py应用。

add the config of follow to /etc/httpd/conf/httpd.conf

<VirtualHost *:443>  
    DocumentRoot "/appvol/appname"  
    ServerName app.net   
    WSGIScriptAlias / /appvol/appname/index.wsgi/  
    Alias /static  /appvol/appname/static/  
    AddType text/html .py  
    <Directory "/appvol/appname">  
     Options FollowSymLinks  
     AllowOverride All  
     Require all granted  
    </Directory>
</VirtualHost>

推荐阅读