Sorry for slow reply, but only just got back from long holiday. You were lucky to get prior responses as didn't have much Internet access when I was away. :-)
First up, you are missing a WSGIProcessGroup directive in your configuration. You aren't actually running in daemon mode like you think you might be. http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide#Delegation_To_Daemon_Process http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Embedded_Or_Daemon_Mode Second thing which would concern me is that you have a rewrite rule for non SSL host to redirect everything to https://www.website.com, yet you don't have such a thing for SSL port. What could be happening is that you are logging in under one host, but somewhere in your code you are issuing a redirect or have a link that goes back to the site via one of the aliases. At that point any cookie would not get delivered with request and it would likely bounce you to the login page. Suggest checking your access log file to see where requests are coming in via alias for SSL version of site and fix them to always use the one host which a user would be logged in under. Graham On 21 September 2012 18:57, Leandro César <[email protected]> wrote: > Hi friend! > > Thanks for the help. > > I have 2 websites. > > Just this last have the problem!!! > > When I restart Apache server, the problem gone. > > (I change the name of the site to "website"): > > website.conf > <VirtualHost *:80> > ServerAdmin [email protected] > ServerName www.website.com > ServerAlias website.com > ServerAlias websites.com > ServerAlias www.websites.com > ErrorLog logs/website-error_log > CustomLog logs/website-access_log common > > RewriteEngine on > RewriteCond %{HTTP_HOST} !^www\.website\.com [NC] > RewriteCond %{HTTP_HOST} !^$ > RewriteRule ^/(.*) https://www.website.com/$1 [L,R] > > RewriteEngine on > #RewriteCond %{HTTPS} !=on > RewriteRule (.*) https://%{HTTP_HOST}$1 [L,R=301] > > </VirtualHost> > > <VirtualHost *:443> > > ServerAdmin [email protected] > ServerName www.website.com > ServerAlias website.com > ServerAliaswebsites.com > ServerAlias www.websites.com > ErrorLog logs/website-ssl-error_log > CustomLog logs/website-ssl-access_log common > > RewriteEngine on > RewriteCond %{HTTP_HOST} !^www\.website\.com [NC] > RewriteCond %{HTTP_HOST} !^$ > RewriteRule ^/(.*) https://www.website.com/$1 [L,R] > > WSGIScriptAlias / /opt/srv/website/application.wsgi > > WSGIDaemonProcess website processes=2 threads=2 > > Alias /static /opt/srv/website/principal/static > > > SSLEngine On > SSLCertificateFile /etc/httpd/conf.d/rain.crt > SSLCertificateKeyFile /etc/httpd/conf.d/rain.key > SSLCertificateChainFile /etc/httpd/conf.d/RapidSSL_CA_bundle.pem > SSLProtocol -ALL +SSLv3 +TLSv1 > SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP > > <Location /> > SSLRequireSSL On > #SSLVerifyClient optional > #SSLVerifyDepth 1 > SSLOptions +StdEnvVars +StrictRequire > </Location> > </VirtualHost> > > > > > > > > application.wsgi > #!/usr/bin/env python > > import os, sys > sys.path.append('/opt/srv') > sys.path.append('/opt/srv/website') > > os.environ['DJANGO_SETTINGS_MODULE'] = 'website.settings' > > import django.core.handlers.wsgi > > _application = django.core.handlers.wsgi.WSGIHandler() > > def application(environ, start_response): > if environ['wsgi.url_scheme'] == 'https': > environ['HTTPS'] = 'on' > return _application(environ, start_response) > > On Fri, Sep 21, 2012 at 3:50 AM, Graham Dumpleton > <[email protected]> wrote: >> How many VirtualHost's does your Apache have and how many Django >> applications? How have you configured those VirtualHost's and with >> what mod_wsgi directives? >> >> Graham >> >> On 18 September 2012 11:58, jaau <[email protected]> wrote: >>> I have the same problem right now! >>> >>> Please help me!!! :( >>> >>> L. >>> >>> >>> On Wednesday, June 20, 2012 5:04:42 AM UTC-3, Neil Lohit wrote: >>>> >>>> I have had mod_wsgi working well with django 1.3 and apache2.2 for well >>>> over 6 months now and I recently switched to use https instead of http. >>>> Now, >>>> all of a sudden, at random times when I try to login to the django app via >>>> web browser, it keeps throwing me back to the login page. >>>> >>>> There are no incorrect password issues. I had this issue before when I >>>> initially started using mod_wsgi and I was missing in apache's conf >>>> file(Which is not the case now): >>>> >>>> WSGIPassAuthorization On >>>> >>>> Everytime I restart apache, this would work fine for few hours before it >>>> randomly starts throwing users back to login page and doesn't log them in. >>>> There is nothing in the apache debug logs that stands out for me. I can >>>> share more config if required, just wanted to see if somebody knew what my >>>> issue is from past experience. >>>> >>>> Thanks for your help! >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "modwsgi" group. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msg/modwsgi/-/GkpfAJVKJmwJ. >>> >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/modwsgi?hl=en. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "modwsgi" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/modwsgi?hl=en. >> > > > > -- > Leandro César > [email protected] > > () ascii ribbon campaign - against html e-mail > /\ www.asciiribbon.org - against proprietary attachments > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/modwsgi?hl=en. > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
