超简单系列:ubuntu 13.04 安装 apache2.2+mod_wsgi+Django
1,Ubuntu更新系统
sudo apt-get update
sudo apt-get upgrade
2,安装apache,mod_wsgi,Django
sudo apt-get install apache2 libapache2-mod-wsgi python-django
更多Ubuntu系统内置安装包请搜索:Ubuntu Packages Search
3,配置Django环境
sudo mkdir /opt/wwwroot cd /opt/wwwroot
sudo django-admin startproject hello
创建wsgi文件
sudo mkdir /opt/wwwroot/hello/apache
sudo vi /opt/wwwroot/hello/apache/django.wsgi
文件django.wsgi贴入下面内容
django.wsgi内容
import os
import sys
sys.path.append('/opt/wwwroot')
sys.path.append('/opt/wwwroot/hello')
path = '/opt/wwwroot' if path not in sys.path:
sys.path.insert(0, '/opt/wwwroot') os.environ['DJANGO_SETTINGS_MODULE'] = 'hello.settings' import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
4,创建一个新的apache站点
sudo vi /etc/apache2/sites-available/hello
hello内容
<VirtualHost *:80> ServerName hello.com
DocumentRoot /opt/wwwroot/hello <Directory /opt/wwwroot/hello>
Order allow,deny
Allow from all
</Directory>
Alias /robots.txt /opt/wwwroot/hello/robots.txt
Alias /favicon.ico /opt/wwwroot/hello/favicon.ico
Alias /images /opt/wwwroot/hello/images
Alias /static /opt/wwwroot/hello/static WSGIDaemonProcess hello.com processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup hello.com
WSGIScriptAlias / /opt/wwwroot/hello/apache/django.wsgi </VirtualHost>
激活hello站点
sudo a2ensite hello
sudo service apache2 reload
5,设置完毕打开浏览器进入输入ip地址,就可以看到Django欢迎界面了。
6. 如果发现文件访问不了,权限的问题
sudo chown -R (group).(user) (your project dir)
Django官网部署链接:https://docs.djangoproject.com/en/1.2/howto/deployment/
超简单系列:ubuntu 13.04 安装 apache2.2+mod_wsgi+Django的更多相关文章
- Ubuntu 13.04安装搜狗输入法
Ubuntu 13.04安装搜狗输入法 [日期:2013-07-08] 来源:Linux公社 作者:LinuxIDC.com [字体:大 中 小] 目标:在Ubuntu 13.04以及基于U ...
- ubuntu 13.04 安装 JDK
ubuntu 13.04 安装 JDK 具体步骤参详了如下链接: http://blog.csdn.net/yang_hui1986527/article/details/6677450 1.到 Su ...
- vmware 8下ubuntu 13.04安装vmware tools
在虚拟机vmware 8.0里安装了ubuntu 13.04.为了方便与主机交互,安装vmware tools. 解压后直接运行 ./vmware-install.pl 一路默认路径安装下来,到&qu ...
- Ubuntu 12.04 安装 Apache2+PHP5+MySQL
LAMP是Linux web服务器组合套装的缩写,分别是Apache+MySQL+PHP.此教程教大家如何在Ubuntu 12.04 LTS server 上安装Apache2服务器,包括PHP5(m ...
- Ubuntu 13.04 安装 GCC4.8.1
终于有了完整实现C++11的GCC 4.8.1. 给自己的系统升级吧. 下面的步骤可以安装GCC4.8.1, 内容来自:http://askubuntu.com/questions/312620/ho ...
- [Ubuntu Setup] Ubuntu 13.04 安装 ia32-libs
http://stackoverflow.com/questions/23182765/how-to-install-ia32-libs-in-ubuntu-14-04-lts sudo -i cd ...
- Ubuntu 13.04安装mysql workbench
1.如果你没有更换源,是主服务器的官网源,这时候你可以直接用sudo apt-get install mysql-workbench来安装(前提是已经装好mysql相关服务) 2.如果你第一条装不了, ...
- 64位Ubuntu 13.04 安装Bochs 2.3.5
bochs 2.3.5源码编译 网上编译bochs的资料非常多,基本的问题都有解决方案,我重点讲不常见的问题. 基本安装步骤 tar vxzf bochs-2.3.5.tar.gz cd bochs- ...
- Ubuntu 13.04 安装使用clang
其实很简单,就是用命令即可: apt-get install clang-3.2 clang-3.2-doc 主要说明一点,/usr/bin/c++链接原来指向g++,现在被改变了. $ ls /us ...
随机推荐
- Apache Common Math Stat
http://commons.apache.org/proper/commons-math/userguide/stat.html mark DescriptiveStatistics maint ...
- 内部排序->插入排序->直接插入排序
文字描述: 将一个记录插入到已排好序的有序表中,从而得到一个新的.记录数增1的有序表 示意图: 算法分析: 时间复杂度为n*n,辅助存储为1,是稳定的排序方法. 代码实现: #include < ...
- LeetCode 944 Delete Columns to Make Sorted 解题报告
题目要求 We are given an array A of N lowercase letter strings, all of the same length. Now, we may choo ...
- 如何在Win10上永久禁用Windows Defender Antivirus
1.使用Windows键+ R键盘快捷键打开运行命令. 2.键入regedit,然后单击确定以打开注册表. 3.浏览以下路径: HKEY_LOCAL_MACHINE/SOFTWARE/Policies ...
- js:return [ expression ],return false,return true,return的区别
1.return [ expression ] return返回值实际上是对window.event.returnvalue进行设置. 2.return false,阻止默认的行为, ① 当给a标签绑 ...
- python pip install 报错TypeError: unsupported operand type(s) for -=: 'Retry' and 'int' Command "python setup.py egg_info" failed with error code 1 in
pip install http://download.pytorch.org/whl/cu80/torch-0.2.0.post3-cp27-cp27mu-manylinux1_x86_64.whl ...
- 【JMeter】基础元件
测试计划(Test Plan) 它用来描述一个测试方案,包含与本次性能测试所有相关的功能.也就说本次测试的所有内容是于基于一个计划的. “函数测试模式”复选框,如果被选择,它会使Jmeter记录来自服 ...
- 弱网测试之基于fiddler+wanem完成
如果不想搜集安装包,可以使用我分享的按照包,如下: WANem_3.0_Beta百度网盘下载链接:https://pan.baidu.com/s/1aMf5WBsfH7Mrl8iB2NjEYg 密码: ...
- elasticsearch中文分词器ik-analyzer安装
前面我们介绍了Centos安装elasticsearch 6.4.2 教程,elasticsearch内置的分词器对中文不友好,只会一个字一个字的分,无法形成词语,别急,已经有大拿把中文分词器做好了, ...
- 数据库——MongoDB
what's the MongoDB MongoDB是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中功能最丰富,最像关系数据库的.他支持的数据结构非常松散,是类似json的bson格式 ...