Apache:To Config The Vhost of Django Project
It is not a good idea to use dev server in Production Environment.
Apache or Nginx are good choice.Both of them are of great used as the web server.
I'm trying to deploy in apache.
The File Structre:
If you've read djangoproject's documentation,you will find that my project's file structure is a bit different from what the documentation show(via)
Both are ok.

Imagine that you have the apache installed.And now ,lets do it 1 by 1.
Step 1:Edit The httpd.conf
/path/to/the/apache/conf/thhpd.conf
Add a new line just at the end of the file.It seems to be looked like this:

The windows WAMP version:

You need do nothing but just add this line in httpd.conf.I suggest you to do like that,because to config your apache_django project in a included file will not break the protect the integrity of httpd.conf.
Step 2:Add mod_wsgi in to the modules path of apache:
While the Python gets a x86 and x64 version, and it is the same with the mod_wsgi
First, download the right version of mod_wsgi.For example,I have Python2.7.x.amd64 and Apache 2.4.x installed in my pc(x64).So, I need to use (via)

Uzip the package and you will get a mod_wsgi.so.
Put it in the apache modules

Step 3:Edit the apache_django.conf and apache_django.wsgi
Apache_django.conf
Ps.in this config file,I load the mod_wsgi module,config the vietual python env
Listen the 8000 port which is used in my django project and in the <VirtualHost 127.0.0.1:8000> ….. </VirtualHost> I config something of my project.

Apache_django.wsgi
In this file ,I add the project into the python path so that django driver can get the application

Step 4:cp the project files in to the www:
Seems like that:

Let's check into it

After all above,restart apache server.type http://127.0.0.1:8000

Shit,what's happened?
Check in the log path No Error found

Check httpd.conf:

Add this:

Check www root:seems ok

OK,restart apache:
Near to success!

Check in the error log:

….No module…….orz….
Apache_django.wsgi line 3

Maybe there's something wrong with my WSGIPythonPath

Let's have a look at where the virtual env's site-packages are:

……………………………………..orz…
Change it!

Restart apache service! 


I give up…
Tomorrow will be ok
Time to sleep…
Apache:To Config The Vhost of Django Project的更多相关文章
- Start Your Django Project in Nginx with uWsgi
Step 0:Install A,B,C,blabla needed This can be seen in my another article in the blog.click here(una ...
- Prepare tasks for django project deployment.md
As we know, there are some boring tasks while deploy Django project, like create db, do migrations a ...
- [Python] Create a Django project in Pycharm
From: http://blog.csdn.net/u013088062/article/details/50158239 From: http://blog.csdn.net/u013088062 ...
- Django project troubleshootings
1. 当django project文件夹放到cgi-bin目录下面时会出现下面的错误: [Wed Jan 09 01:52:52.611690 2019] [core:notice] [pid 15 ...
- django project 的快速构建
2003年,堪萨斯(Kansas)州 Lawrence 城中的一个 网络开发小组 ——World Online 小组,为了方便制作维护当地的几个新闻站点(一般要求几天或者几小时内被建立),Adrian ...
- 18 12 30 新建一个 django project
1. 新建一个 django project 1 2 django-admin.py startproject project_name 特别是在 windows 上,如果报错,尝试用 django- ...
- My First Django Project (3) - Apache set up
Holy moly!!!!因为漏了一下斜杠,害我反复调试了2,3天,无法读取static 文件,一直找不出原因,后来在apache的error.log中发现了原因. 1. 下载了apache 2.4, ...
- Django project structure: how does static folder, STATIC_URL, STATIC_ROOT work
So I've been messing up with Django(1.6+) project setting for quite sometime, this is what i finally ...
- Linux下安装Apache并以mod_wsgi方式部署django站点
源码编译方式安装Apache 首先下载Apache源码压缩包,地址为http://mirror.bit.edu.cn/apache/httpd/ 继续下载apr和apr-util压缩包,地址为http ...
随机推荐
- UML类图详细介绍
类图主要描述程序对象以及他们之间的关系.一般来说,类.接口.抽象类这些程序对象的区别很容易,但是他们之间六种关系以前总是理解不够深刻,这次进行了一次复习,顺便写成博文以便加深理解 类图中的三种对象 类 ...
- 如何正确并完全安装Visual Studio 2015企业版本[转]
http://blog.csdn.net/code_godfather/article/details/47381631 [注意事项]1> 本文描述的是: Visual Studio 2015企 ...
- hive运行query语句时提示错误:org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.io.IOException:
hive> select product_id, track_time from trackinfo limit 5; Total MapReduce jobs = 1 Launching Jo ...
- B2B,B2C和C2C的区别
电子商务发展至今,已经有十余年了,但是对于电子商务的概念,还没有一个统一的说法.接触电子商务的人想必脑海中肯定会产生这样的疑问:电子商务和网络购物是一码事,还是两个概念?当下盛行的淘宝,当当之类的网购 ...
- XML解析技术研究(一)
摘要:XML作为过去十年中出现的最流行的技术之一,得到了广泛的应用,而其中XML解析技术是XML应用的关键.本文介绍了XML解析技术的研究动向,分析和比较了4种XML解析技术的优劣,并归纳总结了应 ...
- Windows 8和CentOS 6.4(64)双系统硬盘安装教程
最近在笔记本上升级原来的系统Win7到Win8,同时又安装了CentOS 6.4(64)系统,实现双系统共存.着实折腾了一番,主要是CentOS6.4(64)的两个iso文件加起来5G多(其实只用第一 ...
- CentOS6安装配置rsh
基本信息:节点一:ip:192.168.8.166 主机名:hadrtest01节点二:ip:192.168.8.250 主机名:hadrtest02 1.两节点分别安装rsh,rsh-server包 ...
- isAssignableFrom与instanceof的区别
1.isAssignableFrom针对的是class对象: 2.instanceof是实例. isAssignableFrom是用来判断一个类Class1和另一个类Class2是否相同或是另一个类的 ...
- ASP.NET html转图片
using System.IO; using System.Drawing; using System.Threading; using System.Windows.Forms; public cl ...
- String的hashCode原理
参考下面这篇文章: http://blog.csdn.net/steveguoshao/article/details/12576849 http://blog.csdn.net/mingli1986 ...