How to setup Apache and mod_python and django
来源:互联网 发布:mac如何退出qq 编辑:程序博客网 时间:2024/05/18 02:05
Here is the tutorial:
1. Install Apache2.2
Please refer to other article!
2. Install mod_python
Please go to mod_python site to download the compatible version, then install it.
After the installation, a module named "mod_python.so" will be added to modules folder in Apache root.
3. Install python2.5
Please go to python site to download the python, then install it.
4. Install django-1.1.1
Please go to django site to download the django-1.1.1, then move to Python's site-packages folder.
5. Create the website
I just add a workspace under the D:, and start a project named "mycompany".
The folder structure seems like:
D:/djworkspace/mycompany
6. Edit httpd.conf of Apache to run the django.
a) Enable the mod_python, just add below segment:
##########################################################################
# Load Python Module
LoadModule python_module modules/mod_python.so
##########################################################################
b) Setup website
<VirtualHost *:84>
DocumentRoot "D:/djworkspace/mycompany/"
# Serve django pages
<LocationMatch ^/(.*)$>
SetHandler mod_python
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mycompany.settings
PythonOption django.root
PythonAutoReload Off
PythonDebug On
PythonPath "sys.path + ['D://djworkspace', 'D://djworkspace//mycompany']"
</LocationMatch>
# Serve static media without running it through mod_python (overrides the above)
<LocationMatch ^(/(media|css|images|scripts|errordocs))>
SetHandler None
</LocationMatch>
<Directory "D:/djworkspace/mycompany/">
Order allow,deny
Options Indexes
Allow from all
</Directory>
</VirtualHost>
7. Run the site
- How to setup Apache and mod_python and django
- How to use Django with Apache and mod_python
- How to Setup Apache With FastCGI And Ruby Bindings
- How to setup Apache + Python + Django + mod_wsgi
- How to use Django with Apache and mod_wsgi
- How to Setup Nutch and Hadoop
- How To Setup a Rails 4 App With Apache and Passenger on CentOS 6
- HOW TO INTEGRATE TOMACAT AND APACHE
- How to setup and configure Sonar for Groovy projects
- How to setup a GIT server with gitosis and gitweb
- How to setup multiple data sources with Spring and JPA
- How to setup multiple data sources with Spring and JPA
- How to Setup and Use Github in Ubuntu
- apache+mysql+mod_python+Django
- How to Validate Network and Name Resolution Setup for the Clusterware and RAC (Doc ID 1054902.1)
- How to get JBoss and Apache to work together
- How to Setup and Secure Linux SSH Logins to use Private PEM Keys
- How to Setup and Secure Linux SSH Logins to use Private PEM Keys
- [系列好文]Ubuntu 下Android开发环境的搭建(英文官网!!!!!!)
- csdn
- 判断单链表是否存在环,和两条链表相交问题
- 全角半角转换 笔记
- android:launchMode="singleTask" 与 onNewIntent(Intent intent) 的用法
- How to setup Apache and mod_python and django
- v$filestat中PHYRDS负值
- 硬盘瓶颈和读写速度测试
- 给Win7加装Telnet
- C 常用字符串函数
- HTML工具
- Asterisk 1.8 队列 分析
- 基于JAVA的RSA算法详解
- Rework 札记