Ubuntu 14.04 + Apache2 + Django setup
来源:互联网 发布:大数据时代的精准营销 编辑:程序博客网 时间:2024/05/16 14:15
Install dependence
- Install apache2
$sudo apt-get install apache2 apache2-dev
Check apxs
$ apxs2
- Install python dev
$sudo apt-get install python-dev
- Install mod_wsgi
Download from https://github.com/GrahamDumpleton/mod_wsgi/releases
$ wget https://github.com/GrahamDumpleton/mod_wsgi/archive/4.4.21.tar.gz$ tar zxvf 4.4.21.tar.gz$ cd mod_wsgi-4.4.21$ ./configureor$ ./configure --with-apxs=/usr/local/apache/bin/apxs --with-python=/usr/local/bin/python$ make$ sudo make install# Will create a mod_wsgi.so to modules: /usr/lib/apache2/modules/mod_wsgi.so
- Install django
$ sudo -E pip install django# Check$ django-admin help# Django docs: https://www.djangoproject.com/start/
Create your Django projects
- Create an simple django project
$ django-admin startproject BobServer# Check your project$ cd BobServer$ python manage.py runserver
Setup apache conf for your project
- Create django conf for apache2 http://www.rackspace.com/knowledge_center/article/ubuntu-modwsgi-installation
$ cd /etc/apache2/sites-available$ sudo vim django.conf# add below info"""LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.soWSGIScriptAlias /bobserver /home/bob/github/BobServer/BobServer/wsgi.pyWSGIPythonPath /home/bob/github/BobServer/:/usr/local/lib/python2.7/dist-packages/;/usr/local/bin/<Directory /home/bob/github/BobServer> #Options Indexes FollowSymLinks AllowOverride None Require all granted <Files wsgi.py> Require all granted </Files></Directory>ErrorLog ${APACHE_LOG_DIR}/BobServer.log"""# add soft link in sites-enabled$ sudo ln -s django.conf ../sites-available/django.conf# Restart apache2$ sudo service apache2 restart# To check your setup, open browser and go to your server url# xxxxxx.com/bobserver
0 0
- Ubuntu 14.04 + Apache2 + Django setup
- Ubuntu Django mysql apache2 搭建
- Ubuntu配置Django+ Apache2+ mysql
- Ubuntu配置Django+ Apache2+ mysql
- Ubuntu apache2 vhost setup(虚拟主机配置)
- Django项目用mod_wsgi部署到Apache2, Ubuntu 14.04
- Ubuntu apache2下建立django开发环境
- ubuntu 安装 apache2.2+mod_wsgi+Django
- ubuntu 13.04 安装 apache2.2+mod_wsgi+Django
- Setup Apache2+Php5+Mysql+Cakephp on Ubuntu Server 10.04
- django学习日记--在ubuntu apache2上部署django
- 在Ubuntu 14.04 下部署Apache2服务器并发布Django 1.7.6 Web应用(本机)
- How to setup django, python environment in ubuntu
- ubuntu下安装apache2.2+mod_wsgi+django(一)
- ubuntu下安装apache2.2+mod_wsgi+django(二)
- ubuntu下安装apache2.2+mod_wsgi+django(一)
- ubuntu下安装apache2.2+mod_wsgi+django(二)
- ubuntu下安装apache2.2+mod_wsgi+django(一)
- cocoapods 安装 常见问题及其解决方案汇总
- Android Studio整合代码至Git
- SpringMVC之类型转换Converter
- Unix基础
- Spring MVC常用的注解
- Ubuntu 14.04 + Apache2 + Django setup
- GCD的基本功能解释
- Android SubsamplingScaleImageView(subsampling-scale-image-view)单双击长按事件【系列2】
- yum 出现Existing lock /var/run/yum.pid: another copy is running as pid:3355
- 工作过程
- 【NOIP2014】解方程 玄学哈希+乱搞
- 模拟discuz发帖的类实现
- 第一篇 多线程笔试面试题汇总
- android 三种网络通信接口及各个接口的代码示例