1.安装python 2.7   http://www.cnblogs.com/strikebone/p/3970512.html

2.安装相关前置工具  pip, Django http://www.cnblogs.com/strikebone/p/3958897.html

3.安装mysql的组件 http://www.cnblogs.com/strikebone/p/3975372.html

4.安装apxs, mod_wsgi

yum install httpd-devel.x86_64

wget https://github.com/GrahamDumpleton/mod_wsgi/archive/4.3.0.tar.gz

4.搞定apache的配置

在Apache配置文件httpd.conf中,增加一行:

LoadModule wsgi_module modules/mod_wsgi.so

<VirtualHost *:9000>
        ServerName 127.0.0.1
        DocumentRoot /home/q/abc/firstsite
        WSGIScriptAlias / /home/q/abc/apache/django.wsgi
        <Directory />
                Order deny,allow
                Allow from all
        </Directory>
        <Directory /home/q/abc/firstsite/static>
                Allow from all
        </Directory>
        alias /static/ /home/q/abc/firstsite/static/

</VirtualHost>

遇到问题可以参考这个文章:

http://abloz.com/2012/10/26/compile-and-install-apache-python-module-mod_wsgi.html

问题:访问500,看apache错误日志:Exception occurred processing WSGI script '/var/www/server/apache/django.wsgi'.
AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time.

问题解决:

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
   

最新文章

  1. 数据上下文【 DnContext】【EF基础系列7】
  2. Android 实现分页(使用TabWidget/TabHost)
  3. hihocoder-平衡树&#183;SBT
  4. 最全面的Java多线程用法解析
  5. mybatis系列-16-spring和mybatis整合
  6. WS103C8例程——串口2【worldsing笔记】
  7. Linux如何用QQ?Linux下QQ使用的几种方案
  8. HDU-------An Easy Task
  9. 安卓EditText按钮
  10. 使用EntityFramework中DbSet.Set(Type entityType)方法碰到的问题
  11. select2 取值 遍历 设置默认值
  12. UITableViewStyleGrouped模式下多余间距
  13. 07Axios
  14. promise在angular中的基本使用
  15. yii js
  16. zabbix3.x自动发现主机
  17. VMware Workstation 安装 mac OS 时遇到 不可恢复错误: (vcpu-0)
  18. 专访UI中国认证设计师卤大湿 | 一位UI大师关于UI设计的思考
  19. Spring事务传播属性介绍(二).mandatory、not_supported、never、supports
  20. 项目中遇到的问题——jsp:include

热门文章

  1. cookie、session的自我介绍
  2. pyotherside 试用
  3. 【转】第六章、Linux 的文件权限与目录配置
  4. 【Bitmap Index】B-Tree索引与Bitmap位图索引的锁代价比较研究
  5. slf4j-api、slf4j-log4j12、log4j 之间是什么关系?
  6. bzoj1085 骑士精神
  7. Date类型之继承方法
  8. 显式等待大结局___封装成API方便控制层调用
  9. POJ 3666 Making the Grade (线性dp,离散化)
  10. 杂项:node.js