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.

Reply via email to