OpenSuse11.4+Apache+Django搭建Webserver
2013-08-19 00:00
232 查看
1.Install Django
https://www.djangoproject.com/download/
2.安装apache服务器
插曲:apache2ctl start 时错误
解决方法:http://lists.opensuse.org/opensuse-bugs/2011-09/msg01387.html
3.安装apache python接口wsgi
3.1关于wsgi
http://code.google.com/p/modwsgi/
上面站点对wsgi的一段介绍:
The aim of mod_wsgi is to implement a simple to use Apache module which can host any Python application which supports the Python WSGIinterface. The module would be suitable for use in hosting high performance production web sites, as well as your average self managed personal sites running on web hosting services.
3.2安装wsgi
4.配置Apache使用Ddjango
1.先看看 Apache的配置文件httpd.conf,结构很清晰;修改 loadmoduel.conf,增加mod_wsgi.so。
在/etc/apache2/httpd.conf中直接增加如下内容:
https://www.djangoproject.com/download/
2.安装apache服务器
sudo zypper install apache
插曲:apache2ctl start 时错误
linux:~ # apache2ctl start httpd2: Syntax error on line 188 of /etc/apache2/httpd.conf: Could not open configuration file /etc/apache2/sysconfig.d/include.conf: No such file or directory
解决方法:http://lists.opensuse.org/opensuse-bugs/2011-09/msg01387.html
mkdir -p /etc/apache2/sysconfig.d/ && touch /etc/apache2/sysconfig.d/include.conf
3.安装apache python接口wsgi
3.1关于wsgi
http://code.google.com/p/modwsgi/
上面站点对wsgi的一段介绍:
The aim of mod_wsgi is to implement a simple to use Apache module which can host any Python application which supports the Python WSGIinterface. The module would be suitable for use in hosting high performance production web sites, as well as your average self managed personal sites running on web hosting services.
3.2安装wsgi
linux:~ # zypper search *wsgi* Loading repository data... Warning: Repository 'openSUSE-11.4-Update' appears to outdated. Consider using a different mirror or server. Reading installed packages... S | Name | Summary | Type --+------------------+---------------------------------------+-------- | apache2-mod_wsgi | Python WSGI adapter module for Apache | package
linux:~ # zypper install apache2-mod_wsgi
4.配置Apache使用Ddjango
1.先看看 Apache的配置文件httpd.conf,结构很清晰;修改 loadmoduel.conf,增加mod_wsgi.so。
# Overview of include files, chronologically: # # httpd.conf # | # |-- uid.conf . . . . . . . . . . . . . . UserID/GroupID to run under # |-- server-tuning.conf . . . . . . . . . sizing of the server (how many processes to start, ...) # |-- sysconfig.d/loadmodule.conf . . . . . [*] load these modules
#load wsgi for django LoadModule wsgi_module /usr/lib/apache2/mod_wsgi.so #2.增加APP
在/etc/apache2/httpd.conf中直接增加如下内容:
# wsgi app WSGIScriptAlias / /home/rui.zhao/webserver/mysite/mysite/wsgi.py WSGIPythonPath /home/rui.zhao/webserver/mysite # add exec authority <Directory /home/rui.zhao/webserver/mysite> <Files wsgi.py> Order deny,allow Allow from all </Files> </Directory>但是官方建议不要在httpd.conf中直接增加,不利于管理:
# Note: instead of adding your own configuration here, consider # adding it in your own file (/etc/apache2/httpd.conf.local) # putting its name into APACHE_CONF_INCLUDE_FILES in # /etc/sysconfig/apache2 -- this will make system updates # easier :)
相关文章推荐
- apache mysql django 开发平台搭建
- Mac下搭建Django+XAMPP(Mysql+Apache)+Python网站开发环境
- Apache+MySQL+Python+Django在Windows下环境搭建指南
- apache(apache+django+python)服务搭建
- Django + Apache + wsgi配置和环境搭建(ubuntu)
- Django+apache+python+mod_python的环境搭建
- Django使用Apache2.2通过Mod_wsgi搭建站点服务器
- Linux+ ubuntu + 阿里云 + apache WebServer WEB服务器搭建
- Ubuntu中Apache,Django,wsgi环境搭建
- python:windows上搭建apache+mysql+django的过程
- Django+Apache+mod_wsgi阿里云环境搭建(一)
- windows上搭建apache+mysql+django
- centos搭建Apache+mod_wsgi+Django环境
- windows下搭建webserver(apache2.4+mysql5.7+php5.6)
- CentOS下Apache+Python+Django+Wsgi环境搭建
- linux+django+apache+mod_wsgi+eclipse+python2.7 环境的搭建
- Django+apache+python+mod_python的环境搭建
- Apache+MySQL+Python+Django在Windows下环境搭建指南
- django+mod_wsig+apache搭建生产环境
- Mac OS X Yosemite 10.10.3 apache+mysql+django web开发环境的搭建