apache + django部署

#### succeed on gentoo-2.6.32-r1 ####

 Python
  |_  emerge dev-lang/python

 Django
  |_  emerge dev-python/django
  |_  mkdir /workspace;         ### cannot work under "/root" directory; ###
  |_  cd    /workspace;
  |_  django-admin startproject mysite;

 Apache
  |_  emerge www-servers/apache
  |_  emerge -a mod_python
  |_  Edit /etc/conf.d/apache2 by appending "-D PYTHON" to the APACHE2_OPTS global variable
  |_  Edit /etc/apache2/vhosts.d/00_default_vhost.conf
  |     |
  |     |
  |     |
  |      <VirtualHost *:8008>
  |
  |            Include /etc/apache2/vhosts.d/default_vhost.include
  |            <IfModule mpm_peruser_module>
  |              ServerEnvironment apache apache
  |            </IfModule>
  |
  |            <Location "/">
  |              SetHandler python-program
  |              PythonHandler django.core.handlers.modpython
  |              SetEnv DJANGO_SETTINGS_MODULE mysite.settings
  |              PythonPath "['/workspace'] + sys.path"
  |              PythonDebug On
  |            </Location>
  |
  |      </VirtualHost>
  |
  |_  /etc/init.d/apache2 restart

你可能感兴趣的:(apache + django部署)