Ubuntu 14.04 + Apache2 + Django setup
2015-11-02 15:22
519 查看
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 $ ./configure or $ ./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/[/code]Create your Django projects
Create an simple django project$ django-admin startproject BobServer # Check your project $ cd BobServer $ python manage.py runserverSetup 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.so WSGIScriptAlias /bobserver /home/bob/github/BobServer/BobServer/wsgi.py WSGIPythonPath /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
相关文章推荐
- Apache ActiveMQ 启动失败解决方法
- 【xampp】修改apache的admin按钮默认路径
- Apache开启伪静态
- Introducing The Newly Redesigned Apache HAWQ [作者:常雷]
- Quick Start Guide for Apache Hawq[作者:盛想]
- Apache Hawq Data Locality简介 (1) [作者:张桓]
- apache 的访问日志被删除,apache进程异常
- Kafka学习2_apache kafka系列之在zookeeper中存储结构
- 在Mac OS X编译安装Apache
- Apache FlexJS 0.0.1 和 Apache Flex FalconJX 0.0.1发布
- Set Up Apache2 With mod_fcgid And PHP5 On CentOS
- 太乱了的apache,我自己都无语了
- PHP环境搭建:Windows7系统配置PHP+Apache+MySQL环境教程
- ubuntu安装mysql+php+apache
- apache(OS 10013)以一种访问权限不允许的方式做了一个访问套接字的尝试 ...
- Azure上Linux VM防DDOS攻击:使用Apache mod_evasive
- Apache配置——监听多个端口 对应多个不同的网站目录
- Cannot load php5apache2_4.dll into server解决办法;
- 国家商用密码(八)在Apache MINA上实现文本流的SM4编解码器
- 国家商用密码(七)在Apache MINA上实现二进制流的SM4编解码器