On 4/01/2015 3:45 AM, SungHo Park wrote:
Hi
I have tried to use Django in Apache, but it doesn't work.

My Django's version is 1.7.1 so I refered this page.
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
<https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/>

I'm Korean and not good at English. But I tried to read whole of the
documents in that page, but it doesn't work.
I searched it in Korean language and found out that it needs to enter
'sudo a2ensite <project_name>', but it doesn't work, too.

I applied

WSGIScriptAlias  //path/to/mysite.com/mysite/wsgi.py
WSGIPythonPath  /path/to/mysite.com

<Directory  /path/to/mysite.com/mysite>
<Files  wsgi.py>
Require  all  granted
</Files>
</Directory>

this.
I use Ubuntu 14.04.

Here is my working conf for Django 1.6.x, Apache2 and Ubuntu 14.04.

<IfModule mod_ssl.c>
 <VirtualHost _default_:443>

  SSLEngine on
  SSLProtocol all -SSLv2 -SSLv3
  SSLHonorCipherOrder on
  SSLCipherSuite RC4-SHA:HIGH:!ADH
  SSLCompression off
  SSLCertificateFile /etc/ssl/certs/xxdxpq4.crt
  SSLCertificateKeyFile /etc/ssl/private/xxdxpq4.key
  SSLCACertificateFile /etc/ssl/certs/rapidssl-intermediate.crt
BrowserMatch "MSIE [2-6]" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
  BrowserMatch "MSIE [7-9]" ssl-unclean-shutdown

  DocumentRoot /var/www/xxdx/htdocs/
  ServerName xxdx.pq4.com
  ServerAdmin webmas...@pq4.com

  HostnameLookups Off
  UseCanonicalName Off

  ErrorLog ${APACHE_LOG_DIR}/xxdx-error.log
  CustomLog ${APACHE_LOG_DIR}/xxdx-access.log combined

  Alias /robots.txt /var/www/static/xxdx/robots/robots.txt
  Alias /favicon.ico /var/www/static/xxdx/img/xxdx.ico

  # lock the public out
  <Directory /var/www/xxdx/>
   AllowOverride None
   Order deny,allow
   Deny from all
  </Directory>

  # serve uploaded media from here
  <Directory /var/www/media/xxdx/>
   AllowOverride None
   Order deny,allow
   Allow from all
  </Directory>

  # serve static stuff from here
  <Directory /var/www/static/xxdx/>
   AllowOverride None
   Order deny,allow
   Allow from all
  </Directory>

  <IfModule mod_alias.c>
   Alias /media/ /var/www/media/xxdx/
   Alias /static/ /var/www/static/xxdx/
   Alias /tiny_mce/ /var/www/static/xxdx/js/tiny_mce/
   Alias /jquery/ /var/www/static/xxdx/js/jquery/
  </IfModule>

  # now let the public access anything here
  <Directory /var/www/xxdx/htdocs/>
   AllowOverride None
   Order deny,allow
   Allow from all
  </Directory>

  <IfModule mod_wsgi.c>
   WSGIScriptAlias / /var/www/xxdx/xxdx/wsgi.py
   <Directory /var/www/xxdx/xxdx/>
    Order deny,allow
    Allow from all
   </Directory>
 </IfModule>

 </VirtualHost>
</IfModule>

hth











dsf

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/c88fc796-eed4-4eed-ba6a-11a6b7e3331e%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/c88fc796-eed4-4eed-ba6a-11a6b7e3331e%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54A87224.6030804%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.

Reply via email to