Re: libssl.so.1.1 / OPENSSL_1_1_1 not found after upgrade (ubuntu server 18.04 / apache / mod_wsgi)

2019-06-24 Thread Volker Kraut
Luke! That did the trick! Many thanks.

Am Mo., 24. Juni 2019 um 01:19 Uhr schrieb Luke :

> Hah! Found it!
>
> The psycopg2-binary module needed to be reinstalled (now version 2.8.3)
>
> I believe the old one must have been compiled against libssl1.1.0, which
> was replaced by 1.1.1 in the upgrade which broke things.
>
> On Monday, June 24, 2019 at 11:11:11 AM UTC+12, Luke wrote:
>>
>> I'm having the same problem, totally unable to find a resolution so far.
>>
>> I get no error messages of any use, even with all logging set to DEBUG.
>> The only thing i'm seeing is "Truncated or oversized response headers
>> received from daemon process" in the apache error log.
>>
>> Works fine when using the Django development server. Broke last week
>> after updating the system python and openssl packages.
>>
>> Anyone else having this problem?
>>
>> On Friday, June 14, 2019 at 1:31:29 PM UTC+12, Volker wrote:
>>>
>>> Two days ago my django app which runs on an Ubuntu 18.04.2 LTS server
>>> with apache 2.4 (from repo9 and mod_wsgi in an venv with Python 3.6 throws
>>> an exception after https login - as it seems - after a package upgrade.
>>> To my understanding libssl/openssl is causing the error. The error
>>> message below states that openssl_1_1_1 is not found. Though it seems to be
>>> installed.
>>>
>>> Could you guys give me a pointer? Please let me know if I need to
>>> provide additional information.
>>>
>>> Thanks and cheers!
>>>
>>>
>>>
>>> Two days ago following packages where upgraded:
>>> =
>>> libelf1:amd64 0.170-0.4 => 0.170-0.4ubuntu0.1
>>> libglib2.0-0:amd64 2.56.4-0ubuntu0.18.04.2 => 2.56.4-0ubuntu0.18.04.3
>>> libglib2.0-data:all 2.56.4-0ubuntu0.18.04.2 =>
>>> 2.56.4-0ubuntu0.18.04.3
>>> libnss-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>>> libpam-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>>> libpython3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>>> libpython3.6-stdlib:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>>> libpython3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>>> libssl1.1:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
>>> libsystemd0:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>>> libudev1:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>>> openssl:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
>>> python3-cryptography:amd64 2.1.4-1ubuntu1.2 => 2.1.4-1ubuntu1.3
>>> python3-distutils:all 3.6.7-1~18.04 => 3.6.8-1~18.04
>>> python3-gdbm:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04
>>> python3-lib2to3:all 3.6.7-1~18.04 => 3.6.8-1~18.04
>>> python3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>>> python3.6-venv:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>>> python3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>>> systemd-sysv:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>>> systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>>> udev:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>>>
>>> Login Implementation
>>> 
>>> Im using djangos login views:
>>> settings.py:
>>> LOGIN_URL = '/accounts/login/'
>>> urls.py:
>>> path('accounts/', include('django.contrib.auth.urls')),
>>>
>>> Error after Login Page of application / and django admin:
>>> 
>>> "Internal Server Error
>>> The server encountered an internal error or misconfiguration and was
>>> unable to complete your request."
>>>
>>> Error in Apache Log
>>> ==
>>> [Thu Jun 13 18:58:10.555937 2019] [wsgi:error] [pid 1274:tid
>>> 140451378087680] [client 77.8.21.189:48212] mod_wsgi (pid=1274):
>>> Request data read error when proxying data to daemon process: Connection
>>> reset by peer.
>>> [Thu Jun 13 20:46:51.186545 2019] [wsgi:error] [pid 1274:tid
>>> 140451252197120] [client 217.18.178.226:61510] Truncated or oversized
>>> response headers received from daemon process 'fotobau.ourdomain.de':
>>> /srv/fotobau/djangoprojekt/wsgi.py, referer:
>>> https://www.fotobau.ourdomain/accounts/login/
>>>
>>> Unfortunately I failed to obtain a core dump till now.
>>>
>>> Though right now I suspect the problem occurs when django tries to
>>> receive the https/encrypted user and password. I suspect this because I got
>>> another error message!
>>>
>>> Another Error in Django Log
>>> 
>>> Here I got a new error message: The first one ('Exception' is not JSON
>>> serializable) is fairly common - though I didn´t manage to fix it till now,
>>> it never really bothered.
>>> Though after the package upgrade it raises a new error message (which
>>> will raise itself again for 3 times) below - the one with "ImportError:
>>> /usr/lib/x86_64-linux-gnu/libssl.so.1.1: version `OPENSSL_1_1_1":
>>>
>>> ERROR 2019-06-12 19:57:17,638 log 505 Internal Server Error:
>>> /restservice/v1/fotos/
>>> Traceback (most recent call last):
>>>   File
>>> "/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/core/handlers/exception.py",
>>> line 34, in 

Re: libssl.so.1.1 / OPENSSL_1_1_1 not found after upgrade (ubuntu server 18.04 / apache / mod_wsgi)

2019-06-23 Thread Luke
Hah! Found it!

The psycopg2-binary module needed to be reinstalled (now version 2.8.3)

I believe the old one must have been compiled against libssl1.1.0, which 
was replaced by 1.1.1 in the upgrade which broke things.

On Monday, June 24, 2019 at 11:11:11 AM UTC+12, Luke wrote:
>
> I'm having the same problem, totally unable to find a resolution so far.
>
> I get no error messages of any use, even with all logging set to DEBUG. 
> The only thing i'm seeing is "Truncated or oversized response headers 
> received from daemon process" in the apache error log.
>
> Works fine when using the Django development server. Broke last week after 
> updating the system python and openssl packages.
>
> Anyone else having this problem?
>
> On Friday, June 14, 2019 at 1:31:29 PM UTC+12, Volker wrote:
>>
>> Two days ago my django app which runs on an Ubuntu 18.04.2 LTS server 
>> with apache 2.4 (from repo9 and mod_wsgi in an venv with Python 3.6 throws 
>> an exception after https login - as it seems - after a package upgrade.
>> To my understanding libssl/openssl is causing the error. The error 
>> message below states that openssl_1_1_1 is not found. Though it seems to be 
>> installed.
>>
>> Could you guys give me a pointer? Please let me know if I need to provide 
>> additional information.
>>
>> Thanks and cheers!
>>
>>
>>
>> Two days ago following packages where upgraded:
>> =
>> libelf1:amd64 0.170-0.4 => 0.170-0.4ubuntu0.1
>> libglib2.0-0:amd64 2.56.4-0ubuntu0.18.04.2 => 2.56.4-0ubuntu0.18.04.3
>> libglib2.0-data:all 2.56.4-0ubuntu0.18.04.2 => 2.56.4-0ubuntu0.18.04.3
>> libnss-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>> libpam-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>> libpython3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>> libpython3.6-stdlib:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>> libpython3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>> libssl1.1:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
>> libsystemd0:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>> libudev1:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>> openssl:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
>> python3-cryptography:amd64 2.1.4-1ubuntu1.2 => 2.1.4-1ubuntu1.3
>> python3-distutils:all 3.6.7-1~18.04 => 3.6.8-1~18.04
>> python3-gdbm:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04
>> python3-lib2to3:all 3.6.7-1~18.04 => 3.6.8-1~18.04
>> python3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>> python3.6-venv:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>> python3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>> systemd-sysv:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>> systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>> udev:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>>
>> Login Implementation
>> 
>> Im using djangos login views:
>> settings.py:
>> LOGIN_URL = '/accounts/login/'
>> urls.py:
>> path('accounts/', include('django.contrib.auth.urls')),
>>
>> Error after Login Page of application / and django admin:
>> 
>> "Internal Server Error
>> The server encountered an internal error or misconfiguration and was 
>> unable to complete your request."
>>
>> Error in Apache Log
>> ==
>> [Thu Jun 13 18:58:10.555937 2019] [wsgi:error] [pid 1274:tid 
>> 140451378087680] [client 77.8.21.189:48212] mod_wsgi (pid=1274): Request 
>> data read error when proxying data to daemon process: Connection reset by 
>> peer.
>> [Thu Jun 13 20:46:51.186545 2019] [wsgi:error] [pid 1274:tid 
>> 140451252197120] [client 217.18.178.226:61510] Truncated or oversized 
>> response headers received from daemon process 'fotobau.ourdomain.de': 
>> /srv/fotobau/djangoprojekt/wsgi.py, referer: 
>> https://www.fotobau.ourdomain/accounts/login/
>>
>> Unfortunately I failed to obtain a core dump till now.
>>
>> Though right now I suspect the problem occurs when django tries to 
>> receive the https/encrypted user and password. I suspect this because I got 
>> another error message!
>>
>> Another Error in Django Log
>> 
>> Here I got a new error message: The first one ('Exception' is not JSON 
>> serializable) is fairly common - though I didn´t manage to fix it till now, 
>> it never really bothered.
>> Though after the package upgrade it raises a new error message (which 
>> will raise itself again for 3 times) below - the one with "ImportError: 
>> /usr/lib/x86_64-linux-gnu/libssl.so.1.1: version `OPENSSL_1_1_1":
>>
>> ERROR 2019-06-12 19:57:17,638 log 505 Internal Server Error: 
>> /restservice/v1/fotos/
>> Traceback (most recent call last):
>>   File 
>> "/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/core/handlers/exception.py",
>>  
>> line 34, in inner
>> response = get_response(request)
>>   File 
>> "/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/core/handlers/base.py",
>>  
>> line 156, in 

Re: libssl.so.1.1 / OPENSSL_1_1_1 not found after upgrade (ubuntu server 18.04 / apache / mod_wsgi)

2019-06-23 Thread Luke
I'm having the same problem, totally unable to find a resolution so far.

I get no error messages of any use, even with all logging set to DEBUG. The 
only thing i'm seeing is "Truncated or oversized response headers received 
from daemon process" in the apache error log.

Works fine when using the Django development server. Broke last week after 
updating the system python and openssl packages.

Anyone else having this problem?

On Friday, June 14, 2019 at 1:31:29 PM UTC+12, Volker wrote:
>
> Two days ago my django app which runs on an Ubuntu 18.04.2 LTS server with 
> apache 2.4 (from repo9 and mod_wsgi in an venv with Python 3.6 throws an 
> exception after https login - as it seems - after a package upgrade.
> To my understanding libssl/openssl is causing the error. The error message 
> below states that openssl_1_1_1 is not found. Though it seems to be 
> installed.
>
> Could you guys give me a pointer? Please let me know if I need to provide 
> additional information.
>
> Thanks and cheers!
>
>
>
> Two days ago following packages where upgraded:
> =
> libelf1:amd64 0.170-0.4 => 0.170-0.4ubuntu0.1
> libglib2.0-0:amd64 2.56.4-0ubuntu0.18.04.2 => 2.56.4-0ubuntu0.18.04.3
> libglib2.0-data:all 2.56.4-0ubuntu0.18.04.2 => 2.56.4-0ubuntu0.18.04.3
> libnss-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
> libpam-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
> libpython3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
> libpython3.6-stdlib:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
> libpython3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
> libssl1.1:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
> libsystemd0:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
> libudev1:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
> openssl:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
> python3-cryptography:amd64 2.1.4-1ubuntu1.2 => 2.1.4-1ubuntu1.3
> python3-distutils:all 3.6.7-1~18.04 => 3.6.8-1~18.04
> python3-gdbm:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04
> python3-lib2to3:all 3.6.7-1~18.04 => 3.6.8-1~18.04
> python3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
> python3.6-venv:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
> python3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
> systemd-sysv:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
> systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
> udev:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>
> Login Implementation
> 
> Im using djangos login views:
> settings.py:
> LOGIN_URL = '/accounts/login/'
> urls.py:
> path('accounts/', include('django.contrib.auth.urls')),
>
> Error after Login Page of application / and django admin:
> 
> "Internal Server Error
> The server encountered an internal error or misconfiguration and was 
> unable to complete your request."
>
> Error in Apache Log
> ==
> [Thu Jun 13 18:58:10.555937 2019] [wsgi:error] [pid 1274:tid 
> 140451378087680] [client 77.8.21.189:48212] mod_wsgi (pid=1274): Request 
> data read error when proxying data to daemon process: Connection reset by 
> peer.
> [Thu Jun 13 20:46:51.186545 2019] [wsgi:error] [pid 1274:tid 
> 140451252197120] [client 217.18.178.226:61510] Truncated or oversized 
> response headers received from daemon process 'fotobau.ourdomain.de': 
> /srv/fotobau/djangoprojekt/wsgi.py, referer: 
> https://www.fotobau.ourdomain/accounts/login/
>
> Unfortunately I failed to obtain a core dump till now.
>
> Though right now I suspect the problem occurs when django tries to receive 
> the https/encrypted user and password. I suspect this because I got another 
> error message!
>
> Another Error in Django Log
> 
> Here I got a new error message: The first one ('Exception' is not JSON 
> serializable) is fairly common - though I didn´t manage to fix it till now, 
> it never really bothered.
> Though after the package upgrade it raises a new error message (which will 
> raise itself again for 3 times) below - the one with "ImportError: 
> /usr/lib/x86_64-linux-gnu/libssl.so.1.1: version `OPENSSL_1_1_1":
>
> ERROR 2019-06-12 19:57:17,638 log 505 Internal Server Error: 
> /restservice/v1/fotos/
> Traceback (most recent call last):
>   File 
> "/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/core/handlers/exception.py",
>  
> line 34, in inner
> response = get_response(request)
>   File 
> "/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/core/handlers/base.py",
>  
> line 156, in _get_response
> response = self.process_exception_by_middleware(e, request)
>   File 
> "/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/core/handlers/base.py",
>  
> line 154, in _get_response
> response = response.render()
>   File 
> "/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/template/response.py",
>  
> line 106, in render
> 

libssl.so.1.1 / OPENSSL_1_1_1 not found after upgrade (ubuntu server 18.04 / apache / mod_wsgi)

2019-06-13 Thread Volker
Two days ago my django app which runs on an Ubuntu 18.04.2 LTS server with 
apache 2.4 (from repo9 and mod_wsgi in an venv with Python 3.6 throws an 
exception after https login - as it seems - after a package upgrade.
To my understanding libssl/openssl is causing the error. The error message 
below states that openssl_1_1_1 is not found. Though it seems to be 
installed.

Could you guys give me a pointer? Please let me know if I need to provide 
additional information.

Thanks and cheers!



Two days ago following packages where upgraded:
=
libelf1:amd64 0.170-0.4 => 0.170-0.4ubuntu0.1
libglib2.0-0:amd64 2.56.4-0ubuntu0.18.04.2 => 2.56.4-0ubuntu0.18.04.3
libglib2.0-data:all 2.56.4-0ubuntu0.18.04.2 => 2.56.4-0ubuntu0.18.04.3
libnss-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
libpam-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
libpython3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
libpython3.6-stdlib:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
libpython3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
libssl1.1:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
libsystemd0:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
libudev1:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
openssl:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
python3-cryptography:amd64 2.1.4-1ubuntu1.2 => 2.1.4-1ubuntu1.3
python3-distutils:all 3.6.7-1~18.04 => 3.6.8-1~18.04
python3-gdbm:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04
python3-lib2to3:all 3.6.7-1~18.04 => 3.6.8-1~18.04
python3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
python3.6-venv:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
python3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
systemd-sysv:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
udev:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22

Login Implementation

Im using djangos login views:
settings.py:
LOGIN_URL = '/accounts/login/'
urls.py:
path('accounts/', include('django.contrib.auth.urls')),

Error after Login Page of application / and django admin:

"Internal Server Error
The server encountered an internal error or misconfiguration and was unable 
to complete your request."

Error in Apache Log
==
[Thu Jun 13 18:58:10.555937 2019] [wsgi:error] [pid 1274:tid 
140451378087680] [client 77.8.21.189:48212] mod_wsgi (pid=1274): Request 
data read error when proxying data to daemon process: Connection reset by 
peer.
[Thu Jun 13 20:46:51.186545 2019] [wsgi:error] [pid 1274:tid 
140451252197120] [client 217.18.178.226:61510] Truncated or oversized 
response headers received from daemon process 'fotobau.ourdomain.de': 
/srv/fotobau/djangoprojekt/wsgi.py, referer: 
https://www.fotobau.ourdomain/accounts/login/

Unfortunately I failed to obtain a core dump till now.

Though right now I suspect the problem occurs when django tries to receive 
the https/encrypted user and password. I suspect this because I got another 
error message!

Another Error in Django Log

Here I got a new error message: The first one ('Exception' is not JSON 
serializable) is fairly common - though I didn´t manage to fix it till now, 
it never really bothered.
Though after the package upgrade it raises a new error message (which will 
raise itself again for 3 times) below - the one with "ImportError: 
/usr/lib/x86_64-linux-gnu/libssl.so.1.1: version `OPENSSL_1_1_1":

ERROR 2019-06-12 19:57:17,638 log 505 Internal Server Error: 
/restservice/v1/fotos/
Traceback (most recent call last):
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/core/handlers/exception.py",
 
line 34, in inner
response = get_response(request)
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/core/handlers/base.py",
 
line 156, in _get_response
response = self.process_exception_by_middleware(e, request)
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/core/handlers/base.py",
 
line 154, in _get_response
response = response.render()
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/template/response.py",
 
line 106, in render
self.content = self.rendered_content
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/rest_framework/response.py",
 
line 72, in rendered_content
ret = renderer.render(self.data, accepted_media_type, context)
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/rest_framework/renderers.py",
 
line 107, in render
allow_nan=not self.strict, separators=separators
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/rest_framework/utils/json.py",
 
line 28, in dumps
return json.dumps(*args, **kwargs)
  File "/usr/lib/python3.6/json/__init__.py", line 238, in dumps
**kw).encode(obj)
  File "/usr/lib/python3.6/json/encoder.py", 

Re: can anyone tell django deployment process with apache, mod_wsgi using aws ec2 hosting requirements

2017-01-03 Thread Avraham Serour
https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-uwsgi-and-nginx-on-ubuntu-16-04

On Tue, Jan 3, 2017 at 1:58 PM, chowdam1992  wrote:

> So i can thankfull.
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/8af4f3a5-c967-4e33-860e-1e2c08414895%40googlegroups.com
> 
> .
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFWa6t%2B9p97EeF4duoCVEJ8qZpgxBYvbMEvXxLS5defPW8vOqA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


can anyone tell django deployment process with apache, mod_wsgi using aws ec2 hosting requirements

2017-01-03 Thread chowdam1992
So i can thankfull.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8af4f3a5-c967-4e33-860e-1e2c08414895%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Apache, mod_wsgi and sharing videos to devices/machines

2014-04-11 Thread Adam Teale
Hmm seems that the error is just part of working with the development
server.
I shall work on trying to put this into production mode
Cheers


On Fri, Apr 11, 2014 at 10:31 AM, Adam Teale  wrote:

> Hi Guys,
>
> If someone has the time to take a look at this i'd really appreciate it.
>
> I am in the process of developing a small django app to manage some
> aspects of our production company - users, projects etc...
>
> I am in a moment where I would like to get some people on the local
> network to start playing around with it and be able to view video and audio
> files from our server's project directory (for the moment i am just using
> dummy files from a directory on my local machine).
>
> I have set up my machine to allow for users to access the django app via
> my ip address and seems to work - they can login and see pages.
> Eventually this will run on our server.
> The app us running out of my user folder (mac os x 10.9 installed).
> I have django working with an mysql db.
> I think i have mod_wsgi installed ok.
>
>
> So what I am hoping to achieve is that users on the local network, and
> eventually out of the building on their telephones, can view projects
> through the django app and preview proxy versions of the media - such as
> mp4 video files.
>
> This seems to work ok - but I am getting errors when pages with media that
> are visited.
> The media is served though in some caes - in this case mp4 files.
> But devices on wifi don't seem to be able to see the media.
>
> Either way i get errors
>
> I imagine that it is because I need to implement Apache and mod_wsgi. So I
> am trying to follow this:
> https://docs.djangoproject.com/en/1.5/howto/deployment/wsgi/modwsgi/
>
> I am hoping someone out there can just give me some ideas or comments
> about what I am doing, if I am making some obvious mistakes, and if you can
> help me work out this error.
>
> Many thanks!
>
>
> Adam
>
>
> error:
>
> [11/Apr/2014 13:21:43] "GET /proyectos/1/ HTTP/1.1" 200 7411
>
> [11/Apr/2014 13:21:43] "GET
> /Users/admin/Dropbox/mstudio/code/mBrain/mbrain/mbrain/static/css/bootstrap.css
> HTTP/1.1" 304 0
>
> [11/Apr/2014 13:21:43] "GET
> /Users/admin/Dropbox/mstudio/code/mBrain/mbrain/mbrain/static/0124_Entel/edit/export/20140401/2053_canal13_marzo_20140408_1720.m4v
> HTTP/1.1" 200 4709
>
> Traceback (most recent call last):
>
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py",
> line 86, in run
>
> self.finish_response()
>
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py",
> line 128, in finish_response
>
> self.write(data)
>
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py",
> line 217, in write
>
> self._write(data)
>
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py",
> line 324, in write
>
> self.flush()
>
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py",
> line 303, in flush
>
> self._sock.sendall(view[write_offset:write_offset+buffer_size])
>
> error: [Errno 32] Broken pipe
>
> *[11/Apr/2014 13:21:43] "GET
> /Users/admin/Dropbox/mstudio/code/mBrain/mbrain/mbrain/static/0124_Entel/edit/export/20140401/2053_canal13_marzo_20140408_1720.m4v
> HTTP/1.1" 500 59*
>
> 
>
> Exception happened during processing of request from ('192.168.1.143',
> 59968)
>
> Traceback (most recent call last):
>
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py",
> line 593, in process_request_thread
>
> self.finish_request(request, client_address)
>
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py",
> line 334, in finish_request
>
> self.RequestHandlerClass(request, client_address, self)
>
>   File
> "/Users/admin/Dropbox/mstudio/code/mBrain/venv/lib/python2.7/site-packages/django/core/servers/basehttp.py",
> line 126, in __init__
>
> super(WSGIRequestHandler, self).__init__(*args, **kwargs)
>
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py",
> line 651, in __init__
>
> self.finish()
>
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py",
> line 710, in finish
>
> self.wfile.close()
>
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py",
> line 279, in close
>
> self.flush()
>
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py",
> line 303, in flush
>
> self._sock.sendall(view[write_offset:write_offset+buffer_size])
>
> error: [Errno 32] Broken pipe
>
> 
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> 

Apache, mod_wsgi and sharing videos to devices/machines

2014-04-11 Thread Adam Teale
Hi Guys,

If someone has the time to take a look at this i'd really appreciate it.

I am in the process of developing a small django app to manage some aspects 
of our production company - users, projects etc...

I am in a moment where I would like to get some people on the local network 
to start playing around with it and be able to view video and audio files 
from our server's project directory (for the moment i am just using dummy 
files from a directory on my local machine).

I have set up my machine to allow for users to access the django app via my 
ip address and seems to work - they can login and see pages. 
Eventually this will run on our server.
The app us running out of my user folder (mac os x 10.9 installed).
I have django working with an mysql db.
I think i have mod_wsgi installed ok.


So what I am hoping to achieve is that users on the local network, and 
eventually out of the building on their telephones, can view projects 
through the django app and preview proxy versions of the media - such as 
mp4 video files.

This seems to work ok - but I am getting errors when pages with media that 
are visited.
The media is served though in some caes - in this case mp4 files.
But devices on wifi don't seem to be able to see the media.

Either way i get errors

I imagine that it is because I need to implement Apache and mod_wsgi. So I 
am trying to follow this:
https://docs.djangoproject.com/en/1.5/howto/deployment/wsgi/modwsgi/

I am hoping someone out there can just give me some ideas or comments about 
what I am doing, if I am making some obvious mistakes, and if you can help 
me work out this error.

Many thanks!


Adam


error:

[11/Apr/2014 13:21:43] "GET /proyectos/1/ HTTP/1.1" 200 7411

[11/Apr/2014 13:21:43] "GET 
/Users/admin/Dropbox/mstudio/code/mBrain/mbrain/mbrain/static/css/bootstrap.css 
HTTP/1.1" 304 0

[11/Apr/2014 13:21:43] "GET 
/Users/admin/Dropbox/mstudio/code/mBrain/mbrain/mbrain/static/0124_Entel/edit/export/20140401/2053_canal13_marzo_20140408_1720.m4v
 
HTTP/1.1" 200 4709

Traceback (most recent call last):

  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py",
 
line 86, in run

self.finish_response()

  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py",
 
line 128, in finish_response

self.write(data)

  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py",
 
line 217, in write

self._write(data)

  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py",
 
line 324, in write

self.flush()

  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py",
 
line 303, in flush

self._sock.sendall(view[write_offset:write_offset+buffer_size])

error: [Errno 32] Broken pipe

*[11/Apr/2014 13:21:43] "GET 
/Users/admin/Dropbox/mstudio/code/mBrain/mbrain/mbrain/static/0124_Entel/edit/export/20140401/2053_canal13_marzo_20140408_1720.m4v
 
HTTP/1.1" 500 59*



Exception happened during processing of request from ('192.168.1.143', 
59968)

Traceback (most recent call last):

  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py",
 
line 593, in process_request_thread

self.finish_request(request, client_address)

  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py",
 
line 334, in finish_request

self.RequestHandlerClass(request, client_address, self)

  File 
"/Users/admin/Dropbox/mstudio/code/mBrain/venv/lib/python2.7/site-packages/django/core/servers/basehttp.py",
 
line 126, in __init__

super(WSGIRequestHandler, self).__init__(*args, **kwargs)

  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py",
 
line 651, in __init__

self.finish()

  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py",
 
line 710, in finish

self.wfile.close()

  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py",
 
line 279, in close

self.flush()

  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py",
 
line 303, in flush

self._sock.sendall(view[write_offset:write_offset+buffer_size])

error: [Errno 32] Broken pipe



-- 
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/e8df8126-651f-4527-aa6b-a66e88bf0206%40googlegroups.com.
For more options, 

Re: Apache + mod_wsgi

2013-01-04 Thread Tsolmon Narantsogt
Thanks you.

I did it. :-)

On Fri, Jan 4, 2013 at 10:23 PM, Tsolmon Narantsogt wrote:

> Thanks you its works fine.
>
> But another issue
>
> Django Version:
> 1.3.4Exception Type:
> ImportErrorException Value:
>
> No module named base.urls
>
> base is my app.
> my urls
>
> urlpatterns = patterns('',
> url(r'^$', include('base.urls')),
> .
>
>
>
> On Fri, Jan 4, 2013 at 9:51 PM, Addy Yeow  wrote:
>
>> You may want to define WSGIDaemonProcess inside your VirtualHost, see
>>
>> http://modwsgi.readthedocs.org/en/latest/configuration-directives/WSGIDaemonProcess.html
>>
>> On Fri, Jan 4, 2013 at 9:36 PM, Tsolmon Narantsogt 
>> wrote:
>> > Hello Comrades.
>> > I have a problem when deploying django project.  I installed apache and
>> > mod_wsgi module and django.
>> > And i create virtual host in /etc/apache2/sites-available/mysite
>> >
>> > content:
>> > 
>> > ServerName name
>> > ServerAdmin m...@email.com
>> > DocumentRoot /var/www/mydjangoproject/
>> > 
>> > Order allow,deny
>> > Allow from all
>> > 
>> > WSGIScriptAlias / /var/www/mydjangoproject/mydjangoproject/app.wsgi
>> > 
>> > mydjangoproject - it's my root package name
>> >
>> > and my app.wsgi
>> >
>> > import os, sys
>> >
>> > sys.path.append('/var/www')
>> > sys.path.append('/var/www/mydjangoproject')
>> > os.environ['DJANGO_SETTINGS_MODULE'] = 'mydjangoproject.settings'  #
>> this is
>> > your settings.py file
>> > import django.core.handlers.wsgi
>> > application = django.core.handlers.wsgi.WSGIHandler()
>> >
>> > But i got following error (apache log)
>> >
>> > ImportError: Could not import settings 'mydjangoproject.settings' (Is
>> it on
>> > sys.path?): No module named settings
>> >
>> > Pls send me solution. It's my first time :-)
>> >
>> > Regards.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "Django users" group.
>> > To post to this group, send email to django-users@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > django-users+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/django-users?hl=en.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Apache + mod_wsgi

2013-01-04 Thread Tsolmon Narantsogt
Thanks you its works fine.

But another issue

Django Version:1.3.4Exception Type:ImportErrorException Value:

No module named base.urls

base is my app.
my urls

urlpatterns = patterns('',
url(r'^$', include('base.urls')),
.



On Fri, Jan 4, 2013 at 9:51 PM, Addy Yeow  wrote:

> You may want to define WSGIDaemonProcess inside your VirtualHost, see
>
> http://modwsgi.readthedocs.org/en/latest/configuration-directives/WSGIDaemonProcess.html
>
> On Fri, Jan 4, 2013 at 9:36 PM, Tsolmon Narantsogt 
> wrote:
> > Hello Comrades.
> > I have a problem when deploying django project.  I installed apache and
> > mod_wsgi module and django.
> > And i create virtual host in /etc/apache2/sites-available/mysite
> >
> > content:
> > 
> > ServerName name
> > ServerAdmin m...@email.com
> > DocumentRoot /var/www/mydjangoproject/
> > 
> > Order allow,deny
> > Allow from all
> > 
> > WSGIScriptAlias / /var/www/mydjangoproject/mydjangoproject/app.wsgi
> > 
> > mydjangoproject - it's my root package name
> >
> > and my app.wsgi
> >
> > import os, sys
> >
> > sys.path.append('/var/www')
> > sys.path.append('/var/www/mydjangoproject')
> > os.environ['DJANGO_SETTINGS_MODULE'] = 'mydjangoproject.settings'  #
> this is
> > your settings.py file
> > import django.core.handlers.wsgi
> > application = django.core.handlers.wsgi.WSGIHandler()
> >
> > But i got following error (apache log)
> >
> > ImportError: Could not import settings 'mydjangoproject.settings' (Is it
> on
> > sys.path?): No module named settings
> >
> > Pls send me solution. It's my first time :-)
> >
> > Regards.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Apache + mod_wsgi

2013-01-04 Thread Addy Yeow
You may want to define WSGIDaemonProcess inside your VirtualHost, see
http://modwsgi.readthedocs.org/en/latest/configuration-directives/WSGIDaemonProcess.html

On Fri, Jan 4, 2013 at 9:36 PM, Tsolmon Narantsogt  wrote:
> Hello Comrades.
> I have a problem when deploying django project.  I installed apache and
> mod_wsgi module and django.
> And i create virtual host in /etc/apache2/sites-available/mysite
>
> content:
> 
> ServerName name
> ServerAdmin m...@email.com
> DocumentRoot /var/www/mydjangoproject/
> 
> Order allow,deny
> Allow from all
> 
> WSGIScriptAlias / /var/www/mydjangoproject/mydjangoproject/app.wsgi
> 
> mydjangoproject - it's my root package name
>
> and my app.wsgi
>
> import os, sys
>
> sys.path.append('/var/www')
> sys.path.append('/var/www/mydjangoproject')
> os.environ['DJANGO_SETTINGS_MODULE'] = 'mydjangoproject.settings'  # this is
> your settings.py file
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
>
> But i got following error (apache log)
>
> ImportError: Could not import settings 'mydjangoproject.settings' (Is it on
> sys.path?): No module named settings
>
> Pls send me solution. It's my first time :-)
>
> Regards.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Apache + mod_wsgi

2013-01-04 Thread Tsolmon Narantsogt
Hello Comrades.
I have a problem when deploying django project.  I installed apache and
mod_wsgi module and django.
And i create virtual host in /etc/apache2/sites-available/mysite

*content:*

ServerName name
ServerAdmin m...@email.com
DocumentRoot /var/www/mydjangoproject/

Order allow,deny
Allow from all

WSGIScriptAlias / /var/www/mydjangoproject/*mydjangoproject*/app.wsgi

*mydjangoproject - *it's my root package name

and my app.wsgi

import os, sys

sys.path.append('/var/www')
sys.path.append('/var/www/mydjangoproject')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mydjangoproject.settings'  # this
is your settings.py file
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

But i got following error (apache log)

ImportError: Could not import settings 'mydjangoproject.settings' (Is it on
sys.path?): No module named settings

Pls send me solution. It's my first time :-)

Regards.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django apache mod_wsgi permission denied

2012-12-16 Thread Phang Mulianto
THank for the config , i do able to run the apache22 with mod_wsgi + python
2.7 in windows server.



On Sun, Dec 2, 2012 at 3:03 PM, Loai Ghoraba  wrote:

> Thanks a million for the tip :)
>
>
> On Sun, Dec 2, 2012 at 5:08 AM, Chris Cogdon  wrote:
>
>>
>>
>> On Saturday, December 1, 2012 3:47:39 AM UTC-8, Loai Ghoraba wrote:
>>>
>>> no I mean the root of my project guys :) thanks a lot :D which lives in
>>> path/to/my/project :)
>>>
>>
>> Oh thank god for that!
>>
>> I'd actually done something similiar once... I'd removed a bunch of
>> permissions using chmod -R /   rather than chmod -R . ... This was on an
>> oldold NCR Tower 32 running SVR3. I ended up writing a program to go
>> through the archives on tape (yes, tape) and copy only the permission bits
>> from all the tape files.
>>
>> Anyway, a better form of that command is chmod -R a+rX
>>
>> The capital X means "only set the execute bit if any execute bits are
>> set". If you use lower-case x, then you'll send up setting the execute bit
>> for normal files, too, which is another potential security risk. If you
>> want to fix this up, do:
>>
>> find . -type f -print0 | xargs -0 chmod a-x
>> chmod a+x manage.py # Restore x for the Django management command
>>
>> Protip: always use the -print0 | xargs -0  form of the "find/xargs"
>> pattern, as this will prevent spaces in your paths from causing havoc.
>>
>> I wish I knew of a better way to set the x bits all the way up the tree,
>> without giving someone a program to run, the best I can come up with is:
>>
>> cd static
>> chmod a+x . .. ../.. ../../.. ../../../.. ../../../../..
>> ../../../../../.. ../../../../../../..
>>
>> and hope that's enough :)
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/_8jpEFytyesJ.
>>
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django apache mod_wsgi permission denied

2012-12-01 Thread Loai Ghoraba
Thanks a million for the tip :)

On Sun, Dec 2, 2012 at 5:08 AM, Chris Cogdon  wrote:

>
>
> On Saturday, December 1, 2012 3:47:39 AM UTC-8, Loai Ghoraba wrote:
>>
>> no I mean the root of my project guys :) thanks a lot :D which lives in
>> path/to/my/project :)
>>
>
> Oh thank god for that!
>
> I'd actually done something similiar once... I'd removed a bunch of
> permissions using chmod -R /   rather than chmod -R . ... This was on an
> oldold NCR Tower 32 running SVR3. I ended up writing a program to go
> through the archives on tape (yes, tape) and copy only the permission bits
> from all the tape files.
>
> Anyway, a better form of that command is chmod -R a+rX
>
> The capital X means "only set the execute bit if any execute bits are
> set". If you use lower-case x, then you'll send up setting the execute bit
> for normal files, too, which is another potential security risk. If you
> want to fix this up, do:
>
> find . -type f -print0 | xargs -0 chmod a-x
> chmod a+x manage.py # Restore x for the Django management command
>
> Protip: always use the -print0 | xargs -0  form of the "find/xargs"
> pattern, as this will prevent spaces in your paths from causing havoc.
>
> I wish I knew of a better way to set the x bits all the way up the tree,
> without giving someone a program to run, the best I can come up with is:
>
> cd static
> chmod a+x . .. ../.. ../../.. ../../../.. ../../../../.. ../../../../../..
> ../../../../../../..
>
> and hope that's enough :)
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/_8jpEFytyesJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django apache mod_wsgi permission denied

2012-12-01 Thread Chris Cogdon


On Saturday, December 1, 2012 3:47:39 AM UTC-8, Loai Ghoraba wrote:
>
> no I mean the root of my project guys :) thanks a lot :D which lives in 
> path/to/my/project :)
>

Oh thank god for that!

I'd actually done something similiar once... I'd removed a bunch of 
permissions using chmod -R /   rather than chmod -R . ... This was on an 
oldold NCR Tower 32 running SVR3. I ended up writing a program to go 
through the archives on tape (yes, tape) and copy only the permission bits 
from all the tape files.

Anyway, a better form of that command is chmod -R a+rX

The capital X means "only set the execute bit if any execute bits are set". 
If you use lower-case x, then you'll send up setting the execute bit for 
normal files, too, which is another potential security risk. If you want to 
fix this up, do:

find . -type f -print0 | xargs -0 chmod a-x
chmod a+x manage.py # Restore x for the Django management command

Protip: always use the -print0 | xargs -0  form of the "find/xargs" 
pattern, as this will prevent spaces in your paths from causing havoc.

I wish I knew of a better way to set the x bits all the way up the tree, 
without giving someone a program to run, the best I can come up with is:

cd static
chmod a+x . .. ../.. ../../.. ../../../.. ../../../../.. ../../../../../.. 
../../../../../../..

and hope that's enough :)


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/_8jpEFytyesJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django apache mod_wsgi permission denied

2012-12-01 Thread Loai Ghoraba
no I mean the root of my project guys :) thanks a lot :D which lives in
path/to/my/project :)

On Sat, Dec 1, 2012 at 11:42 AM, Timothy Makobu  wrote:

> Root directory??? As in / ? Nooo nonono
>
>
> On Sat, Dec 1, 2012 at 12:14 PM, Chris Cogdon  wrote:
>
>>
>>
>> On Friday, November 30, 2012 8:53:42 PM UTC-8, Mike Dewhirst wrote:
>>>
>>> On 1/12/2012 3:48pm, Loai Ghoraba wrote:
>>> > I have ran chmod o+rx on the root directory, isn't this enough (isn't
>>> > chmod applied to all folders down recursively ?) ?
>>>
>>> No. You need chmod -R o+rx
>>>
>>
>> Oh hell no, don't do that... that will impact the ENTIRE FILESYSTEM
>>
>>
>>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/cB-WWrnMMP8J.
>>
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django apache mod_wsgi permission denied

2012-12-01 Thread Timothy Makobu
Root directory??? As in / ? Nooo nonono


On Sat, Dec 1, 2012 at 12:14 PM, Chris Cogdon  wrote:

>
>
> On Friday, November 30, 2012 8:53:42 PM UTC-8, Mike Dewhirst wrote:
>>
>> On 1/12/2012 3:48pm, Loai Ghoraba wrote:
>> > I have ran chmod o+rx on the root directory, isn't this enough (isn't
>> > chmod applied to all folders down recursively ?) ?
>>
>> No. You need chmod -R o+rx
>>
>
> Oh hell no, don't do that... that will impact the ENTIRE FILESYSTEM
>
>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/cB-WWrnMMP8J.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django apache mod_wsgi permission denied

2012-12-01 Thread Chris Cogdon


On Friday, November 30, 2012 8:53:42 PM UTC-8, Mike Dewhirst wrote:
>
> On 1/12/2012 3:48pm, Loai Ghoraba wrote: 
> > I have ran chmod o+rx on the root directory, isn't this enough (isn't 
> > chmod applied to all folders down recursively ?) ? 
>
> No. You need chmod -R o+rx
>

Oh hell no, don't do that... that will impact the ENTIRE FILESYSTEM


>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/cB-WWrnMMP8J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django apache mod_wsgi permission denied

2012-11-30 Thread Loai Ghoraba
okay it works now, I was just missing a trailing slash at
Alias /static/ /home/loai/workspace/Faculty/Faculty/static/

On Sat, Dec 1, 2012 at 8:17 AM, Loai Ghoraba  wrote:

> a strange thing is that when I remove the   directive so it
> becomes:
>
> 
> Order deny,allow
> Allow from all
> 
>
> instead of
>
> 
> 
> Order deny,allow
> Allow from all
> 
> 
>
> then trying to access any static or media file raises (not found) instead
> of permission denied !
>
> On Sat, Dec 1, 2012 at 7:42 AM, Loai Ghoraba  wrote:
>
>> thanks, but still I can't find what's wrong with the permission
>> thing. The html pages are loaded without static content, no css or js or
>> whatever, neither the media is accessible.
>>
>>
>>
>> On Sat, Dec 1, 2012 at 7:15 AM, Mike Dewhirst wrote:
>>
>>> On 1/12/2012 3:57pm, Loai Ghoraba wrote:
>>>
 thanks, but I have tried this now and it also doesn't work :X though the
 author slides presentation mentioned chmod o+rx on the root dir only.

 On Sat, Dec 1, 2012 at 6:53 AM, Mike Dewhirst **> wrote:

 chmod -R o+rx

>>>
>>> Here is my working apache2 conf for project "proj" on site mydomain.com.
>>> It is running happily on Ubuntu 12.04 with permissions on all /var/www/proj
>>> directories and files rwxrwx---
>>>
>>> This is because I need users in the group to have access but no-one from
>>> outside. Apache is the owner.
>>>
>>> Good luck
>>>
>>> Mike
>>>
>>> # proj ##**###
>>>
>>> 
>>>
>>>  # proj resolves to lenny 109
>>>  DocumentRoot /var/www/proj/htdocs/
>>>  ServerName proj.mydomain.com
>>>  ServerAdmin webmas...@mydomain.com
>>>
>>>  HostnameLookups Off
>>>  UseCanonicalName Off
>>>
>>>  ErrorLog ${APACHE_LOG_DIR}/proj-error.**log
>>>  CustomLog ${APACHE_LOG_DIR}/proj-access.**log combined
>>>
>>>  Alias /robots.txt /var/www/static/proj/robots/**robots.txt
>>>  Alias /favicon.ico /var/www/static/proj/img/proj.**ico
>>>
>>>  # lock the public out
>>>  
>>>   AllowOverride None
>>>   Order deny,allow
>>>   Deny from all
>>>  
>>>
>>>  # serve uploaded media from here
>>>  
>>>   AllowOverride None
>>>
>>>   Order deny,allow
>>>   Allow from all
>>>  
>>>
>>>  # serve static stuff from here
>>>  
>>>   AllowOverride None
>>>
>>>   Order deny,allow
>>>   Allow from all
>>>  
>>>
>>>  
>>>   Alias /media/ /var/www/media/proj/
>>>   Alias /static/ /var/www/static/proj/
>>>   Alias /tiny_mce/ /var/www/static/proj/js/tiny_**mce/
>>>   Alias /jquery/ /var/www/static/proj/js/**jquery/
>>>  
>>>
>>>  
>>>WSGIScriptAlias / /var/www/proj/proj/proj.wsgi
>>>
>>>
>>>  Order deny,allow
>>>  Allow from all
>>>
>>>  
>>>
>>> 
>>>
>>>
>>>
>>>
>>>
>>>
>>>

 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To post to this group, send email to django-users@googlegroups.com.
 To unsubscribe from this group, send email to
 django-users+unsubscribe@**googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/**group/django-users?hl=en
 .

>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users+unsubscribe@*
>>> *googlegroups.com .
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en
>>> .
>>>
>>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django apache mod_wsgi permission denied

2012-11-30 Thread Loai Ghoraba
a strange thing is that when I remove the   directive so it
becomes:


Order deny,allow
Allow from all


instead of



Order deny,allow
Allow from all



then trying to access any static or media file raises (not found) instead
of permission denied !

On Sat, Dec 1, 2012 at 7:42 AM, Loai Ghoraba  wrote:

> thanks, but still I can't find what's wrong with the permission thing. The
> html pages are loaded without static content, no css or js or whatever,
> neither the media is accessible.
>
>
>
> On Sat, Dec 1, 2012 at 7:15 AM, Mike Dewhirst wrote:
>
>> On 1/12/2012 3:57pm, Loai Ghoraba wrote:
>>
>>> thanks, but I have tried this now and it also doesn't work :X though the
>>> author slides presentation mentioned chmod o+rx on the root dir only.
>>>
>>> On Sat, Dec 1, 2012 at 6:53 AM, Mike Dewhirst >> **> wrote:
>>>
>>> chmod -R o+rx
>>>
>>
>> Here is my working apache2 conf for project "proj" on site mydomain.com.
>> It is running happily on Ubuntu 12.04 with permissions on all /var/www/proj
>> directories and files rwxrwx---
>>
>> This is because I need users in the group to have access but no-one from
>> outside. Apache is the owner.
>>
>> Good luck
>>
>> Mike
>>
>> # proj ##**###
>>
>> 
>>
>>  # proj resolves to lenny 109
>>  DocumentRoot /var/www/proj/htdocs/
>>  ServerName proj.mydomain.com
>>  ServerAdmin webmas...@mydomain.com
>>
>>  HostnameLookups Off
>>  UseCanonicalName Off
>>
>>  ErrorLog ${APACHE_LOG_DIR}/proj-error.**log
>>  CustomLog ${APACHE_LOG_DIR}/proj-access.**log combined
>>
>>  Alias /robots.txt /var/www/static/proj/robots/**robots.txt
>>  Alias /favicon.ico /var/www/static/proj/img/proj.**ico
>>
>>  # lock the public out
>>  
>>   AllowOverride None
>>   Order deny,allow
>>   Deny from all
>>  
>>
>>  # serve uploaded media from here
>>  
>>   AllowOverride None
>>
>>   Order deny,allow
>>   Allow from all
>>  
>>
>>  # serve static stuff from here
>>  
>>   AllowOverride None
>>
>>   Order deny,allow
>>   Allow from all
>>  
>>
>>  
>>   Alias /media/ /var/www/media/proj/
>>   Alias /static/ /var/www/static/proj/
>>   Alias /tiny_mce/ /var/www/static/proj/js/tiny_**mce/
>>   Alias /jquery/ /var/www/static/proj/js/**jquery/
>>  
>>
>>  
>>WSGIScriptAlias / /var/www/proj/proj/proj.wsgi
>>
>>
>>  Order deny,allow
>>  Allow from all
>>
>>  
>>
>> 
>>
>>
>>
>>
>>
>>
>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscribe@**googlegroups.com
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/**group/django-users?hl=en
>>> .
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to django-users+unsubscribe@**
>> googlegroups.com .
>> For more options, visit this group at http://groups.google.com/**
>> group/django-users?hl=en
>> .
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django apache mod_wsgi permission denied

2012-11-30 Thread Loai Ghoraba
thanks, but still I can't find what's wrong with the permission thing. The
html pages are loaded without static content, no css or js or whatever,
neither the media is accessible.


On Sat, Dec 1, 2012 at 7:15 AM, Mike Dewhirst  wrote:

> On 1/12/2012 3:57pm, Loai Ghoraba wrote:
>
>> thanks, but I have tried this now and it also doesn't work :X though the
>> author slides presentation mentioned chmod o+rx on the root dir only.
>>
>> On Sat, Dec 1, 2012 at 6:53 AM, Mike Dewhirst > **> wrote:
>>
>> chmod -R o+rx
>>
>
> Here is my working apache2 conf for project "proj" on site mydomain.com.
> It is running happily on Ubuntu 12.04 with permissions on all /var/www/proj
> directories and files rwxrwx---
>
> This is because I need users in the group to have access but no-one from
> outside. Apache is the owner.
>
> Good luck
>
> Mike
>
> # proj ##**###
>
> 
>
>  # proj resolves to lenny 109
>  DocumentRoot /var/www/proj/htdocs/
>  ServerName proj.mydomain.com
>  ServerAdmin webmas...@mydomain.com
>
>  HostnameLookups Off
>  UseCanonicalName Off
>
>  ErrorLog ${APACHE_LOG_DIR}/proj-error.**log
>  CustomLog ${APACHE_LOG_DIR}/proj-access.**log combined
>
>  Alias /robots.txt /var/www/static/proj/robots/**robots.txt
>  Alias /favicon.ico /var/www/static/proj/img/proj.**ico
>
>  # lock the public out
>  
>   AllowOverride None
>   Order deny,allow
>   Deny from all
>  
>
>  # serve uploaded media from here
>  
>   AllowOverride None
>
>   Order deny,allow
>   Allow from all
>  
>
>  # serve static stuff from here
>  
>   AllowOverride None
>
>   Order deny,allow
>   Allow from all
>  
>
>  
>   Alias /media/ /var/www/media/proj/
>   Alias /static/ /var/www/static/proj/
>   Alias /tiny_mce/ /var/www/static/proj/js/tiny_**mce/
>   Alias /jquery/ /var/www/static/proj/js/**jquery/
>  
>
>  
>WSGIScriptAlias / /var/www/proj/proj/proj.wsgi
>
>
>  Order deny,allow
>  Allow from all
>
>  
>
> 
>
>
>
>
>
>
>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscribe@**googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/**group/django-users?hl=en
>> .
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> googlegroups.com .
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django apache mod_wsgi permission denied

2012-11-30 Thread Mike Dewhirst

On 1/12/2012 3:57pm, Loai Ghoraba wrote:

thanks, but I have tried this now and it also doesn't work :X though the
author slides presentation mentioned chmod o+rx on the root dir only.

On Sat, Dec 1, 2012 at 6:53 AM, Mike Dewhirst > wrote:

chmod -R o+rx


Here is my working apache2 conf for project "proj" on site mydomain.com. 
It is running happily on Ubuntu 12.04 with permissions on all 
/var/www/proj directories and files rwxrwx---


This is because I need users in the group to have access but no-one from 
outside. Apache is the owner.


Good luck

Mike

# proj #



 # proj resolves to lenny 109
 DocumentRoot /var/www/proj/htdocs/
 ServerName proj.mydomain.com
 ServerAdmin webmas...@mydomain.com

 HostnameLookups Off
 UseCanonicalName Off

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

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

 # lock the public out
 
  AllowOverride None
  Order deny,allow
  Deny from all
 

 # serve uploaded media from here
 
  AllowOverride None
  Order deny,allow
  Allow from all
 

 # serve static stuff from here
 
  AllowOverride None
  Order deny,allow
  Allow from all
 

 
  Alias /media/ /var/www/media/proj/
  Alias /static/ /var/www/static/proj/
  Alias /tiny_mce/ /var/www/static/proj/js/tiny_mce/
  Alias /jquery/ /var/www/static/proj/js/jquery/
 

 
   WSGIScriptAlias / /var/www/proj/proj/proj.wsgi
   
 Order deny,allow
 Allow from all
   
 










--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django apache mod_wsgi permission denied

2012-11-30 Thread Mike Dewhirst

On 1/12/2012 3:48pm, Loai Ghoraba wrote:

I have ran chmod o+rx on the root directory, isn't this enough (isn't
chmod applied to all folders down recursively ?) ?


No. You need chmod -R o+rx




and I have checked the directories from the root down to static, all
have the permission of drwxr-xr-x

On Sat, Dec 1, 2012 at 2:21 AM, Chris Cogdon > wrote:

Make sure all the directories, from static leading all the way up to
the root, are chmod a+x


On Friday, November 30, 2012 4:00:55 PM UTC-8, Loai Ghoraba wrote:

Hi

I have installed apache and mod_wsgi and my basic site *skeleton
is running* on local host, but with NO static files loaded such
as css, when I try to access a static file
(e.g:http://localhost/static/__css/base.css
) it says that I don't
have permission to access the file, same goes to media files

I have followed the steps in the presentation slides

http://code.google.com/__p/modwsgi/downloads/detail?__name=mod_wsgi-pycon-sydney-__2010.pdf


 and
made the directories accessible to others via chmod o+rx
, my  httpd.conf part is :

WSGIScriptAlias / /home/loai/workspace/Faculty/__Faculty/wsgi.py
WSGIPythonPath /home/loai/workspace/Faculty

Alias /media/ /home/loai/workspace/Faculty/__Faculty/media
Alias /static/ /home/loai/workspace/Faculty/__Faculty/static


Order deny,allow
Allow from all



Order deny,allow
Allow from all


Thanks

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/L3Sm-aDXA_UJ.

To post to this group, send email to django-users@googlegroups.com
.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.


--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django apache mod_wsgi permission denied

2012-11-30 Thread Loai Ghoraba
I have ran chmod o+rx on the root directory, isn't this enough (isn't chmod
applied to all folders down recursively ?) ?

and I have checked the directories from the root down to static, all have
the permission of drwxr-xr-x

On Sat, Dec 1, 2012 at 2:21 AM, Chris Cogdon  wrote:

> Make sure all the directories, from static leading all the way up to the
> root, are chmod a+x
>
>
> On Friday, November 30, 2012 4:00:55 PM UTC-8, Loai Ghoraba wrote:
>>
>> Hi
>>
>> I have installed apache and mod_wsgi and my basic site *skeleton is
>> running* on local host, but with NO static files loaded such as css, when I
>> try to access a static file 
>> (e.g:http://localhost/static/**css/base.css)
>> it says that I don't have permission to access the file, same goes to media
>> files
>>
>> I have followed the steps in the presentation slides
>> http://code.google.com/**p/modwsgi/downloads/detail?**
>> name=mod_wsgi-pycon-sydney-**2010.pdf
>>  and
>> made the directories accessible to others via chmod o+rx
>> , my  httpd.conf part is :
>>
>> WSGIScriptAlias / /home/loai/workspace/Faculty/**Faculty/wsgi.py
>> WSGIPythonPath /home/loai/workspace/Faculty
>>
>> Alias /media/ /home/loai/workspace/Faculty/**Faculty/media
>> Alias /static/ /home/loai/workspace/Faculty/**Faculty/static
>>
>> 
>> Order deny,allow
>> Allow from all
>> 
>>
>> 
>> Order deny,allow
>> Allow from all
>> 
>>
>> Thanks
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/L3Sm-aDXA_UJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django apache mod_wsgi permission denied

2012-11-30 Thread Chris Cogdon
Make sure all the directories, from static leading all the way up to the 
root, are chmod a+x

On Friday, November 30, 2012 4:00:55 PM UTC-8, Loai Ghoraba wrote:
>
> Hi 
>
> I have installed apache and mod_wsgi and my basic site *skeleton is 
> running* on local host, but with NO static files loaded such as css, when I 
> try to access a static file (e.g:http://localhost/static/css/base.css) it 
> says that I don't have permission to access the file, same goes to media 
> files 
>
> I have followed the steps in the presentation slides 
> http://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-pycon-sydney-2010.pdf
>  and 
> made the directories accessible to others via chmod o+rx 
> , my  httpd.conf part is :
>
> WSGIScriptAlias / /home/loai/workspace/Faculty/Faculty/wsgi.py
> WSGIPythonPath /home/loai/workspace/Faculty
>
> Alias /media/ /home/loai/workspace/Faculty/Faculty/media
> Alias /static/ /home/loai/workspace/Faculty/Faculty/static
>
> 
> Order deny,allow
> Allow from all
> 
>
> 
> Order deny,allow
> Allow from all
> 
>
> Thanks
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/L3Sm-aDXA_UJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django apache mod_wsgi permission denied

2012-11-30 Thread Loai Ghoraba
Hi 

I have installed apache and mod_wsgi and my basic site *skeleton is 
running* on local host, but with NO static files loaded such as css, when I 
try to access a static file (e.g:http://localhost/static/css/base.css) it 
says that I don't have permission to access the file, same goes to media 
files 

I have followed the steps in the presentation slides 
http://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-pycon-sydney-2010.pdf
 and 
made the directories accessible to others via chmod o+rx 
, my  httpd.conf part is :

WSGIScriptAlias / /home/loai/workspace/Faculty/Faculty/wsgi.py
WSGIPythonPath /home/loai/workspace/Faculty

Alias /media/ /home/loai/workspace/Faculty/Faculty/media
Alias /static/ /home/loai/workspace/Faculty/Faculty/static


Order deny,allow
Allow from all



Order deny,allow
Allow from all


Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/LG9AgaTxaWAJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-30 Thread Cal Leeming [Simplicity Media Ltd]
Just to chime in on this..

In terms of commercial options, we have sometimes gone with ZXTM (now known
as StingRay Traffic Manager) , it has some truly amazing features and you
should definitely check it out. I believe that RiverBed have since started
issuing free commercial licences for up to a certain traffic rate, and it's
a downloadable package/virtual appliance.

We also often use the load balancers that come with Rackspace Cloud, they
have proven to be quite efficient. When using this route, we also tend to
throw everything in front of CloudFlare too (if you haven't seen this
already, check it out. It is free for non SSL usage too!)

In a nut shell;

* ZXTM - commercial (free licence to a certain amount), amazing traffic
script language, self hosted
* Rackspace Cloud - does what it says on the tin, no traffic scripting
* F5 - commercial, not had any personal experience with it (but one of our
providers uses it as a shared load balancer for their customers and it's
been stable)
* haproxy - works, but it can be a pita!
* CloudFlare - this isn't a load balancer, but does give you much better
control over DNS (it proxies your site, and effectively makes 'DNS changes'
instant)

I believe uWSGI has some really good load balancing features too, but I
haven't used them in too much depth yet (despite being an avid user of
uWSGI for 2-3 years!)

Hope this helps

Cal

On Tue, Oct 30, 2012 at 8:14 AM, Kurtis Mullins <kurtis.mull...@gmail.com>wrote:

> The easiest thing I've found to use is simply uWSGI with Nginx. It's easy
> to just create new Django servers on the fly. You simply include the IPs in
> a list and it will use various algorithms (optional) to distribute the
> requests appropriately.
>
> As a lot of applications are IO bound, you could also use a distributed
> database system to help with your scalability. I don't have much experience
> in that area, though.
>
> This still leaves a point of failure: Nginx (or whatever load balancer or
> reverse proxy you use). Maybe someone else here will know more about load
> balancing Nginx itself ... that might require specialized hardware. I know
> a lot of cloud services offer load balancers (e.g. rackspace) so you could
> possibly use that with multiple nginx servers and further multiple django
> servers.
>
>
> On Tue, Oct 30, 2012 at 3:42 AM, Isaac XXX <vyrp...@gmail.com> wrote:
>
>> Hi there,
>>
>> maybe you're right, but I'm not really worried about RAM footprint, or
>> resources consumption. I'm concerned now on architecture, setting a right
>> scalable system, and a right cluster of systems, without lacks of
>> communications between them.
>>
>> Underlaying technologies can be easily replaced (say apache-mod_wsgi for
>> gunicorn or uwsgi), and some performance improvements can be made, but this
>> is not what I'm looking for. I'm looking for the tools to generate a robust
>> system, balancing requests through several systems, and allowing increase
>> the size of this system (adding more servers) without trouble.
>>
>> Cheers,
>>
>> Isaac
>>
>>
>> On 10/29/2012 05:18 PM, Some Developer wrote:
>>
>>> On 29/10/2012 16:03, Isaac XXX wrote:
>>>
>>>> Hi there,
>>>>
>>>> thank you for response Tom.
>>>>
>>>> Actually, I've a complete idea at how to build this system, but I lack
>>>> the exact information about how to join systems, and what I was looking for
>>>> was a source of cohesive information on all systems. At least, when I
>>>> finish to build that system, I will write this tutorial.
>>>>
>>>> For someone who can help me, I will describe here what I thought it can
>>>> be this structure:
>>>>
>>>> - 1 nginx, as a reverse proxy on frontend, serving static/media and
>>>> redirecting content to apache clusters
>>>> - n apache servers, with mod_wsgi, serving dynamic data
>>>> - m postgresql servers, in a master-slave flavour
>>>>
>>>> Cheers,
>>>>
>>>> Isaac
>>>>
>>>
>>> Why not just ditch Apache entirely and just use Nginx for serving all
>>> media (both static and dynamic)? You can then save quite a few resources as
>>> you only need to run one HTTP server rather than two.
>>>
>>> Using Nginx to serve Django content works well. Just serve your Django
>>> application via FastCGI or uWSGI and you'll significantly simplify your
>>> configuration and reduce RAM usage on your servers as well.
>>>
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> &qu

Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-30 Thread Tom Evans
On Tue, Oct 30, 2012 at 7:35 AM, Isaac XXX  wrote:
> Hi Tom,
>
> you're right, I was not really explicit about what were my lacks of
> information. Right now, the following points are the ones I can't found a
> howto for the desired deployment:
>
> - Create a master-slave system on postgresql, maintaining all systems up to
> date, distributing reads, and centralizing writes
> - How to configure a cluster of reverse proxies (a single reverse proxy can
> not be enought, and I need to plan to deploy more than 1 load balancers)
>
> The rest (configure apache with mod_wsgit, configure nginx to serve static
> content and so on), is now solved on my current deployments, so it should
> not be a problem on a distributed environment.
>
> Cheers,
>
> Isaac
>

Hi Isaac

We use a similar setup at $JOB. We run a pair of apache httpd servers,
which serve static content and reverse proxy to other http servers
(usually apache again, sometimes not) for dynamic content. The
requests are distributed evenly between the two proxies by our
routers, which round robin connections between the two of them. This
is basically your setup, but we use Apache, because we know it and can
tune it to give nginx like performance anyway.

Actually, that's only half of it - each proxy has all of the public
IPs we serve allocated on lo0 (loopback), and the requests are round
robin routed via a pair of high availability addresses. Therefore, on
both boxes, apache listens on the 'right' IPs. If we ever want to run
with just one proxy, we can 'down' one of the HA addresses on the
server we wish to update, which moves that HA address to be active on
the other proxy, which then serves all the requests.

Now, did we need to do any of this? Probably not! We serve in the
region of 3-5 million requests a day, with peaks of around 200
concurrent requests/s going through the proxies. Apache uses in total
500MB of RAM, pre-tuned to serve up to 768 concurrent req/s without
requiring extra resources. Load average on the boxes never goes above
0.05, even if we put all the requests through one machine. It's nice
having a spare for such a critical part of infrastructure though.

pgsql scaling is a little more involved than MySQL, which is what
we've always used here - usually because it's replication systems are
so good. You will typically need to use some external software to
manage the replication, eg Slony, but don't take my word for it, very
limited pgsql experience.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-30 Thread Kurtis Mullins
The easiest thing I've found to use is simply uWSGI with Nginx. It's easy
to just create new Django servers on the fly. You simply include the IPs in
a list and it will use various algorithms (optional) to distribute the
requests appropriately.

As a lot of applications are IO bound, you could also use a distributed
database system to help with your scalability. I don't have much experience
in that area, though.

This still leaves a point of failure: Nginx (or whatever load balancer or
reverse proxy you use). Maybe someone else here will know more about load
balancing Nginx itself ... that might require specialized hardware. I know
a lot of cloud services offer load balancers (e.g. rackspace) so you could
possibly use that with multiple nginx servers and further multiple django
servers.

On Tue, Oct 30, 2012 at 3:42 AM, Isaac XXX <vyrp...@gmail.com> wrote:

> Hi there,
>
> maybe you're right, but I'm not really worried about RAM footprint, or
> resources consumption. I'm concerned now on architecture, setting a right
> scalable system, and a right cluster of systems, without lacks of
> communications between them.
>
> Underlaying technologies can be easily replaced (say apache-mod_wsgi for
> gunicorn or uwsgi), and some performance improvements can be made, but this
> is not what I'm looking for. I'm looking for the tools to generate a robust
> system, balancing requests through several systems, and allowing increase
> the size of this system (adding more servers) without trouble.
>
> Cheers,
>
> Isaac
>
>
> On 10/29/2012 05:18 PM, Some Developer wrote:
>
>> On 29/10/2012 16:03, Isaac XXX wrote:
>>
>>> Hi there,
>>>
>>> thank you for response Tom.
>>>
>>> Actually, I've a complete idea at how to build this system, but I lack
>>> the exact information about how to join systems, and what I was looking for
>>> was a source of cohesive information on all systems. At least, when I
>>> finish to build that system, I will write this tutorial.
>>>
>>> For someone who can help me, I will describe here what I thought it can
>>> be this structure:
>>>
>>> - 1 nginx, as a reverse proxy on frontend, serving static/media and
>>> redirecting content to apache clusters
>>> - n apache servers, with mod_wsgi, serving dynamic data
>>> - m postgresql servers, in a master-slave flavour
>>>
>>> Cheers,
>>>
>>> Isaac
>>>
>>
>> Why not just ditch Apache entirely and just use Nginx for serving all
>> media (both static and dynamic)? You can then save quite a few resources as
>> you only need to run one HTTP server rather than two.
>>
>> Using Nginx to serve Django content works well. Just serve your Django
>> application via FastCGI or uWSGI and you'll significantly simplify your
>> configuration and reduce RAM usage on your servers as well.
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> googlegroups.com <django-users%2bunsubscr...@googlegroups.com>.
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en<http://groups.google.com/group/django-users?hl=en>
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-30 Thread Isaac XXX

Hi there,

maybe you're right, but I'm not really worried about RAM footprint, or 
resources consumption. I'm concerned now on architecture, setting a 
right scalable system, and a right cluster of systems, without lacks of 
communications between them.


Underlaying technologies can be easily replaced (say apache-mod_wsgi for 
gunicorn or uwsgi), and some performance improvements can be made, but 
this is not what I'm looking for. I'm looking for the tools to generate 
a robust system, balancing requests through several systems, and 
allowing increase the size of this system (adding more servers) without 
trouble.


Cheers,

Isaac

On 10/29/2012 05:18 PM, Some Developer wrote:

On 29/10/2012 16:03, Isaac XXX wrote:

Hi there,

thank you for response Tom.

Actually, I've a complete idea at how to build this system, but I 
lack the exact information about how to join systems, and what I was 
looking for was a source of cohesive information on all systems. At 
least, when I finish to build that system, I will write this tutorial.


For someone who can help me, I will describe here what I thought it 
can be this structure:


- 1 nginx, as a reverse proxy on frontend, serving static/media and 
redirecting content to apache clusters

- n apache servers, with mod_wsgi, serving dynamic data
- m postgresql servers, in a master-slave flavour

Cheers,

Isaac


Why not just ditch Apache entirely and just use Nginx for serving all 
media (both static and dynamic)? You can then save quite a few 
resources as you only need to run one HTTP server rather than two.


Using Nginx to serve Django content works well. Just serve your Django 
application via FastCGI or uWSGI and you'll significantly simplify 
your configuration and reduce RAM usage on your servers as well.




--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-30 Thread Isaac XXX
Thank you so much for tips. I will keep them when I start to test 
environment for performance.


Cheers

Isaac

On 10/29/2012 06:44 PM, Cal Leeming [Simplicity Media Ltd] wrote:

Hi Isaac,

If there is one thing I have learnt about scaling apps, it's about 
trying things out for yourself.


Sure there are some best practice guidelines (i.e. serving files from 
nginx, or using apache's X-SendFile rather than streaming out via the 
webapp), but if someone comes along and tells you to use X instead of 
Y, then you don't get the advantages of learning "the hard way".


Another important note is that scaling rarely goes up on a 1:1 ratio, 
i.e. the configuration and resources required to handle X number of 
requests/sec, may be completely different if you need to handle Y 
number of requests/sec.


And often what works for one person, won't work for another (scaling 
is entirely dependant on your application, despite what any of these 
cloud providers might tell you!)


In my own experience, I've found that;

* SSDs with Percona MySQL, resolves a LOT of performance problems - 
but don't abuse it

* Lots and lots and lots of query tuning and InnoDB tuning
* New Relic to identify bottlenecks
* IO contention is a big thing
* Snowball prevention (i.e. you set max clients to X, your backend 
can't handle it, your requests stack up, the load balancer forces time 
out, and your database gets smashed - or you set max memory too high, 
server goes into swap etc).

* uWSGI + nginx is amazing
* Identify where your bottlenecks are (in my own experience, IO/memory 
tends to come up more often than CPU)


Sadly I haven't tried PSQL so I can't offer any advice on this - 
Percona are dragging MySQL kicking and screaming into the 21st century 
and really doing some amazing things, but it's by no means perfect!


The above has helped us grow past 8k-12k requests/minute, the largest 
database we manage is around 1.1 billion rows weighing in at 160GB+, 
and we maintain around 60+ servers.


I should reiterate, the above is purely based on my own experience and 
use cases - I am by no means an expert on the subject and I'm still 
learning approaches on a daily basis - so this is really meant as 
"food for thought" rather than a "this is how you should do things".


Hope this helps a bit!

Cal

On Mon, Oct 29, 2012 at 2:42 PM, Isaac XXX <vyrp...@gmail.com 
<mailto:vyrp...@gmail.com>> wrote:


Hi folks,

I'm developing a new application that should get high traffic.
Right now, I've other projects with the follow architecture:

Nginx on front: serving static content and redirecting to apache
for dynamic data
Apache+mod_wsgi: serving dynamic pages
PostgreSQL: backend for data storage (RDBM)
Memcache: for caching purposes :)

All my deployments use a single server, with single
frontend/backend (1 nginx, 1 apache, 1 postgresql). The
requirements for this new project are really large, and I think I
will need to scale all system. Can anyone suggest me an all-in-one
tutorial, discussing the main points on scale a system?

I know there are different alternatives for DB (master-slave,
clustering...), nginx can serve as a reverse proxy or not... and I
need to merge all this information in a single scalable system,
but I can't find an unified source of information.

Can anyone help me on it?

-- 
You received this message because you are subscribed to the Google

Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com
<mailto:django-users%2bunsubscr...@googlegroups.com>.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.


--
You received this message because you are subscribed to the Google 
Groups "Django users" group.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-30 Thread Isaac XXX

Hi Tom,

you're right, I was not really explicit about what were my lacks of 
information. Right now, the following points are the ones I can't found 
a howto for the desired deployment:


- Create a master-slave system on postgresql, maintaining all systems up 
to date, distributing reads, and centralizing writes
- How to configure a cluster of reverse proxies (a single reverse proxy 
can not be enought, and I need to plan to deploy more than 1 load balancers)


The rest (configure apache with mod_wsgit, configure nginx to serve 
static content and so on), is now solved on my current deployments, so 
it should not be a problem on a distributed environment.


Cheers,

Isaac

On 10/29/2012 05:23 PM, Tom Evans wrote:

On Mon, Oct 29, 2012 at 4:03 PM, Isaac XXX <vyrp...@gmail.com> wrote:

Hi there,

thank you for response Tom.

Actually, I've a complete idea at how to build this system, but I lack the
exact information about how to join systems, and what I was looking for was
a source of cohesive information on all systems. At least, when I finish to
build that system, I will write this tutorial.

For someone who can help me, I will describe here what I thought it can be
this structure:

- 1 nginx, as a reverse proxy on frontend, serving static/media and
redirecting content to apache clusters
- n apache servers, with mod_wsgi, serving dynamic data
- m postgresql servers, in a master-slave flavour

Cheers,

Isaac


I'm confused about what you are confused about - you seem to grasp
precisely what is required.

IE, which of the following Qs are you stuck at:

How to configure nginx to reverse proxy and balance to other http servers?
How to configure apache, mod_wsgi and django?
How to configure pgsql in a master/multiple slave environment?
How to configure django to issue write requests to the write master,
and distribute reads to read-only slaves?


Cheers

Tom



--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Kurtis Mullins
The old rule of thumb is to avoid premature optimization. I'd build,
profile, then scale or otherwise optimize as needed. This isn't a tutorial
or really a discussion on all points of scaling a system; but identifying
bottle necks will do wonders when it comes to deciding what, where, and how
to scale. Good luck!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Cal Leeming [Simplicity Media Ltd]
Hi Isaac,

If there is one thing I have learnt about scaling apps, it's about trying
things out for yourself.

Sure there are some best practice guidelines (i.e. serving files from
nginx, or using apache's X-SendFile rather than streaming out via the
webapp), but if someone comes along and tells you to use X instead of Y,
then you don't get the advantages of learning "the hard way".

Another important note is that scaling rarely goes up on a 1:1 ratio, i.e.
the configuration and resources required to handle X number of
requests/sec, may be completely different if you need to handle Y number of
requests/sec.

And often what works for one person, won't work for another (scaling is
entirely dependant on your application, despite what any of these cloud
providers might tell you!)

In my own experience, I've found that;

* SSDs with Percona MySQL, resolves a LOT of performance problems - but
don't abuse it
* Lots and lots and lots of query tuning and InnoDB tuning
* New Relic to identify bottlenecks
* IO contention is a big thing
* Snowball prevention (i.e. you set max clients to X, your backend can't
handle it, your requests stack up, the load balancer forces time out, and
your database gets smashed - or you set max memory too high, server goes
into swap etc).
* uWSGI + nginx is amazing
* Identify where your bottlenecks are (in my own experience, IO/memory
tends to come up more often than CPU)

Sadly I haven't tried PSQL so I can't offer any advice on this - Percona
are dragging MySQL kicking and screaming into the 21st century and really
doing some amazing things, but it's by no means perfect!

The above has helped us grow past 8k-12k requests/minute, the largest
database we manage is around 1.1 billion rows weighing in at 160GB+, and we
maintain around 60+ servers.

I should reiterate, the above is purely based on my own experience and use
cases - I am by no means an expert on the subject and I'm still learning
approaches on a daily basis - so this is really meant as "food for thought"
rather than a "this is how you should do things".

Hope this helps a bit!

Cal

On Mon, Oct 29, 2012 at 2:42 PM, Isaac XXX <vyrp...@gmail.com> wrote:

> Hi folks,
>
> I'm developing a new application that should get high traffic. Right now,
> I've other projects with the follow architecture:
>
> Nginx on front: serving static content and redirecting to apache for
> dynamic data
> Apache+mod_wsgi: serving dynamic pages
> PostgreSQL: backend for data storage (RDBM)
> Memcache: for caching purposes :)
>
> All my deployments use a single server, with single frontend/backend (1
> nginx, 1 apache, 1 postgresql). The requirements for this new project are
> really large, and I think I will need to scale all system. Can anyone
> suggest me an all-in-one tutorial, discussing the main points on scale a
> system?
>
> I know there are different alternatives for DB (master-slave,
> clustering...), nginx can serve as a reverse proxy or not... and I need to
> merge all this information in a single scalable system, but I can't find an
> unified source of information.
>
> Can anyone help me on it?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> googlegroups.com <django-users%2bunsubscr...@googlegroups.com>.
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en<http://groups.google.com/group/django-users?hl=en>
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Some Developer

On 29/10/2012 16:03, Isaac XXX wrote:

Hi there,

thank you for response Tom.

Actually, I've a complete idea at how to build this system, but I lack 
the exact information about how to join systems, and what I was 
looking for was a source of cohesive information on all systems. At 
least, when I finish to build that system, I will write this tutorial.


For someone who can help me, I will describe here what I thought it 
can be this structure:


- 1 nginx, as a reverse proxy on frontend, serving static/media and 
redirecting content to apache clusters

- n apache servers, with mod_wsgi, serving dynamic data
- m postgresql servers, in a master-slave flavour

Cheers,

Isaac


Why not just ditch Apache entirely and just use Nginx for serving all 
media (both static and dynamic)? You can then save quite a few resources 
as you only need to run one HTTP server rather than two.


Using Nginx to serve Django content works well. Just serve your Django 
application via FastCGI or uWSGI and you'll significantly simplify your 
configuration and reduce RAM usage on your servers as well.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Tom Evans
On Mon, Oct 29, 2012 at 4:03 PM, Isaac XXX <vyrp...@gmail.com> wrote:
> Hi there,
>
> thank you for response Tom.
>
> Actually, I've a complete idea at how to build this system, but I lack the
> exact information about how to join systems, and what I was looking for was
> a source of cohesive information on all systems. At least, when I finish to
> build that system, I will write this tutorial.
>
> For someone who can help me, I will describe here what I thought it can be
> this structure:
>
> - 1 nginx, as a reverse proxy on frontend, serving static/media and
> redirecting content to apache clusters
> - n apache servers, with mod_wsgi, serving dynamic data
> - m postgresql servers, in a master-slave flavour
>
> Cheers,
>
> Isaac
>

I'm confused about what you are confused about - you seem to grasp
precisely what is required.

IE, which of the following Qs are you stuck at:

How to configure nginx to reverse proxy and balance to other http servers?
How to configure apache, mod_wsgi and django?
How to configure pgsql in a master/multiple slave environment?
How to configure django to issue write requests to the write master,
and distribute reads to read-only slaves?


Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Isaac XXX

Hi there,

thank you for response Tom.

Actually, I've a complete idea at how to build this system, but I lack 
the exact information about how to join systems, and what I was looking 
for was a source of cohesive information on all systems. At least, when 
I finish to build that system, I will write this tutorial.


For someone who can help me, I will describe here what I thought it can 
be this structure:


- 1 nginx, as a reverse proxy on frontend, serving static/media and 
redirecting content to apache clusters

- n apache servers, with mod_wsgi, serving dynamic data
- m postgresql servers, in a master-slave flavour

Cheers,

Isaac

On 10/29/2012 04:23 PM, Tom Evans wrote:

On Mon, Oct 29, 2012 at 2:42 PM, Isaac XXX <vyrp...@gmail.com> wrote:

Hi folks,

I'm developing a new application that should get high traffic. Right now,
I've other projects with the follow architecture:

Nginx on front: serving static content and redirecting to apache for dynamic
data
Apache+mod_wsgi: serving dynamic pages
PostgreSQL: backend for data storage (RDBM)
Memcache: for caching purposes :)

All my deployments use a single server, with single frontend/backend (1
nginx, 1 apache, 1 postgresql). The requirements for this new project are
really large, and I think I will need to scale all system. Can anyone
suggest me an all-in-one tutorial, discussing the main points on scale a
system?

I know there are different alternatives for DB (master-slave,
clustering...), nginx can serve as a reverse proxy or not... and I need to
merge all this information in a single scalable system, but I can't find an
unified source of information.

Can anyone help me on it?


There is unlikely to be one authoritative source that will explain
precisely how to scale an app - part of this is it is domain specific
what "scale" and "app" mean!

So first off, "scale". You can scale up, or out. Scaling up means
running everything on faster hardware. Due to how IT progresses, every
18 months you can replace your server with something twice as fast.
Scale out means running everything over more boxes. Scale up is
trivial, just spend more money, scale out can be harder.

Most parts of the stack are easy to scale, because HTTP itself is
stateless and therefore easy to scale. Eg, if you have a nginx
frontend, serving static files and proxying to backend servers for
static content, and the nginx server is overloaded, it is easy to add
a balancer to route HTTP requests to multiple nginx servers.

The same is true for dynamic content - need more workers, add more
machines, and tell nginx to talk to more machines.

The only tricky aspect of scale out is database. Most databases do not
have a simple 'scale out' option. With postgres, you can setup
master-slave trees, but this only expands your read capacity, all
writes have to go through one server (and then all the slaves, making
it more expensive the more slaves you add).

The only true way of scaling out with database servers is to shard
your data, splitting it up by some arbitrary algorithm (usually on
user), but sharding isn't easy, you will have to design your database
and app around it. There are some very good videos, docs and talks
from the likes of Facebook and the like, sharding is not a panacea and
requires a lot of work.

Cheers

Tom



--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Tom Evans
On Mon, Oct 29, 2012 at 2:42 PM, Isaac XXX <vyrp...@gmail.com> wrote:
> Hi folks,
>
> I'm developing a new application that should get high traffic. Right now,
> I've other projects with the follow architecture:
>
> Nginx on front: serving static content and redirecting to apache for dynamic
> data
> Apache+mod_wsgi: serving dynamic pages
> PostgreSQL: backend for data storage (RDBM)
> Memcache: for caching purposes :)
>
> All my deployments use a single server, with single frontend/backend (1
> nginx, 1 apache, 1 postgresql). The requirements for this new project are
> really large, and I think I will need to scale all system. Can anyone
> suggest me an all-in-one tutorial, discussing the main points on scale a
> system?
>
> I know there are different alternatives for DB (master-slave,
> clustering...), nginx can serve as a reverse proxy or not... and I need to
> merge all this information in a single scalable system, but I can't find an
> unified source of information.
>
> Can anyone help me on it?
>

There is unlikely to be one authoritative source that will explain
precisely how to scale an app - part of this is it is domain specific
what "scale" and "app" mean!

So first off, "scale". You can scale up, or out. Scaling up means
running everything on faster hardware. Due to how IT progresses, every
18 months you can replace your server with something twice as fast.
Scale out means running everything over more boxes. Scale up is
trivial, just spend more money, scale out can be harder.

Most parts of the stack are easy to scale, because HTTP itself is
stateless and therefore easy to scale. Eg, if you have a nginx
frontend, serving static files and proxying to backend servers for
static content, and the nginx server is overloaded, it is easy to add
a balancer to route HTTP requests to multiple nginx servers.

The same is true for dynamic content - need more workers, add more
machines, and tell nginx to talk to more machines.

The only tricky aspect of scale out is database. Most databases do not
have a simple 'scale out' option. With postgres, you can setup
master-slave trees, but this only expands your read capacity, all
writes have to go through one server (and then all the slaves, making
it more expensive the more slaves you add).

The only true way of scaling out with database servers is to shard
your data, splitting it up by some arbitrary algorithm (usually on
user), but sharding isn't easy, you will have to design your database
and app around it. There are some very good videos, docs and talks
from the likes of Facebook and the like, sharding is not a panacea and
requires a lot of work.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Isaac XXX

Hi folks,

I'm developing a new application that should get high traffic. Right 
now, I've other projects with the follow architecture:


Nginx on front: serving static content and redirecting to apache for 
dynamic data

Apache+mod_wsgi: serving dynamic pages
PostgreSQL: backend for data storage (RDBM)
Memcache: for caching purposes :)

All my deployments use a single server, with single frontend/backend (1 
nginx, 1 apache, 1 postgresql). The requirements for this new project 
are really large, and I think I will need to scale all system. Can 
anyone suggest me an all-in-one tutorial, discussing the main points on 
scale a system?


I know there are different alternatives for DB (master-slave, 
clustering...), nginx can serve as a reverse proxy or not... and I need 
to merge all this information in a single scalable system, but I can't 
find an unified source of information.


Can anyone help me on it?

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Apache/mod_wsgi documentation problem

2012-06-18 Thread Daniel Roseman
On Monday, 18 June 2012 13:42:46 UTC+1, coolgeek wrote:
>
> Hello - 
>
> Django newb.  I hope this is the right place to post this.  
>
> I had a problem with the virtualenv section of the Apache/mod_wsgi 
> documentation 
>
>
> https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/modwsgi/#using-a-virtualenv
>
> Please remove the line:
>
> "To do this, you can add another line to your Apache configuration:" 
>
> and change the following configuration directive to:
>
> "WSGIPythonPath 
> /path/to/your/venv/lib/python2.X/site-packages:/path/to/mysite.com"
>
>
>
> Thank you.
>
>
>
If you think the documentation needs changing, you should raise a bug in 
the tracker (http://code.djangoproject.com) or create a fork/pull request 
(https://github.com/django/django).
--
DR. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/ZTIfI5goMM0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Apache/mod_wsgi documentation problem

2012-06-18 Thread coolgeek
Hello - 

Django newb.  I hope this is the right place to post this.  

I had a problem with the virtualenv section of the Apache/mod_wsgi 
documentation 

https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/modwsgi/#using-a-virtualenv

Please remove the line:

"To do this, you can add another line to your Apache configuration:" 

and change the following configuration directive to:

"WSGIPythonPath 
/path/to/your/venv/lib/python2.X/site-packages:/path/to/mysite.com"



Thank you.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/VNDQ7sGh4OwJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Multiple Django Virtual Hosts on Apache+mod_wsgi but only one gets served

2012-02-10 Thread Tom Evans
On Tue, Feb 7, 2012 at 12:55 AM, Chris Cuilla  wrote:
> I've been struggling to figure out the following problem and am hoping
> someone else has seen this.
>
> I have a server running Apache 2 w/mod_wsgi. I've setup multiple,
> different Django apps. Each has its own virtual host configuration
> (see below).
>
> This is on a local test server and my client machines have /etc/hosts
> configured to point both app_a and app_b hostnames to the same
> machine.
>

Two things:

You must use valid hostnames for ServerName. '_' is not valid in a hostname.
Do you have the directive "NameVirtualHost *:80" ?


Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Multiple Django Virtual Hosts on Apache+mod_wsgi but only one gets served

2012-02-06 Thread Chris Cuilla
I've been struggling to figure out the following problem and am hoping
someone else has seen this.

I have a server running Apache 2 w/mod_wsgi. I've setup multiple,
different Django apps. Each has its own virtual host configuration
(see below).

This is on a local test server and my client machines have /etc/hosts
configured to point both app_a and app_b hostnames to the same
machine.

The problem I have is that Apache is only serving app_a regardless of
whether I go to app_a or app_b in my browser.

Has anyone seen anything like this?

P.S. When configured as plain, vanilla virtual hosts (i.e., no
mod_wsgi) the virtual hosting works just fine.



ServerName app_a


Order deny,allow
Allow from all



Order deny,allow
Allow from all



Order deny,allow
Allow from all


LogLevel warn
ErrorLog  /home/app_a/public_html/app_a/logs/apache_error.log
CustomLog /home/app_a/public_html/app_a/logs/apache_access.log
combined

WSGIDaemonProcess app_a user=www-data group=www-data threads=20
processes=2 display-name=app_a
WSGIProcessGroup app_a

WSGIScriptAlias / /home/app_a/public_html/app_a/app_a/app.wsgi



ServerName app_b


Order deny,allow
Allow from all



Order deny,allow
Allow from all



Order deny,allow
Allow from all


LogLevel warn
ErrorLog  /home/app_b/public_html/app_b/logs/apache_error.log
CustomLog /home/app_b/public_html/app_b/logs/apache_access.log
combined

WSGIDaemonProcess app_b user=www-data group=www-data threads=20
processes=2 display-name=app_b
WSGIProcessGroup app_b

WSGIScriptAlias / /home/app_b/public_html/app_b/app_b/app.wsgi


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Error with Apache + mod_wsgi

2012-01-27 Thread Reinout van Rees

On 13-01-12 23:09, polar wrote:

ImproperlyConfigured: Error importing middleware
django.middleware.csrf: "No module named csrf"

I don't understand why because I didn't change anything in apache or
in the django.wsgi files. I just restart my cloud server. In the same
time, a php project running with apache is ok.


Probably something changed in your OS. Two common ones:

- You recently installed Django globally and now your project finds the 
(older) global django before it finds the one in your project.


- Your OS's default python version changed and you get different libraries.


I'd try looking at /usr/lib/pymodules/python2.6/django and figure out 
which Django version that is. And if python 2.6 is the same one as was 
running before.



Reinout

--
Reinout van Reeshttp://reinout.vanrees.org/
rein...@vanrees.org http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Error with Apache + mod_wsgi

2012-01-27 Thread polar
Hi,

I deployed my django projects in virtual environnement with apache and
mod_wsgi 10 monthes ago.

I had not any problem with them but since three days, I can't get my
websites under django, apache and wsgi.

In the apache var logs, I have this errors when I restart apache and I
try to get the url :

[Fri Jan 13 22:44:43 2012] [error] Exception KeyError:
KeyError(-1212032368,) in  ignored
[Fri Jan 13 22:56:44 2012] [error] [client 123.126.50.75] mod_wsgi
(pid=13452): Exception occurred processing WSGI script '/www/python-
envs/myproject/django.wsgi'.
[Fri Jan 13 22:56:44 2012] [error] [client 123.126.50.75] Traceback
(most recent call last):
[Fri Jan 13 22:56:44 2012] [error] [client 123.126.50.75]   File "/usr/
lib/pymodules/python2.6/django/core/handlers/wsgi.py", line 230, in
__call__
[Fri Jan 13 22:56:44 2012] [error] [client 123.126.50.75]
self.load_middleware()
[Fri Jan 13 22:56:44 2012] [error] [client 123.126.50.75]   File "/usr/
lib/pymodules/python2.6/django/core/handlers/base.py", line 42, in
load_middleware
[Fri Jan 13 22:56:44 2012] [error] [client 123.126.50.75] raise
exceptions.ImproperlyConfigured, 'Error importing middleware %s: "%s"'
% (mw_module, e)
[Fri Jan 13 22:56:44 2012] [error] [client 123.126.50.75]
ImproperlyConfigured: Error importing middleware
django.middleware.csrf: "No module named csrf"

I don't understand why because I didn't change anything in apache or
in the django.wsgi files. I just restart my cloud server. In the same
time, a php project running with apache is ok.

Any idea ?

Thanks for your answers.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: apache+mod_wsgi, redirect to https

2011-05-31 Thread refreegrata
Thanks men, I did this:
--

  
   ...
   ...
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
  
...


Works ok to me. Now I must to test the "Require Auth".
Bye.


On 31 mayo, 13:33, Michael Scovetta 
wrote:
> I usually set up two virtual hosts, one listening on port 80 and the other
> on 443. The virtual host listening on port 80 just redirects to the other
> one:
>
> 
>     ServerAdmin ad...@example.com
>     ServerName domain.com
>
>     HostnameLookups Off
>     UseCanonicalName On
>     ServerSignature Off
>
>     Redirect /https://domain.com/
> 
>
> 
>     SSLEngine on
>
>     ServerAdmin ad...@example.com
>     ServerName domain.com
>
>     HostnameLookups Off
>     UseCanonicalName On
>     ServerSignature Off
>
>     WSGIScriptAlias / /opt/apache/wsgi_start.py
>     WSGIPassAuthorization On
>     ...
> 
>
> I haven't tried it, but would think that you could use mod_rewrite along
> with mod_wsgi, but it's possible that WSGI gets called first automagically.
>
> Hope this helps!
>
> Mike

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: apache+mod_wsgi, redirect to https

2011-05-31 Thread Michael Scovetta
I usually set up two virtual hosts, one listening on port 80 and the other 
on 443. The virtual host listening on port 80 just redirects to the other 
one:


ServerAdmin ad...@example.com
ServerName domain.com

HostnameLookups Off
UseCanonicalName On
ServerSignature Off

Redirect / https://domain.com/



SSLEngine on

ServerAdmin ad...@example.com
ServerName domain.com

HostnameLookups Off
UseCanonicalName On
ServerSignature Off

WSGIScriptAlias / /opt/apache/wsgi_start.py
WSGIPassAuthorization On
...


I haven't tried it, but would think that you could use mod_rewrite along 
with mod_wsgi, but it's possible that WSGI gets called first automagically.

Hope this helps!

Mike

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



apache+mod_wsgi, redirect to https

2011-05-31 Thread refreegrata
Hello guys and girls. I have a question. In my apache configuration I
have this:

WSGIScriptAlias /misite "rute_to_file.wsgi"

The users can access from:

http://mysite/
and
https://mysite/

I need to enable the access only from "https://mysite/;. Every access
from "http://mysite/; must to be redirected to "https://mysite/;. How
can i do this?

Normally I use mod_rewrite, and thats works fine for the static files,
php, etc, but I don't have idea how do this with mod_wsgi.

Additionaly, can be very helpful if somebody now how configure an
"Require Auth" with mod_wsgi.

Sometime ago somebody asked the same in stackoverflow, without get
answers.

Thanks for read, and sorry for my poor english.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Apache + mod_wsgi deploy problem

2011-05-10 Thread Renato Beserra
Now I understand you, Stuart. Thanks to both yours and Tom's advices i was
able to notice my network was fine and that still my apache did not get any
external requests. I suspected that my ISP was blocking the port 80 and so i
changed to 85 and everything is running smoothly.

Thank you very much!



2011/5/10 Stuart MacKay 

>  The idea behind using telnet was simply to verify the network connections
> - that the web server is listening on the correct port and that your router
> was working correctly.
>
> Stuart
>
>
> I am not sure I got your suggestion and I don't have telnet working but i
> have similar rules for django production server on port 8000 and ssh and
> they works just fine from external hosts. Does that help?
>
>  Thanks.
>
> 2011/5/10 Stuart MacKay 
>
>> Can you telnet to the web server: telnet  80 (assuming
>> it is listening on port 80). That would at least tell you whether your LAN
>> setup was correct.
>>
>> Stuart MacKay
>> Lisboa, Portugal
>>
>> --
>>   You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>
>
> --
> Renato Beserra Sousa
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Renato Beserra Sousa

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Apache + mod_wsgi deploy problem

2011-05-10 Thread Stuart MacKay
The idea behind using telnet was simply to verify the network 
connections - that the web server is listening on the correct port and 
that your router was working correctly.


Stuart

I am not sure I got your suggestion and I don't have telnet working 
but i have similar rules for django production server on port 8000 and 
ssh and they works just fine from external hosts. Does that help?


Thanks.

2011/5/10 Stuart MacKay >


Can you telnet to the web server: telnet  80
(assuming it is listening on port 80). That would at least tell
you whether your LAN setup was correct.

Stuart MacKay
Lisboa, Portugal

-- 
You received this message because you are subscribed to the Google

Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com
.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.




--
Renato Beserra Sousa
--
You received this message because you are subscribed to the Google 
Groups "Django users" group.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Apache + mod_wsgi deploy problem

2011-05-10 Thread Renato Beserra
I am not sure I got your suggestion and I don't have telnet working but i
have similar rules for django production server on port 8000 and ssh and
they works just fine from external hosts. Does that help?

Thanks.

2011/5/10 Stuart MacKay 

> Can you telnet to the web server: telnet  80 (assuming
> it is listening on port 80). That would at least tell you whether your LAN
> setup was correct.
>
> Stuart MacKay
> Lisboa, Portugal
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Renato Beserra Sousa

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Apache + mod_wsgi deploy problem

2011-05-10 Thread Stuart MacKay
Can you telnet to the web server: telnet  80 
(assuming it is listening on port 80). That would at least tell you 
whether your LAN setup was correct.


Stuart MacKay
Lisboa, Portugal

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Apache + mod_wsgi deploy problem

2011-05-10 Thread Renato Beserra
I guessed that the problem was at my httpd.conf because i am a newbie at
apache configuration. But i looked at both logs you indicated and they show
absolutely no response to external request. I checked my router again and
the port 80 is forwarded to the right internal IP and the router firewall
seems right too. I tried DMZ but nothing has changed. I think that the
absence of response in the logs indicate a routing/firewall problem, but the
router configuration appears to be right. What do you think?

And Thank you for the first answer.



2011/5/10 Tom Evans 

> On Tue, May 10, 2011 at 12:39 PM, Renato Beserra
>  wrote:
> > Hi,
> >
> > I think I have a really basic problem but I didn't find a solution
> searching
> > the web.
> >
> > I have a Django application running on my local apache, and I can access
> > everything locally whitout any problems. But when i try to access it from
> an
> > external host, the server timeout.I guess it has something to do with
> apache
> > permissions, but my httpd.conf file looks similar to the examples i found
> > online. As you can see:
>
> Why do you guess that? What exactly gets shown in the apache error and
> access logs after you access it from an external host and it times
> out?


> If the error log complains about permissions, show the exact message.
> If nothing is displayed in neither the error log nor the access log,
> then the problem is not with apache, but with your routing and/or
> firewalls.
>
> Cheers
>
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Renato Beserra Sousa

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Apache + mod_wsgi deploy problem

2011-05-10 Thread Tom Evans
On Tue, May 10, 2011 at 12:39 PM, Renato Beserra
 wrote:
> Hi,
>
> I think I have a really basic problem but I didn't find a solution searching
> the web.
>
> I have a Django application running on my local apache, and I can access
> everything locally whitout any problems. But when i try to access it from an
> external host, the server timeout.I guess it has something to do with apache
> permissions, but my httpd.conf file looks similar to the examples i found
> online. As you can see:

Why do you guess that? What exactly gets shown in the apache error and
access logs after you access it from an external host and it times
out?

If the error log complains about permissions, show the exact message.
If nothing is displayed in neither the error log nor the access log,
then the problem is not with apache, but with your routing and/or
firewalls.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Apache + mod_wsgi deploy problem

2011-05-10 Thread Renato Beserra
Hi,

I think I have a really basic problem but I didn't find a solution searching
the web.

I have a Django application running on my local apache, and I can access
everything locally whitout any problems. But when i try to access it from an
external host, the server timeout.I guess it has something to do with apache
permissions, but my httpd.conf file looks similar to the examples i found
online. As you can see:

WSGIScriptAlias /Test /web/Test/apache/django.wsgi


   Order Deny,Allow
   Allow from all



Order Deny,Allow
Allow from all



Order Deny,Allow
Allow from all



Order Deny,Allow
Allow from all


I considered a firewall/router problem, but i think my ports are forwarded
correclty, since i can access the local site with my external dns/ip.

Does anyone have an idea of what i am doing wrong?

Thank You.

-- 
Renato Beserra Sousa

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



What's happen when using threadlocals with Apache/mod_wsgi?

2011-02-22 Thread Alisue
Hi, I have a question to using threadlocals trick on Apache/mod_wsgi.

I built some SMS using threadlocals trick and FAILED. I was filtering
blog post with current user, and blog post has publish policy like
"public"(everyone can see) and "grouped"(user who joined in the group
which author joined in can see). Everything was fine on development
but deploy. User RANDOMLY can see the post which he/see should be able
to see.

what I wrote was like below:

-
# middleware/threadlocals.py
from django.utils.thread_support import currentThread
_requests = {}
def get_request():
if currentThread() in _request:
return _requests[currentThread()]
return None
# Middleware which set request to _requests[currentThread]
# ...

# blogs/models.py
class EntryManager(models.Manager):
def published(self):
user = threadlocals.get_request().user
return self.filter(author=user)
class Entry(models.Model):
author = models.ForeignKey(User)
-

the threadlocals is copied from some snippets (i forgot which) so i
wasn't sure what's happen. now
i notice that this threadlocals trick required that Django process has
to be unique for each request (to make sure currentThread is unique
for each request in the process) isn't it?

So I wonder that is Apache/mod_wsgi create new Django process for each
request? If so why the code above didn't work proper? and why a lot's
of people disagree with `threadlocals` trick even Django
(django.db.transaction.py) and django-cms (middleware/user.py) using
similar trick?

sorry for my ugly English, thank you for reading.

P.S.

Actually I solved this problem with writing whole custom db.model,
forms, generic view which pass `request` to the db.model.save, clean,
delete method. However now i wonder how can i change a template
loading directory depend on request (for PC, iPhone, mobile...) and
using django-cms. so i wonder is there any special settings for
mod_wsgi to using threadlocals trick or whatever. any idea is welcome.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 4 different domains on single apache/mod_wsgi

2011-01-21 Thread Osiaq
Graham, daemonize is a trick a was looking for :) Thank you for the
great idea :)
Problem solved.

On Jan 20, 3:16 am, Graham Dumpleton 
wrote:
> Technically it should be able to made to work. I would recommend though you
> use mod_wsgi daemon mode and delegate each Django site instance to its own
> process, rather than each sharing the same process but in different sub
> interpreters. See:
>
>  http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide#Delegat...
>
> This will ensure that leakage of environment variables or other process
> level settings across sub interpreters doesn't occur.
>
> Graham
>
> On Thursday, January 20, 2011 11:20:36 AM UTC+11, Osiaq wrote:
>
> > Hi all!
> > I have 2 separate projects, with 2 separate domains
>
> > The problem: first website, ELG, is working OK.
> > Another, cc4h, cannot find template index.html, but is working perfect
> > on localhost with Django development server.
>
> > Do you know any good tutorial regarding multiple domains on single
> > Apache?
> > It doesnt seems as easy as I thought it will be.
>
> > Thank you
>
> > Code:
>
> > Both WSGI files (projects ELG and CC4H):
> > -
> >  /home/django/projects/elg/apache/elg.wsgi
> >  /home/django/projects/cc4h/apache/cc4h.wsgi
> > -
> > import os, sys
> > sys.path.append('/home/django/projects')
> > os.environ['DJANGO_SETTINGS_MODULE'] = 'elg.settings' #for project
> > cc4h is 'cc4h.settings'
> > import django.core.handlers.wsgi
> > application = django.core.handlers.wsgi.WSGIHandler()
>
> > 
> > My httpd.conf:
> > 
> > NameVirtualHost *
> > 
> > ServerNamewww.domain1.com
> > ServerAdmin ***l...@gmail.com
> > Alias /robots.txt /home/django/projects/elg/media/robots.txt
> > Alias /favicon.ico /home/django/projects/elg/media/favicon.ico
> > AliasMatch ^/([^/]*\.css) /home/django/projects/elg/media/css/$1
> > AliasMatch ^/([^/]*\.js) /home/django/projects/elg/media/js/$1
> > Alias /media/ /home/django/projects/elg/media/
> > 
> > Order deny,allow
> > Allow from all
> > 
> > WSGIScriptAlias / /home/django/projects/elg/apache/elg.wsgi
> > 
> > Order allow,deny
> > Allow from all
> > 
> > 
>
> > 
> > ServerNamewww.domain2.com
> > ServerAdmin ***l...@gmail.com
> > Alias /robots.txt /home/django/projects/cc4h/media/robots.txt
> > Alias /favicon.ico /home/django/projects/cc4h/media/favicon.ico
> > AliasMatch ^/([^/]*\.css) /home/django/projects/cc4h/media/css/$1
> > AliasMatch ^/([^/]*\.js) /home/django/projects/cc4h/media/js/$1
> > Alias /media/ /home/django/projects/cc4h/media/
> > 
> > Order deny,allow
> > Allow from all
> > 
> > WSGIScriptAlias / /home/django/projects/cc4h/apache/cc4h.wsgi
> > 
> > Order allow,deny
> > Allow from all
> > 
> > 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 4 different domains on single apache/mod_wsgi

2011-01-19 Thread Graham Dumpleton
Technically it should be able to made to work. I would recommend though you 
use mod_wsgi daemon mode and delegate each Django site instance to its own 
process, rather than each sharing the same process but in different sub 
interpreters. See:

  
http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide#Delegation_To_Daemon_Process

This will ensure that leakage of environment variables or other process 
level settings across sub interpreters doesn't occur.

Graham

On Thursday, January 20, 2011 11:20:36 AM UTC+11, Osiaq wrote:
>
> Hi all! 
> I have 2 separate projects, with 2 separate domains 
>
> The problem: first website, ELG, is working OK. 
> Another, cc4h, cannot find template index.html, but is working perfect 
> on localhost with Django development server. 
>
> Do you know any good tutorial regarding multiple domains on single 
> Apache? 
> It doesnt seems as easy as I thought it will be. 
>
> Thank you 
>
> Code: 
>
> Both WSGI files (projects ELG and CC4H): 
> - 
>  /home/django/projects/elg/apache/elg.wsgi 
>  /home/django/projects/cc4h/apache/cc4h.wsgi 
> - 
> import os, sys 
> sys.path.append('/home/django/projects') 
> os.environ['DJANGO_SETTINGS_MODULE'] = 'elg.settings' #for project 
> cc4h is 'cc4h.settings' 
> import django.core.handlers.wsgi 
> application = django.core.handlers.wsgi.WSGIHandler() 
>
>  
> My httpd.conf: 
>  
> NameVirtualHost * 
>  
> ServerName www.domain1.com 
> ServerAdmin ***l...@gmail.com 
> Alias /robots.txt /home/django/projects/elg/media/robots.txt 
> Alias /favicon.ico /home/django/projects/elg/media/favicon.ico 
> AliasMatch ^/([^/]*\.css) /home/django/projects/elg/media/css/$1 
> AliasMatch ^/([^/]*\.js) /home/django/projects/elg/media/js/$1 
> Alias /media/ /home/django/projects/elg/media/ 
>  
> Order deny,allow 
> Allow from all 
>  
> WSGIScriptAlias / /home/django/projects/elg/apache/elg.wsgi 
>  
> Order allow,deny 
> Allow from all 
>  
>  
>
>
>  
> ServerName www.domain2.com 
> ServerAdmin ***l...@gmail.com 
> Alias /robots.txt /home/django/projects/cc4h/media/robots.txt 
> Alias /favicon.ico /home/django/projects/cc4h/media/favicon.ico 
> AliasMatch ^/([^/]*\.css) /home/django/projects/cc4h/media/css/$1 
> AliasMatch ^/([^/]*\.js) /home/django/projects/cc4h/media/js/$1 
> Alias /media/ /home/django/projects/cc4h/media/ 
>  
> Order deny,allow 
> Allow from all 
>  
> WSGIScriptAlias / /home/django/projects/cc4h/apache/cc4h.wsgi 
>  
> Order allow,deny 
> Allow from all 
>  
>  
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 4 different domains on single apache/mod_wsgi

2011-01-19 Thread Kenneth Gonsalves
On Wed, 2011-01-19 at 16:56 -0800, Osiaq wrote:
> Hi Kenneth!
> Distro: Ubuntu Server 10.04 

well ubuntu follows the debian mode for setting up virtual hosts - you
have virtual hosts files in /etc/apache/sites-available and you symlink
them to /etc/apache/sites-enabled/. Here is a typical virtual host file:


ServerAdmin webmas...@xlquest.web
DocumentRoot /var/www/quadmulc/
ServerName quadmulc.web
ErrorLog logs/quadmulc-error_log
CustomLog logs/quadmulc-access_log common

Alias /media/ /home/lawgon/django-trunk/django/contrib/admin/media/
Alias /smedia/ /home/lawgon/smedia/
Alias /sitemedia/ /home/lawgon/quadmulc/sitemedia/

WSGIScriptAlias / /home/lawgon/quadmulc/apache/django.wsgi


Order deny,allow
Allow from all


Order deny,allow
Allow from all


Order deny,allow
Allow from all


-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 4 different domains on single apache/mod_wsgi

2011-01-19 Thread Osiaq
Hi Kenneth!
Distro: Ubuntu Server 10.04

As I said the firs site, ELG is working OK.
I just changed second site (cc4h) WSGI and it worked, printing "Hello
World!"
so domains are redirected OK. (please see code below)
But the website itself is not working, still can't find the template

Regards!

-
 /home/django/projects/cc4h/apache/cc4h.wsgi
-
#import os, sys
#sys.path.append('/home/django/projects')
#os.environ['DJANGO_SETTINGS_MODULE'] = 'cc4h.settings'
#import django.core.handlers.wsgi
#application = django.core.handlers.wsgi.WSGIHandler()

def application(environ, start_response):
status = '200 OK'
output = 'Hello World!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]


On Jan 20, 2:46 am, Kenneth Gonsalves  wrote:
> On Wed, 2011-01-19 at 16:20 -0800, Osiaq wrote:
> > It doesnt seems as easy as I thought it will be.
>
> it is as easy as falling of a log! If you can tell us what distro you
> are using we can point the way.
> --
> regards
> KGhttp://lawgon.livejournal.com
> Coimbatore LUG roxhttp://ilugcbe.techstud.org/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 4 different domains on single apache/mod_wsgi

2011-01-19 Thread Kenneth Gonsalves
On Wed, 2011-01-19 at 16:20 -0800, Osiaq wrote:
> It doesnt seems as easy as I thought it will be.

it is as easy as falling of a log! If you can tell us what distro you
are using we can point the way.
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



4 different domains on single apache/mod_wsgi

2011-01-19 Thread Osiaq
Hi all!
I have 2 separate projects, with 2 separate domains

The problem: first website, ELG, is working OK.
Another, cc4h, cannot find template index.html, but is working perfect
on localhost with Django development server.

Do you know any good tutorial regarding multiple domains on single
Apache?
It doesnt seems as easy as I thought it will be.

Thank you

Code:

Both WSGI files (projects ELG and CC4H):
-
 /home/django/projects/elg/apache/elg.wsgi
 /home/django/projects/cc4h/apache/cc4h.wsgi
-
import os, sys
sys.path.append('/home/django/projects')
os.environ['DJANGO_SETTINGS_MODULE'] = 'elg.settings' #for project
cc4h is 'cc4h.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()


My httpd.conf:

NameVirtualHost *

ServerName www.domain1.com
ServerAdmin ***l...@gmail.com
Alias /robots.txt /home/django/projects/elg/media/robots.txt
Alias /favicon.ico /home/django/projects/elg/media/favicon.ico
AliasMatch ^/([^/]*\.css) /home/django/projects/elg/media/css/$1
AliasMatch ^/([^/]*\.js) /home/django/projects/elg/media/js/$1
Alias /media/ /home/django/projects/elg/media/

Order deny,allow
Allow from all

WSGIScriptAlias / /home/django/projects/elg/apache/elg.wsgi

Order allow,deny
Allow from all





ServerName www.domain2.com
ServerAdmin ***l...@gmail.com
Alias /robots.txt /home/django/projects/cc4h/media/robots.txt
Alias /favicon.ico /home/django/projects/cc4h/media/favicon.ico
AliasMatch ^/([^/]*\.css) /home/django/projects/cc4h/media/css/$1
AliasMatch ^/([^/]*\.js) /home/django/projects/cc4h/media/js/$1
Alias /media/ /home/django/projects/cc4h/media/

Order deny,allow
Allow from all

WSGIScriptAlias / /home/django/projects/cc4h/apache/cc4h.wsgi

Order allow,deny
Allow from all



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Apache & mod_wsgi are configured correctly. Need Django to recognize my django.wsgi file.

2010-12-12 Thread Mike Dewhirst

On 12/12/2010 10:55pm, Mike Dewhirst wrote:

On 12/12/2010 12:35pm, jc wrote:

I ran the Django develplment server and everything runs fine. It's
only when I go back to the other web server that things start to break
on me.


In that case check out http://blip.tv/file/3840484 for Graham
Dumpleton's talk on precisely the problem you describe.


Er ... I meant to include this link too

http://blog.dscpl.com.au/search/label/mod_wsgi

Mike




hth

Mike



On Dec 11, 8:06 pm, Mike Dewhirst wrote:

On 12/12/2010 10:56am, jc wrote:










I've tried to fix my config files and it gives me a 500 error, here is
what i see n the logs. I've been told by someone else that they think
it's still my mod_wsgi/Apache configuration and not the error that I'm
getting in the log about missing modules. Any suggestions? Here is the
server error log message and my newly configured files:



#
# error.log
#
mod_wsgi (pid=20698): Exception occurred processing WSGI script '/
srv/
www/duckling.org/store/wsgi-scripts/django.wsgi'.
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
wsgi.py", line 230, in __call__
self.load_middleware()
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
base.py", line 42, in load_middleware
raise exceptions.ImproperlyConfigured('Error importing middleware %s:
"%s"' % (mw_module, e))
ImproperlyConfigured: Error importing middleware
satchmo_store.shop.SSLMiddleware: "No module named
satchmo_store.shop.SSLMiddleware
I'm at a loss here as to how I find out if the problem lies with
mod_wsgi or apache configs or django or satchmo. So, I'm posting here
just in case someone might be able to help me out. Without some help
this project is as good as doomed as I don't have a lot of skills and
I'm learning along the way.


The loading middleware error seems straightforward. My guess is the
module containing the middleware cannot be found.

If you installed Satchmo correctly it will have added itself properly to
the Python path and that error wouldn't occur.

If you are learning and still need to develop your skills I would
recommend using the Django dev server to try it out.

hth

Mike








--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Apache & mod_wsgi are configured correctly. Need Django to recognize my django.wsgi file.

2010-12-12 Thread Mike Dewhirst

On 12/12/2010 12:35pm, jc wrote:

I ran the Django develplment server and everything runs fine. It's
only when I go back to the other web server that things start to break
on me.


In that case check out http://blip.tv/file/3840484 for Graham 
Dumpleton's talk on precisely the problem you describe.


hth

Mike



On Dec 11, 8:06 pm, Mike Dewhirst  wrote:

On 12/12/2010 10:56am, jc wrote:










I've tried to fix my config files and it gives me a 500 error, here is
what i see n the logs. I've been told by someone else that they think
it's still my mod_wsgi/Apache configuration and not the error that I'm
getting in the log about missing modules. Any suggestions? Here is the
server error log message and my newly configured files:



#
# error.log
#
mod_wsgi (pid=20698): Exception occurred processing WSGI script '/
srv/
www/duckling.org/store/wsgi-scripts/django.wsgi'.
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
wsgi.py", line 230, in __call__
   self.load_middleware()
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
base.py", line 42, in load_middleware
raise exceptions.ImproperlyConfigured('Error importing middleware %s:
"%s"' % (mw_module, e))
   ImproperlyConfigured: Error importing middleware
satchmo_store.shop.SSLMiddleware: "No module named
satchmo_store.shop.SSLMiddleware
I'm at a loss here as to how I find out if the problem lies with
mod_wsgi or apache configs or django or satchmo. So, I'm posting here
just in case someone might be able to help me out. Without some help
this project is as good as doomed as I don't have a lot of skills and
I'm learning along the way.


The loading middleware error seems straightforward. My guess is the
module containing the middleware cannot be found.

If you installed Satchmo correctly it will have added itself properly to
the Python path and that error wouldn't occur.

If you are learning and still need to develop your skills I would
recommend using the Django dev server to try it out.

hth

Mike






--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Apache & mod_wsgi are configured correctly. Need Django to recognize my django.wsgi file.

2010-12-11 Thread jc
I ran the Django develplment server and everything runs fine. It's
only when I go back to the other web server that things start to break
on me.

On Dec 11, 8:06 pm, Mike Dewhirst  wrote:
> On 12/12/2010 10:56am, jc wrote:
>
>
>
>
>
>
>
>
>
> > I've tried to fix my config files and it gives me a 500 error, here is
> > what i see n the logs. I've been told by someone else that they think
> > it's still my mod_wsgi/Apache configuration and not the error that I'm
> > getting in the log about missing modules. Any suggestions? Here is the
> > server error log message and my newly configured files:
>
> > #
> > # error.log
> > #
> > mod_wsgi (pid=20698): Exception occurred processing WSGI script '/
> > srv/
> > www/duckling.org/store/wsgi-scripts/django.wsgi'.
> > Traceback (most recent call last):
> > File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
> > wsgi.py", line 230, in __call__
> >       self.load_middleware()
> > File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
> > base.py", line 42, in load_middleware
> > raise exceptions.ImproperlyConfigured('Error importing middleware %s:
> > "%s"' % (mw_module, e))
> >   ImproperlyConfigured: Error importing middleware
> > satchmo_store.shop.SSLMiddleware: "No module named
> > satchmo_store.shop.SSLMiddleware
> > I'm at a loss here as to how I find out if the problem lies with
> > mod_wsgi or apache configs or django or satchmo. So, I'm posting here
> > just in case someone might be able to help me out. Without some help
> > this project is as good as doomed as I don't have a lot of skills and
> > I'm learning along the way.
>
> The loading middleware error seems straightforward. My guess is the
> module containing the middleware cannot be found.
>
> If you installed Satchmo correctly it will have added itself properly to
> the Python path and that error wouldn't occur.
>
> If you are learning and still need to develop your skills I would
> recommend using the Django dev server to try it out.
>
> hth
>
> Mike
>
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Apache & mod_wsgi are configured correctly. Need Django to recognize my django.wsgi file.

2010-12-11 Thread jc
I think after that comment I'm slowly getting it but I still need to
go back and learn more. Regardless of the the horrible security holes
in my application, this still wouldn't do anything as far as *not*
making this django app run, would it? In other words, I know it's
insecure as hell to do what I'm doing but that is *not* the reason my
django app is not running, correct?

thanks again,
j.

On Dec 11, 7:09 pm, Mike Dewhirst <mi...@dewhirst.com.au> wrote:
> On 12/12/2010 10:35am, jc wrote:
>
> > You definitely lost me in some places but you've also cleared some
> > things up in the process. I also noticed that I had " > www/wsgi-scripts>", which is lacking a directory for the
> > WSGIScriptAlias. I've fixed that now. *Now*, I no longer get my
> > listing of my files in my project when I go to my address *but* I now
> > get 500 Internal Server Error. I'm not sure if I should trust the logs
>
> Always trust the logs. If you know enough about Apache to mistrust the
> logs then you wouldn't be here.
>
> > or maybe I've misconfigured something else (either in Apache or in my
> > django.wsgi file)...I had this same issue yesterday 500 error...
>
> > Also, when you said "Somewhere in your Apache config you have denied
> > access to the entire filesystem", do  you mean *Apache* has done this
> > so that it will keep others out of my project (not that I've actually
> > done this somewhere, right?)
>
> Somewhere in your Apache config there will be something like this ...
>
> # forbid access to the entire filesystem by default
> 
>      Options None
>      AllowOverride None
>      Order deny,allow
>      Deny from all
> 
>
> ... which - as the comment says - locks the public out of everything on
> the server.  actually means the root of the server itself.
> In other words /. The '/>' is not an XML closing tag even though it
> might look like it.
>
> This is why you need to specifically open up public access to htdocs and
> your wsgi script directory. Incidentally, it is also why your Django
> code should not be in your your wsgi script directory. If it was Apache
> could reveal it to the public - which is what I think you were
> describing earlier.
>
>
>
> > After these changes, the project is still not running and I'm still
> > not sure if it's my django app that's the issue or wsgi and my Apache
> > configs. :/
>
> 1. In WSGIScriptAlias you map your wsgi script (django.wsgi itself) to
> the root of your duckling website. In other words your wsgi script
> becomes the / which is the slash at the end ofhttp://1.2.3.4/
>
> 2. Your Apache config opens up access to the directory in which that
> script lives - in other words you create a hole in the entire filesystem
> lockdown.
>
> To gain more info on wsgi scripts try ...
>
> http://code.google.com/p/modwsgi/wiki/DebuggingTechniques
>
> Good luck
>
> Mike
>
>
>
>
>
>
>
>
>
> > thanks for the reply back, I do appreciate it...
>
> > j.
>
> > On Dec 11, 5:29 pm, Mike Dewhirst<mi...@dewhirst.com.au>  wrote:
> >> On 12/12/2010 7:14am, jc wrote:
>
> >>> Apache&    mod_wsgi are configured correctly (I've created a hello
> >>> world .html apache file and a hello world mod_wsgi application with
> >>> no
> >>> problems). I know need my Django app to recognize my django.wsgi
> >>> file.
> >>> What makes me think that it's not recognizing my wsgi file is that I
> >>> went into my django.wsgi file I created and completely deleted all of
> >>> the code in the file and restarted Apache and it still gives me the
> >>> same page (a listing of the files from Django app, not my actual
> >>> Django application. Configuring Apache and mod_wsgi went really well
> >>> but I'm at a loss of how to fix this. Here are some details instead of
> >>> "it's
> >>> not working":
>
> >> You are correct. Apache is not looking at the wsgi script. Have a look
> >> at the suggestions below ... before playing with django.wsgi.
>
> >>> Here is my current django.wsgi file:
>
> >>> import os
> >>> import sys
> >>> sys.path.append('/srv/www/duckling.org/store/')
> >>> os.environ['PYTHON_EGG_CACHE'] = '/srv/www/duckling.org/
> >>> store/.python-
> >>> egg'
> >>> os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
> >>> import django.core.handlers.wsgi
> >>> application = django.core.handlers.wsgi.WSGIHandler()
>
> >>> I've tried a few different versions of the dj

Re: Apache & mod_wsgi are configured correctly. Need Django to recognize my django.wsgi file.

2010-12-11 Thread Mike Dewhirst

On 12/12/2010 10:56am, jc wrote:

I've tried to fix my config files and it gives me a 500 error, here is
what i see n the logs. I've been told by someone else that they think
it's still my mod_wsgi/Apache configuration and not the error that I'm
getting in the log about missing modules. Any suggestions? Here is the
server error log message and my newly configured files:

#
# error.log
#
mod_wsgi (pid=20698): Exception occurred processing WSGI script '/
srv/
www/duckling.org/store/wsgi-scripts/django.wsgi'.
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
wsgi.py", line 230, in __call__
  self.load_middleware()
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
base.py", line 42, in load_middleware
raise exceptions.ImproperlyConfigured('Error importing middleware %s:
"%s"' % (mw_module, e))
  ImproperlyConfigured: Error importing middleware
satchmo_store.shop.SSLMiddleware: "No module named
satchmo_store.shop.SSLMiddleware
I'm at a loss here as to how I find out if the problem lies with
mod_wsgi or apache configs or django or satchmo. So, I'm posting here
just in case someone might be able to help me out. Without some help
this project is as good as doomed as I don't have a lot of skills and
I'm learning along the way.


The loading middleware error seems straightforward. My guess is the 
module containing the middleware cannot be found.


If you installed Satchmo correctly it will have added itself properly to 
the Python path and that error wouldn't occur.


If you are learning and still need to develop your skills I would 
recommend using the Django dev server to try it out.


hth

Mike



--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Apache & mod_wsgi are configured correctly. Need Django to recognize my django.wsgi file.

2010-12-11 Thread Mike Dewhirst

On 12/12/2010 10:35am, jc wrote:

You definitely lost me in some places but you've also cleared some
things up in the process. I also noticed that I had "", which is lacking a directory for the
WSGIScriptAlias. I've fixed that now. *Now*, I no longer get my
listing of my files in my project when I go to my address *but* I now
get 500 Internal Server Error. I'm not sure if I should trust the logs


Always trust the logs. If you know enough about Apache to mistrust the 
logs then you wouldn't be here.



or maybe I've misconfigured something else (either in Apache or in my
django.wsgi file)...I had this same issue yesterday 500 error...

Also, when you said "Somewhere in your Apache config you have denied
access to the entire filesystem", do  you mean *Apache* has done this
so that it will keep others out of my project (not that I've actually
done this somewhere, right?)


Somewhere in your Apache config there will be something like this ...

# forbid access to the entire filesystem by default

Options None
AllowOverride None
Order deny,allow
Deny from all


... which - as the comment says - locks the public out of everything on 
the server.  actually means the root of the server itself. 
In other words /. The '/>' is not an XML closing tag even though it 
might look like it.


This is why you need to specifically open up public access to htdocs and 
your wsgi script directory. Incidentally, it is also why your Django 
code should not be in your your wsgi script directory. If it was Apache 
could reveal it to the public - which is what I think you were 
describing earlier.




After these changes, the project is still not running and I'm still
not sure if it's my django app that's the issue or wsgi and my Apache
configs. :/



1. In WSGIScriptAlias you map your wsgi script (django.wsgi itself) to 
the root of your duckling website. In other words your wsgi script 
becomes the / which is the slash at the end of http://1.2.3.4/


2. Your Apache config opens up access to the directory in which that 
script lives - in other words you create a hole in the entire filesystem 
lockdown.


To gain more info on wsgi scripts try ...

http://code.google.com/p/modwsgi/wiki/DebuggingTechniques

Good luck

Mike



thanks for the reply back, I do appreciate it...

j.

On Dec 11, 5:29 pm, Mike Dewhirst<mi...@dewhirst.com.au>  wrote:

On 12/12/2010 7:14am, jc wrote:


Apache&mod_wsgi are configured correctly (I've created a hello
world .html apache file and a hello world mod_wsgi application with
no
problems). I know need my Django app to recognize my django.wsgi
file.
What makes me think that it's not recognizing my wsgi file is that I
went into my django.wsgi file I created and completely deleted all of
the code in the file and restarted Apache and it still gives me the
same page (a listing of the files from Django app, not my actual
Django application. Configuring Apache and mod_wsgi went really well
but I'm at a loss of how to fix this. Here are some details instead of
"it's
not working":


You are correct. Apache is not looking at the wsgi script. Have a look
at the suggestions below ... before playing with django.wsgi.












Here is my current django.wsgi file:



import os
import sys
sys.path.append('/srv/www/duckling.org/store/')
os.environ['PYTHON_EGG_CACHE'] = '/srv/www/duckling.org/
store/.python-
egg'
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()



I've tried a few different versions of the django.wsgi file
(including
a version like the one over athttp://www.djangoproject.com/).
This version of my wsgi is from here:
http://library.linode.com/frameworks/django-apache-mod-wsgi/ubuntu-10...



Also, here is my vhost apache configuration file below. I think these
are
the main files that are suppose to do the job for me. Let me know if
you see any errors in what I'm doing and what else I might do to fix
this. The django app runs fine on the django's built-in development
server so I'm thinking it *might have* something with my paths.
No errors in my apache error.log file as well. It's acting as there's
no problem at all, which is not the case...the project isn't loading,
like I said just a listing of my files and directories of my Django
project. Here is my apache config file:




  ServerAdmin h...@duckling.org
  ServerName duckling.org
  ServerAliaswww.duckling.org



  DocumentRoot /srv/www/duckling.org/store/


# DocumentRoot is where you keep non-django stuff eg., static files
# which is served by Apache without needing your Django code
DocumentRoot /srv/www/duckling.org/htdocs/




  
  Order Allow,Deny
  Allow from all
  


# now let the public access anything here
   
AllowOverride None
Order deny,allow
Allow from all
   




  WSGIScriptAlias /django /srv/www/duckling.org/store/wsgi-scripts/
django.wsg

Re: Apache & mod_wsgi are configured correctly. Need Django to recognize my django.wsgi file.

2010-12-11 Thread Tim Sawyer

Here's the config I'm using for mod_wsgi:

http://drumcoder.co.uk/blog/2009/nov/21/apache-mod_wsgi-config/

Hope that helps,

Tim.

On 11/12/10 23:35, jc wrote:

You definitely lost me in some places but you've also cleared some
things up in the process. I also noticed that I had "", which is lacking a directory for the
WSGIScriptAlias. I've fixed that now. *Now*, I no longer get my
listing of my files in my project when I go to my address *but* I now
get 500 Internal Server Error. I'm not sure if I should trust the logs
or maybe I've misconfigured something else (either in Apache or in my
django.wsgi file)...I had this same issue yesterday 500 error...

Also, when you said "Somewhere in your Apache config you have denied
access to the entire filesystem", do  you mean *Apache* has done this
so that it will keep others out of my project (not that I've actually
done this somewhere, right?)

After these changes, the project is still not running and I'm still
not sure if it's my django app that's the issue or wsgi and my Apache
configs. :/

thanks for the reply back, I do appreciate it...

j.

On Dec 11, 5:29 pm, Mike Dewhirst<mi...@dewhirst.com.au>  wrote:

On 12/12/2010 7:14am, jc wrote:


Apache&mod_wsgi are configured correctly (I've created a hello
world .html apache file and a hello world mod_wsgi application with
no
problems). I know need my Django app to recognize my django.wsgi
file.
What makes me think that it's not recognizing my wsgi file is that I
went into my django.wsgi file I created and completely deleted all of
the code in the file and restarted Apache and it still gives me the
same page (a listing of the files from Django app, not my actual
Django application. Configuring Apache and mod_wsgi went really well
but I'm at a loss of how to fix this. Here are some details instead of
"it's
not working":


You are correct. Apache is not looking at the wsgi script. Have a look
at the suggestions below ... before playing with django.wsgi.












Here is my current django.wsgi file:



import os
import sys
sys.path.append('/srv/www/duckling.org/store/')
os.environ['PYTHON_EGG_CACHE'] = '/srv/www/duckling.org/
store/.python-
egg'
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()



I've tried a few different versions of the django.wsgi file
(including
a version like the one over athttp://www.djangoproject.com/).
This version of my wsgi is from here:
http://library.linode.com/frameworks/django-apache-mod-wsgi/ubuntu-10...



Also, here is my vhost apache configuration file below. I think these
are
the main files that are suppose to do the job for me. Let me know if
you see any errors in what I'm doing and what else I might do to fix
this. The django app runs fine on the django's built-in development
server so I'm thinking it *might have* something with my paths.
No errors in my apache error.log file as well. It's acting as there's
no problem at all, which is not the case...the project isn't loading,
like I said just a listing of my files and directories of my Django
project. Here is my apache config file:




  ServerAdmin h...@duckling.org
  ServerName duckling.org
  ServerAliaswww.duckling.org



  DocumentRoot /srv/www/duckling.org/store/


# DocumentRoot is where you keep non-django stuff eg., static files
# which is served by Apache without needing your Django code
DocumentRoot /srv/www/duckling.org/htdocs/




  
  Order Allow,Deny
  Allow from all
  


# now let the public access anything here
   
AllowOverride None
Order deny,allow
Allow from all
   




  WSGIScriptAlias /django /srv/www/duckling.org/store/wsgi-scripts/
django.wsgi
  
  Order allow,deny
  Allow from all
  



Somewhere in your Apache config you have denied access to the entire
filesystem to prevent outsiders from hacking in. Your Django code must
also be hidden from outsiders so it will live safely in
/srv/www/duckling.org/store because you haven't allowed anyone except
Apache to see it.

Now you need to provide an allowed conduit to your Django code. So make
an Apache script alias to map the website root (ie '/') to your Django
code. Because you are using mod_wsgi the entry point is your django.wsgi
script. So map / to the script:
   WSGIScriptAlias / /srv/www/duckling.org/store/wsgi-scripts/django.wsgi

# and give the public full access - but only to the entry point
   
Order deny,allow
Allow from all
   

hth
Mike




And here are versions of the stack that I'm using, I saw over at the
mod_wsgi site that you all would like the versions of what I'm using
on the server:
Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.5 with Suhosin-Patch
mod_python/3.3.1 Python/2.6.5 mod_wsgi/2.8


I would remove mod_python if possible










thanks,
j.




--
You received this message because you are subscribed to the Google Groups &quo

Re: Apache & mod_wsgi are configured correctly. Need Django to recognize my django.wsgi file.

2010-12-11 Thread jc
I've tried to fix my config files and it gives me a 500 error, here is
what i see n the logs. I've been told by someone else that they think
it's still my mod_wsgi/Apache configuration and not the error that I'm
getting in the log about missing modules. Any suggestions? Here is the
server error log message and my newly configured files:

#
# error.log
#
mod_wsgi (pid=20698): Exception occurred processing WSGI script '/
srv/
www/duckling.org/store/wsgi-scripts/django.wsgi'.
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
wsgi.py", line 230, in __call__
 self.load_middleware()
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
base.py", line 42, in load_middleware
raise exceptions.ImproperlyConfigured('Error importing middleware %s:
"%s"' % (mw_module, e))
 ImproperlyConfigured: Error importing middleware
satchmo_store.shop.SSLMiddleware: "No module named
satchmo_store.shop.SSLMiddleware
I'm at a loss here as to how I find out if the problem lies with
mod_wsgi or apache configs or django or satchmo. So, I'm posting here
just in case someone might be able to help me out. Without some help
this project is as good as doomed as I don't have a lot of skills and
I'm learning along the way.

Here are my config files. I've went though many different versions,
this is my latest:

# apache vhost file called duckling.org


ServerAdmin h...@duckling.org
ServerName duckling.org
ServerAlias www.duckling.org
DocumentRoot /srv/www/duckling.org/store/
   
Order Allow,Deny
Allow from all

Alias /static /srv/www/duckling.org/store/static/

AllowOverride None
Order deny,allow
Allow from all

WSGIScriptAlias / /srv/www/duckling.org/store/wsgi-scripts/
django.wsgi

Order deny,allow
Allow from all


#
# django.wsgi file
#
import os
import sys
sys.path.append('/srv/www/duckling.org/store')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()


# With this current configuration I get a error in my server logs
for:
 ImproperlyConfigured: Error importing middleware
satchmo_store.shop.SSLMiddleware: "No module named
satchmo_store.shop.SSLMiddleware"
Can anyone give me some clues as what I can do next? And if all else
fails, what are my alternatives as far as deploying this django app?
I've got time to "change plans" at this moment.

thanks again for the help!
j.

On Dec 11, 6:35 pm, jc <jimmy.case...@gmail.com> wrote:
> You definitely lost me in some places but you've also cleared some
> things up in the process. I also noticed that I had " www/wsgi-scripts>", which is lacking a directory for the
> WSGIScriptAlias. I've fixed that now. *Now*, I no longer get my
> listing of my files in my project when I go to my address *but* I now
> get 500 Internal Server Error. I'm not sure if I should trust the logs
> or maybe I've misconfigured something else (either in Apache or in my
> django.wsgi file)...I had this same issue yesterday 500 error...
>
> Also, when you said "Somewhere in your Apache config you have denied
> access to the entire filesystem", do  you mean *Apache* has done this
> so that it will keep others out of my project (not that I've actually
> done this somewhere, right?)
>
> After these changes, the project is still not running and I'm still
> not sure if it's my django app that's the issue or wsgi and my Apache
> configs. :/
>
> thanks for the reply back, I do appreciate it...
>
> j.
>
> On Dec 11, 5:29 pm, Mike Dewhirst <mi...@dewhirst.com.au> wrote:
>
>
>
>
>
>
>
> > On 12/12/2010 7:14am, jc wrote:
>
> > > Apache&  mod_wsgi are configured correctly (I've created a hello
> > > world .html apache file and a hello world mod_wsgi application with
> > > no
> > > problems). I know need my Django app to recognize my django.wsgi
> > > file.
> > > What makes me think that it's not recognizing my wsgi file is that I
> > > went into my django.wsgi file I created and completely deleted all of
> > > the code in the file and restarted Apache and it still gives me the
> > > same page (a listing of the files from Django app, not my actual
> > > Django application. Configuring Apache and mod_wsgi went really well
> > > but I'm at a loss of how to fix this. Here are some details instead of
> > > "it's
> > > not working":
>
> > You are correct. Apache is not looking

Re: Apache & mod_wsgi are configured correctly. Need Django to recognize my django.wsgi file.

2010-12-11 Thread jc
You definitely lost me in some places but you've also cleared some
things up in the process. I also noticed that I had "", which is lacking a directory for the
WSGIScriptAlias. I've fixed that now. *Now*, I no longer get my
listing of my files in my project when I go to my address *but* I now
get 500 Internal Server Error. I'm not sure if I should trust the logs
or maybe I've misconfigured something else (either in Apache or in my
django.wsgi file)...I had this same issue yesterday 500 error...

Also, when you said "Somewhere in your Apache config you have denied
access to the entire filesystem", do  you mean *Apache* has done this
so that it will keep others out of my project (not that I've actually
done this somewhere, right?)

After these changes, the project is still not running and I'm still
not sure if it's my django app that's the issue or wsgi and my Apache
configs. :/

thanks for the reply back, I do appreciate it...

j.

On Dec 11, 5:29 pm, Mike Dewhirst <mi...@dewhirst.com.au> wrote:
> On 12/12/2010 7:14am, jc wrote:
>
> > Apache&  mod_wsgi are configured correctly (I've created a hello
> > world .html apache file and a hello world mod_wsgi application with
> > no
> > problems). I know need my Django app to recognize my django.wsgi
> > file.
> > What makes me think that it's not recognizing my wsgi file is that I
> > went into my django.wsgi file I created and completely deleted all of
> > the code in the file and restarted Apache and it still gives me the
> > same page (a listing of the files from Django app, not my actual
> > Django application. Configuring Apache and mod_wsgi went really well
> > but I'm at a loss of how to fix this. Here are some details instead of
> > "it's
> > not working":
>
> You are correct. Apache is not looking at the wsgi script. Have a look
> at the suggestions below ... before playing with django.wsgi.
>
>
>
>
>
>
>
>
>
>
>
> > Here is my current django.wsgi file:
>
> > import os
> > import sys
> > sys.path.append('/srv/www/duckling.org/store/')
> > os.environ['PYTHON_EGG_CACHE'] = '/srv/www/duckling.org/
> > store/.python-
> > egg'
> > os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
> > import django.core.handlers.wsgi
> > application = django.core.handlers.wsgi.WSGIHandler()
>
> > I've tried a few different versions of the django.wsgi file
> > (including
> > a version like the one over athttp://www.djangoproject.com/).
> > This version of my wsgi is from here:
> >http://library.linode.com/frameworks/django-apache-mod-wsgi/ubuntu-10...
>
> > Also, here is my vhost apache configuration file below. I think these
> > are
> > the main files that are suppose to do the job for me. Let me know if
> > you see any errors in what I'm doing and what else I might do to fix
> > this. The django app runs fine on the django's built-in development
> > server so I'm thinking it *might have* something with my paths.
> > No errors in my apache error.log file as well. It's acting as there's
> > no problem at all, which is not the case...the project isn't loading,
> > like I said just a listing of my files and directories of my Django
> > project. Here is my apache config file:
>
> > 
> >      ServerAdmin h...@duckling.org
> >      ServerName duckling.org
> >      ServerAliaswww.duckling.org
>
> >      DocumentRoot /srv/www/duckling.org/store/
>
> # DocumentRoot is where you keep non-django stuff eg., static files
> # which is served by Apache without needing your Django code
> DocumentRoot /srv/www/duckling.org/htdocs/
>
>
>
> >      
> >      Order Allow,Deny
> >      Allow from all
> >      
>
> # now let the public access anything here
>   
>    AllowOverride None
>    Order deny,allow
>    Allow from all
>   
>
>
>
> >      WSGIScriptAlias /django /srv/www/duckling.org/store/wsgi-scripts/
> > django.wsgi
> >      
> >      Order allow,deny
> >      Allow from all
> >      
> > 
>
> Somewhere in your Apache config you have denied access to the entire
> filesystem to prevent outsiders from hacking in. Your Django code must
> also be hidden from outsiders so it will live safely in
> /srv/www/duckling.org/store because you haven't allowed anyone except
> Apache to see it.
>
> Now you need to provide an allowed conduit to your Django code. So make
> an Apache script alias to map the website root (ie '/') to your Django
> code. Because you are using mod_wsgi the entry point is your django.wsgi
> script. So map / to the script:
>   WSGIScriptAlias / /srv/www/duckling.org/store/w

Re: Apache & mod_wsgi are configured correctly. Need Django to recognize my django.wsgi file.

2010-12-11 Thread Mike Dewhirst

On 12/12/2010 7:14am, jc wrote:

Apache&  mod_wsgi are configured correctly (I've created a hello
world .html apache file and a hello world mod_wsgi application with
no
problems). I know need my Django app to recognize my django.wsgi
file.
What makes me think that it's not recognizing my wsgi file is that I
went into my django.wsgi file I created and completely deleted all of
the code in the file and restarted Apache and it still gives me the
same page (a listing of the files from Django app, not my actual
Django application. Configuring Apache and mod_wsgi went really well
but I'm at a loss of how to fix this. Here are some details instead of
"it's
not working":


You are correct. Apache is not looking at the wsgi script. Have a look 
at the suggestions below ... before playing with django.wsgi.




Here is my current django.wsgi file:

import os
import sys
sys.path.append('/srv/www/duckling.org/store/')
os.environ['PYTHON_EGG_CACHE'] = '/srv/www/duckling.org/
store/.python-
egg'
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

I've tried a few different versions of the django.wsgi file
(including
a version like the one over at http://www.djangoproject.com/).
This version of my wsgi is from here:
http://library.linode.com/frameworks/django-apache-mod-wsgi/ubuntu-10...


Also, here is my vhost apache configuration file below. I think these
are
the main files that are suppose to do the job for me. Let me know if
you see any errors in what I'm doing and what else I might do to fix
this. The django app runs fine on the django's built-in development
server so I'm thinking it *might have* something with my paths.
No errors in my apache error.log file as well. It's acting as there's
no problem at all, which is not the case...the project isn't loading,
like I said just a listing of my files and directories of my Django
project. Here is my apache config file:


 ServerAdmin h...@duckling.org
 ServerName duckling.org
 ServerAlias www.duckling.org

 DocumentRoot /srv/www/duckling.org/store/


# DocumentRoot is where you keep non-django stuff eg., static files
# which is served by Apache without needing your Django code
DocumentRoot /srv/www/duckling.org/htdocs/



 
 Order Allow,Deny
 Allow from all
 


# now let the public access anything here
 
  AllowOverride None
  Order deny,allow
  Allow from all
 



 WSGIScriptAlias /django /srv/www/duckling.org/store/wsgi-scripts/
django.wsgi
 
 Order allow,deny
 Allow from all
 




Somewhere in your Apache config you have denied access to the entire 
filesystem to prevent outsiders from hacking in. Your Django code must 
also be hidden from outsiders so it will live safely in 
/srv/www/duckling.org/store because you haven't allowed anyone except 
Apache to see it.


Now you need to provide an allowed conduit to your Django code. So make 
an Apache script alias to map the website root (ie '/') to your Django 
code. Because you are using mod_wsgi the entry point is your django.wsgi 
script. So map / to the script:

 WSGIScriptAlias / /srv/www/duckling.org/store/wsgi-scripts/django.wsgi

# and give the public full access - but only to the entry point
 
  Order deny,allow
  Allow from all
 

hth
Mike



And here are versions of the stack that I'm using, I saw over at the
mod_wsgi site that you all would like the versions of what I'm using
on the server:
Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.5 with Suhosin-Patch
mod_python/3.3.1 Python/2.6.5 mod_wsgi/2.8


I would remove mod_python if possible



thanks,
j.



--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Apache & mod_wsgi are configured correctly. Need Django to recognize my django.wsgi file.

2010-12-11 Thread jc
Apache & mod_wsgi are configured correctly (I've created a hello
world .html apache file and a hello world mod_wsgi application with
no
problems). I know need my Django app to recognize my django.wsgi
file.
What makes me think that it's not recognizing my wsgi file is that I
went into my django.wsgi file I created and completely deleted all of
the code in the file and restarted Apache and it still gives me the
same page (a listing of the files from Django app, not my actual
Django application. Configuring Apache and mod_wsgi went really well
but I'm at a loss of how to fix this. Here are some details instead of
"it's
not working":

Here is my current django.wsgi file:

import os
import sys
sys.path.append('/srv/www/duckling.org/store/')
os.environ['PYTHON_EGG_CACHE'] = '/srv/www/duckling.org/
store/.python-
egg'
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

I've tried a few different versions of the django.wsgi file
(including
a version like the one over at http://www.djangoproject.com/).
This version of my wsgi is from here:
http://library.linode.com/frameworks/django-apache-mod-wsgi/ubuntu-10...


Also, here is my vhost apache configuration file below. I think these
are
the main files that are suppose to do the job for me. Let me know if
you see any errors in what I'm doing and what else I might do to fix
this. The django app runs fine on the django's built-in development
server so I'm thinking it *might have* something with my paths.
No errors in my apache error.log file as well. It's acting as there's
no problem at all, which is not the case...the project isn't loading,
like I said just a listing of my files and directories of my Django
project. Here is my apache config file:


ServerAdmin h...@duckling.org
ServerName duckling.org
ServerAlias www.duckling.org

DocumentRoot /srv/www/duckling.org/store/


Order Allow,Deny
Allow from all


WSGIScriptAlias /django /srv/www/duckling.org/store/wsgi-scripts/
django.wsgi

Order allow,deny
Allow from all




And here are versions of the stack that I'm using, I saw over at the
mod_wsgi site that you all would like the versions of what I'm using
on the server:
Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.5 with Suhosin-Patch
mod_python/3.3.1 Python/2.6.5 mod_wsgi/2.8

thanks,
j.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Error Starting Django App using Apache+Mod_Wsgi

2010-11-22 Thread Graham Dumpleton
Have a read of:

  http://code.google.com/p/modwsgi/wiki/InstallationIssues

It is likely that you have a conflicting mod_python module installed
or that mod_wsgi is no finding the correct Python installation shared
library at run time.

Graham

On Nov 22, 11:58 pm, Guddu  wrote:
> All,
>
> I have a problem in starting my Django App using Apache and Mod_Wsgi
>
> I am using Django 1.2.3 and Python 2.6.6 running on Apache 2.2.17 with
> Mod_Wsgi 3.3
>
> When I try to access the app from Web Browser, I am getting these
> errors.
>
> [Mon Nov 22 09:45:25 2010] [notice] Apache/2.2.17 (Unix) mod_wsgi/3.3
> Python/2.6.6 configured -- resuming normal operations
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] mod_wsgi
> (pid=1273874): Target WSGI script '/u01/home/apli/wm/app/gdd/pyserver/
> apache/django.wsgi' cannot be loaded as Python module.
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] mod_wsgi
> (pid=1273874): Exception occurred processing WSGI script '/u01/home/
> apli/wm/app/gdd/pyserver/apache/django.wsgi'.
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] Traceback
> (most recent call last):
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   File "/u01/
> home/apli/wm/app/gdd/pyserver/apache/django.wsgi", line 19, in
> 
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]     import
> django.core.handlers.wsgi
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   File "/usr/
> local/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line
> 1, in 
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]     from
> threading import Lock
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   File "/usr/
> local/lib/python2.6/threading.py", line 13, in 
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]     from
> functools import wraps
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   File "/usr/
> local/lib/python2.6/functools.py", line 10, in 
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]     from
> _functools import partial, reduce
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] ImportError:
> rtld: 0712-001 Symbol PyArg_UnpackTuple was referenced
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]       from
> module /usr/local/lib/python2.6/lib-dynload/_functools.so(), but a
> runtime definition
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]       of the
> symbol was not found.
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] rtld:
> 0712-001 Symbol PyCallable_Check was referenced
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]       from
> module /usr/local/lib/python2.6/lib-dynload/_functools.so(), but a
> runtime definition
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]       of the
> symbol was not found.
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] rtld:
> 0712-001 Symbol PyDict_Copy was referenced
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]       from
> module /usr/local/lib/python2.6/lib-dynload/_functools.so(), but a
> runtime definition
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]       of the
> symbol was not found.
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] rtld:
> 0712-001 Symbol PyDict_Merge was referenced
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]       from
> module /usr/local/lib/python2.6/lib-dynload/_functools.so(), but a
> runtime definition
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]       of the
> symbol was not found.
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] rtld:
> 0712-001 Symbol PyDict_New was referenced
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]       from
> module /usr/local/lib/python2.6/lib-dynload/_functools.so(), but a
> runtime definition
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]       of the
> symbol was not found.
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] rtld:
> 0712-001 Symbol PyErr_Occurred was referenced
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]       from
> module /usr/local/lib/python2.6/lib-dynload/_functools.so(), but a
> runtime definition
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]       of the
> symbol was not found.
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] rtld:
> 0712-001 Symbol PyErr_SetString was referenced
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]       from
> module /usr/local/lib/python2.6/lib-dynload/_functools.so(), but a
> runtime definition
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]       of the
> symbol was not found.
>
> [Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] \t0509-021
> Additional errors occurred but are not reported.
>
> I assume that those missing runtime definitions are supposed to be in
> the Python executable. Doing an nm on the 

Error Starting Django App using Apache+Mod_Wsgi

2010-11-22 Thread Guddu
All,

I have a problem in starting my Django App using Apache and Mod_Wsgi

I am using Django 1.2.3 and Python 2.6.6 running on Apache 2.2.17 with
Mod_Wsgi 3.3

When I try to access the app from Web Browser, I am getting these
errors.

[Mon Nov 22 09:45:25 2010] [notice] Apache/2.2.17 (Unix) mod_wsgi/3.3
Python/2.6.6 configured -- resuming normal operations

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] mod_wsgi
(pid=1273874): Target WSGI script '/u01/home/apli/wm/app/gdd/pyserver/
apache/django.wsgi' cannot be loaded as Python module.

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] mod_wsgi
(pid=1273874): Exception occurred processing WSGI script '/u01/home/
apli/wm/app/gdd/pyserver/apache/django.wsgi'.

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] Traceback
(most recent call last):

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   File "/u01/
home/apli/wm/app/gdd/pyserver/apache/django.wsgi", line 19, in


[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] import
django.core.handlers.wsgi

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   File "/usr/
local/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line
1, in 

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] from
threading import Lock

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   File "/usr/
local/lib/python2.6/threading.py", line 13, in 

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] from
functools import wraps

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   File "/usr/
local/lib/python2.6/functools.py", line 10, in 

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] from
_functools import partial, reduce

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] ImportError:
rtld: 0712-001 Symbol PyArg_UnpackTuple was referenced

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   from
module /usr/local/lib/python2.6/lib-dynload/_functools.so(), but a
runtime definition


[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   of the
symbol was not found.

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] rtld:
0712-001 Symbol PyCallable_Check was referenced

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   from
module /usr/local/lib/python2.6/lib-dynload/_functools.so(), but a
runtime definition

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   of the
symbol was not found.

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] rtld:
0712-001 Symbol PyDict_Copy was referenced


[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   from
module /usr/local/lib/python2.6/lib-dynload/_functools.so(), but a
runtime definition

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   of the
symbol was not found.

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] rtld:
0712-001 Symbol PyDict_Merge was referenced

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   from
module /usr/local/lib/python2.6/lib-dynload/_functools.so(), but a
runtime definition

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   of the
symbol was not found.

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] rtld:
0712-001 Symbol PyDict_New was referenced

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   from
module /usr/local/lib/python2.6/lib-dynload/_functools.so(), but a
runtime definition

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   of the
symbol was not found.

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] rtld:
0712-001 Symbol PyErr_Occurred was referenced

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   from
module /usr/local/lib/python2.6/lib-dynload/_functools.so(), but a
runtime definition

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   of the
symbol was not found.

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] rtld:
0712-001 Symbol PyErr_SetString was referenced

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   from
module /usr/local/lib/python2.6/lib-dynload/_functools.so(), but a
runtime definition

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191]   of the
symbol was not found.

[Mon Nov 22 09:45:43 2010] [error] [client 108.10.0.191] \t0509-021
Additional errors occurred but are not reported.


I assume that those missing runtime definitions are supposed to be in
the Python executable. Doing an nm on the first missing symbol reveals
that it does exist.

root [zibal]% nm  /usr/local/bin/python | grep -i PyArg_UnpackTuple
.PyArg_UnpackTuple   T   268683204 524
PyArg_UnpackTupleD   537073500
PyArg_UnpackTupled   537073500  12
PyArg_UnpackTuple:F-1 - 224

Please guide.

Regards,
Guddu

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send 

Re: apache, mod_wsgi, windows: config hints?

2010-08-26 Thread Reinout van Rees

On 08/26/2010 05:01 AM, Sam Lai wrote:

On 25 August 2010 20:09, Reinout van Rees  wrote:


I normally deploy everything on linux, but a customer requires windows.  I
have a working setup with apache and mod_wsgi, but I wonder about the
efficiency.

I see hints like "mod_wsgi, daemon mode" including "but that doesn't work on
windows".  Similarly with other apache settings like the worker you have to
chose.  The best one isn't available on windows.

=>  Could someone give me a pointer on how to best set up apache and
mod_wsgi+django on windows?  My google skills seem to let me down a bit.
  I'm probably overlooking something obvious.


I'd stick with IIS on Windows - much better supported than Apache, not
to mention easier to manage on a Windows box, particularly if you only
have Windows sysadmins.


I doubt one of those windows-is-easier-for-us sysadmins is willing to 
give me a working IIS configuration :-)  So I'll have to figure that out 
myself.



Here's a pretty good overview of your options -
http://jasonmbaker.wordpress.com/2009/06/04/windows-for-python-programmers-iis/


Good link.  That's pretty convincing that apache might really not be a 
good idea.  Bit of a shame as I'm suddenly down to 0 knowledge on how to 
set up a webserver :-)



ISAPI-WSGI would be the best option.
http://code.google.com/p/isapi-wsgi/


I'll look at that, thanks.


Reinout


--
Reinout van Rees - rein...@vanrees.org - http://reinout.vanrees.org
Collega's gezocht!
Django/python vacature in Utrecht: http://tinyurl.com/35v34f9

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: apache, mod_wsgi, windows: config hints?

2010-08-25 Thread Sam Lai
On 25 August 2010 20:09, Reinout van Rees  wrote:
> Hi all,
>
> I normally deploy everything on linux, but a customer requires windows.  I
> have a working setup with apache and mod_wsgi, but I wonder about the
> efficiency.
>
> I see hints like "mod_wsgi, daemon mode" including "but that doesn't work on
> windows".  Similarly with other apache settings like the worker you have to
> chose.  The best one isn't available on windows.
>
> => Could someone give me a pointer on how to best set up apache and
> mod_wsgi+django on windows?  My google skills seem to let me down a bit.
>  I'm probably overlooking something obvious.

I'd stick with IIS on Windows - much better supported than Apache, not
to mention easier to manage on a Windows box, particularly if you only
have Windows sysadmins. And you get most of the advantages of daemon
mode when you use Application Pools.

Here's a pretty good overview of your options -
http://jasonmbaker.wordpress.com/2009/06/04/windows-for-python-programmers-iis/

ISAPI-WSGI would be the best option.
http://code.google.com/p/isapi-wsgi/

Don't bother with the IronPython option - Django isn't fully
compatible with it at the moment.

> Alternatives are fine, too.  But it has to be windows :-)
>
>
> Reinout
>
> --
> Reinout van Rees - rein...@vanrees.org - http://reinout.vanrees.org
> Programmer at http://www.nelen-schuurmans.nl
> "Military engineers build missiles. Civil engineers build targets"
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



apache, mod_wsgi, windows: config hints?

2010-08-25 Thread Reinout van Rees

Hi all,

I normally deploy everything on linux, but a customer requires windows. 
 I have a working setup with apache and mod_wsgi, but I wonder about 
the efficiency.


I see hints like "mod_wsgi, daemon mode" including "but that doesn't 
work on windows".  Similarly with other apache settings like the worker 
you have to chose.  The best one isn't available on windows.


=> Could someone give me a pointer on how to best set up apache and 
mod_wsgi+django on windows?  My google skills seem to let me down a bit. 
 I'm probably overlooking something obvious.


Alternatives are fine, too.  But it has to be windows :-)


Reinout

--
Reinout van Rees - rein...@vanrees.org - http://reinout.vanrees.org
Programmer at http://www.nelen-schuurmans.nl
"Military engineers build missiles. Civil engineers build targets"

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: SSL with Django, Apache, mod_wsgi and nginx

2010-08-10 Thread Graham Dumpleton


On Aug 11, 7:43 am, Colleen A Josephson <cjos...@mit.edu> wrote:
> That does exactly what I need, thank-you!
> 
> From: django-users@googlegroups.com [django-us...@googlegroups.com] On Behalf 
> Of Michael [newmani...@gmail.com]
> Sent: Tuesday, August 10, 2010 5:25 PM
> To: django-users@googlegroups.com
> Subject: Re: SSL with Django, Apache, mod_wsgi and nginx
>
> On Tue, Aug 10, 2010 at 5:00 PM, Colleen A Josephson 
> <cjos...@mit.edu<mailto:cjos...@mit.edu>> wrote:
> Unfortunately I'm not very well versed in proxying and SSL, etc.
> I'm not sure I understand how mod WSGi eliminates the need for SSLRedirect.

Not a case of eliminating it, with nginx as front end proxy as
described in that blog post and with nginx handling HTTPS and Apache
only receiving requests as HTTP, you cant use SSLRedirect in Apache
because Apache will only ever see it as HTTP and using that directive
will cause a redirect loop. Thus instead of SSLRedirect, with that
configuration, you must use the equivalent in nginx as someone
described below.

BTW, the tip of tricking Django into thinking request is via HTTPS
even though it only handles it as HTTP is important. Instead of their
suggestion of modifying WSI script however, I would just use:

  SetEnvIf X-Forwarded-Protocol "^https$" HTTPS=on

With either fixup in place, you could also perhaps in Django
application use one of the methods available for check if connection
is_secure and redirecting if not.

Graham

> I implemented the Lincoln Loop setup, but if I go to the http:// admin page I 
> am not redirected to https:// as I would like to be.
>
> It would be much more efficient to redirect from nginx than django here. Just 
> implement something like this on your server that runs on port 80 (http):
>
> location /admin/ {
>      rewrite (.*)  https://$server_name$1 permanant;
>
> }
>
> This is just a snippit I just wrote. Let me know if it doesn't work, I will 
> actually go and run it.
>
> hope that helps,
>
> Michael
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



RE: SSL with Django, Apache, mod_wsgi and nginx

2010-08-10 Thread Colleen A Josephson
That does exactly what I need, thank-you!

From: django-users@googlegroups.com [django-us...@googlegroups.com] On Behalf 
Of Michael [newmani...@gmail.com]
Sent: Tuesday, August 10, 2010 5:25 PM
To: django-users@googlegroups.com
Subject: Re: SSL with Django, Apache, mod_wsgi and nginx

On Tue, Aug 10, 2010 at 5:00 PM, Colleen A Josephson 
<cjos...@mit.edu<mailto:cjos...@mit.edu>> wrote:
Unfortunately I'm not very well versed in proxying and SSL, etc.
I'm not sure I understand how mod WSGi eliminates the need for SSLRedirect.

I implemented the Lincoln Loop setup, but if I go to the http:// admin page I 
am not redirected to https:// as I would like to be.

It would be much more efficient to redirect from nginx than django here. Just 
implement something like this on your server that runs on port 80 (http):

location /admin/ {
 rewrite (.*)  https://$server_name$1 permanant;
}

This is just a snippit I just wrote. Let me know if it doesn't work, I will 
actually go and run it.

hope that helps,

Michael

--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: SSL with Django, Apache, mod_wsgi and nginx

2010-08-10 Thread Michael
On Tue, Aug 10, 2010 at 5:00 PM, Colleen A Josephson wrote:

> Unfortunately I'm not very well versed in proxying and SSL, etc.
> I'm not sure I understand how mod WSGi eliminates the need for SSLRedirect.
>
> I implemented the Lincoln Loop setup, but if I go to the http:// admin
> page I am not redirected to https:// as I would like to be.
>

It would be much more efficient to redirect from nginx than django here.
Just implement something like this on your server that runs on port 80
(http):

location /admin/ {
 rewrite (.*)  https://$server_name$1 permanant;
}

This is just a snippit I just wrote. Let me know if it doesn't work, I will
actually go and run it.

hope that helps,

Michael

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



RE: SSL with Django, Apache, mod_wsgi and nginx

2010-08-10 Thread Colleen A Josephson
Unfortunately I'm not very well versed in proxying and SSL, etc. 
I'm not sure I understand how mod WSGi eliminates the need for SSLRedirect.

I implemented the Lincoln Loop setup, but if I go to the http:// admin page I 
am not redirected to https:// as I would like to be.

From: django-users@googlegroups.com [django-us...@googlegroups.com] On Behalf 
Of Michael [newmani...@gmail.com]
Sent: Tuesday, August 10, 2010 3:00 PM
To: django-users@googlegroups.com
Subject: Re: SSL with Django, Apache, mod_wsgi and nginx

On Tue, Aug 10, 2010 at 2:49 PM, Colleen A Josephson 
<cjos...@mit.edu<mailto:cjos...@mit.edu>> wrote:
I just set up a site that uses nginx to server static media and Apache/mod_wsgi 
to deal with the Django stuff.

How would I go about dealing with SSL? Would the setup be on the nginx end or 
the Apache end? Could I still use SSLRedirect middleware?

Thanks,
-Colleen


There isn't really much of a need for SSLRedirect Middleware with WSGi any 
more. This setup is really a nice one IMO. Thanks to Lincoln Loop for  putting 
it up: http://lincolnloop.com/django-best-practices/deployment/servers.html

Hope that helps,
Michael

--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: SSL with Django, Apache, mod_wsgi and nginx

2010-08-10 Thread Michael
On Tue, Aug 10, 2010 at 2:49 PM, Colleen A Josephson <cjos...@mit.edu>wrote:

> I just set up a site that uses nginx to server static media and
> Apache/mod_wsgi to deal with the Django stuff.
>
> How would I go about dealing with SSL? Would the setup be on the nginx end
> or the Apache end? Could I still use SSLRedirect middleware?
>
> Thanks,
> -Colleen
>
>
There isn't really much of a need for SSLRedirect Middleware with WSGi any
more. This setup is really a nice one IMO. Thanks to Lincoln Loop for
 putting it up:
http://lincolnloop.com/django-best-practices/deployment/servers.html

Hope that helps,
Michael

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



SSL with Django, Apache, mod_wsgi and nginx

2010-08-10 Thread Colleen A Josephson
I just set up a site that uses nginx to server static media and Apache/mod_wsgi 
to deal with the Django stuff.

How would I go about dealing with SSL? Would the setup be on the nginx end or 
the Apache end? Could I still use SSLRedirect middleware?

Thanks,
-Colleen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



SSL with Django, Apache, mod_wsgi and nginx

2010-08-10 Thread Colleen A Josephson
I just set up a site that uses nginx to server static media and Apache/mod_wsgi 
to deal with the Django stuff.

How would I go about dealing with SSL? Would the setup be on the nginx end or 
the Apache end? Could I still use SSLRedirect middleware?

Thanks,
-Colleen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Possible improved WSGI script file for Django when using Apache/mod_wsgi.

2010-03-28 Thread Graham Dumpleton
FWIW, have posted:

http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html

This delves into issues as to why Django development server behaves
differently to Apache/mod_wsgi and describes an alternate WSGI script
file which should hopefully narrow the gap and get rid of some of the
odd issues that crop up when moving to a production system running
under Apache/mod_wsgi.

Feedback as comments to the blog post if possible.

Thanks.

Graham

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Debugging Django project using Eclipse (Apache + mod_wsgi)

2010-03-16 Thread Stefan
Thanks.

Good article.

On 16 мар, 22:53, dan levine  wrote:
> this is a good place to get started:
>
> http://code.google.com/p/modwsgi/wiki/DebuggingTechniques
>
> On Mar 16, 10:11 am, Stefan  wrote:
>
>
>
> > Hello,
>
> > When i used Django web-server there were no problems with debugging
> > Django projects in Eclipse IDE.
> > I had to deploy it on Apache web server.
>
> > How can i debug the same project if it is deployed on Apache with
> > module mod_wsgi?
>
> > With regards, Stefan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Debugging Django project using Eclipse (Apache + mod_wsgi)

2010-03-16 Thread dan levine
this is a good place to get started:

http://code.google.com/p/modwsgi/wiki/DebuggingTechniques

On Mar 16, 10:11 am, Stefan  wrote:
> Hello,
>
> When i used Django web-server there were no problems with debugging
> Django projects in Eclipse IDE.
> I had to deploy it on Apache web server.
>
> How can i debug the same project if it is deployed on Apache with
> module mod_wsgi?
>
> With regards, Stefan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Debugging Django project using Eclipse (Apache + mod_wsgi)

2010-03-16 Thread Stefan
Hello,

When i used Django web-server there were no problems with debugging
Django projects in Eclipse IDE.
I had to deploy it on Apache web server.

How can i debug the same project if it is deployed on Apache with
module mod_wsgi?

With regards, Stefan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django/Apache/mod_wsgi: How do I specify the SCRIPT_NAME for non-root URLs?

2010-01-08 Thread Tyler Erickson
Fixed it.
It turned out to be a problem with how the django project templates
were written.  Both of the projects that I was experimenting with were
using hardcorded href values, instead of using a url template tag.

hardcoded example:
Per-geometry styles

url template tag example:
Per-geometry
styles

reference:
http://docs.djangoproject.com/en/1.1/ref/templates/builtins/#url
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: Django/Apache/mod_wsgi: How do I specify the SCRIPT_NAME for non-root URLs?

2010-01-08 Thread Tyler Erickson
I added the WSGI logging middleware to write to the Apache log as
described in:
http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Tracking_Request_and_Response
and yes it appears that my SCRIPT_NAME environment variable is being
automatically set (see excerpts below).  So I guess it is Django or my
Django project that is causing the problem...

- Tyler

[Fri Jan 08 14:15:16 2010] [error] [client 198.111.191.240]
'PATH_INFO': '',
[Fri Jan 08 14:15:16 2010] [error] [client 198.111.191.240]
'REQUEST_URI': '/olwidget',
[Fri Jan 08 14:15:16 2010] [error] [client 198.111.191.240]
'SCRIPT_NAME': '/olwidget',

[Fri Jan 08 14:14:14 2010] [error] [client 198.111.191.240]
'PATH_INFO': '/',
[Fri Jan 08 14:14:14 2010] [error] [client 198.111.191.240]
'REQUEST_URI': '/olwidget/',
[Fri Jan 08 14:14:14 2010] [error] [client 198.111.191.240]
'SCRIPT_NAME': '/olwidget',

[Fri Jan 08 14:16:27 2010] [error] [client 198.111.191.240]
'PATH_INFO': '/test/test',
[Fri Jan 08 14:16:27 2010] [error] [client 198.111.191.240]
'REQUEST_URI': '/olwidget/test/test',
[Fri Jan 08 14:16:27 2010] [error] [client 198.111.191.240]
'SCRIPT_NAME': '/olwidget',



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: Django, Apache, mod_wsgi, GET works, POST doesn't

2010-01-07 Thread Patrick May
On Jan 6, 3:22 pm, Rob  wrote:
> Have you managed to figure this out - I'm having a similar (I believe
> the same) issue.

It was the typo pointed out by Daniel Roseman.  You may need to turn
on a more detailed debugging level in your httpd.conf to see it in the
log.

Good luck,

Patrick
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: Django/Apache/mod_wsgi: How do I specify the SCRIPT_NAME for non-root URLs?

2010-01-06 Thread Karen Tracey
On Wed, Jan 6, 2010 at 2:39 PM, Tyler Erickson wrote:

> I am trying to use Apache and mod_wsgi to serve multiple django
> sites.  The django sites are served up fine when at the root URL, but
> when served from a sub-URL the portion of the the URL consumed by
> Apache disappears from any links created in the django site pages.
> From reading throught the WSGI spec (http://www.wsgi.org/wsgi/
> Specifications/routing_args),
> it appears that I need to specify the
> SCRIPT_NAME environment variable, but I am not sure where I should do
> that.  (The apache/django.wsgi file seemed like a logical place to set
> the SCRIPT_NAME environment variable, but that seems to have no effect
> on the generated URLs.)
>
>
It should Just Work, no need to set any environment variables.  There have
been a couple of threads recently similar to this:

http://groups.google.com/group/django-users/browse_thread/thread/ce1436670a3c55d5/
http://groups.google.com/group/django-users/browse_thread/thread/e790664ee1855647/

The first identified a Django problem in a very specific case (reverses
called during processing of requests for the project root url without a
trailing slash).  The cause of the second I don't recall seeing an answer
on. When I try it, it works for me, excepting the one case identified in the
first thread.  There is a fair amount of debugging advice to be found in
those threads, so perhaps they will help you in tracking down what is going
wrong in your case.

Karen
-- 

You received this message because you are subscribed to the Google Groups "Django users" group.

To post to this group, send email to django-us...@googlegroups.com.

To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



Re: Django, Apache, mod_wsgi, GET works, POST doesn't

2010-01-06 Thread Rob
Have you managed to figure this out - I'm having a similar (I believe
the same) issue.

On Jan 5, 6:27 am, Patrick May  wrote:
> Can you make it fail in the development server, with DEBUG turned on?
>
> If so, you can get more helpful error display and/or do pdb.set_trace() and
> poke around.
>
> I'll give that a try, thanks!
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Django/Apache/mod_wsgi: How do I specify the SCRIPT_NAME for non-root URLs?

2010-01-06 Thread Tyler Erickson
I am trying to use Apache and mod_wsgi to serve multiple django
sites.  The django sites are served up fine when at the root URL, but
when served from a sub-URL the portion of the the URL consumed by
Apache disappears from any links created in the django site pages.
>From reading throught the WSGI spec (http://www.wsgi.org/wsgi/
Specifications/routing_args), it appears that I need to specify the
SCRIPT_NAME environment variable, but I am not sure where I should do
that.  (The apache/django.wsgi file seemed like a logical place to set
the SCRIPT_NAME environment variable, but that seems to have no effect
on the generated URLs.)

Below is a description of my setup, and the apache and WSGI
configuration files.

- Tyler


OS: Ubuntu 9.04
django: 1.1 SVN-11733
apache: 2.2.11-2ubuntu2.3
libapache2-mod-wsgi: 2.3-1build1


#
Apache configuration file (default)
#

ServerAdmin webmas...@localhost

###
# Configuration for the olwidget test project
###
Alias /olwidget/site_media/ "/usr/local/olwidget/trunk/olwidget/
django-olwidget/test_project/site_media/"

Order allow,deny
Options Indexes
Allow from all
IndexOptions FancyIndexing


Alias /olwidget/media/ "/usr/local/lib/python2.6/dist-packages/
django/contrib/admin/media/"

Order allow,deny
Options Indexes
Allow from all
IndexOptions FancyIndexing


WSGIScriptAlias /olwidget /usr/local/olwidget/trunk/olwidget/
django-olwidget/test_project/apache/django.wsgi

Order deny,allow
Allow from all


###
# Configuration for WFEIS
###
Alias /wfeis/site_media/ "/usr/local/django_nasa_fire_dss/
site_media/"

Order allow,deny
Options Indexes
Allow from all
IndexOptions FancyIndexing


Alias /wfeis/media/ "/usr/local/lib/python2.6/dist-packages/django/
contrib/admin/media/"

Order allow,deny
Options Indexes
Allow from all
IndexOptions FancyIndexing


WSGIScriptAlias /wfeis /usr/local/django_nasa_fire_dss/apache/
django.wsgi

Order deny,allow
Allow from all





#
Example WSGI configuration file
(/usr/local/olwidget/trunk/olwidget/django-olwidget/test_project/
apache/django.wsgi)
#
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'test_project.settings'
os.environ['SCRIPT_NAME'] = 'olwidget'
# append the django project root directory to the python path
sys.path.append('/usr/local/olwidget/trunk/olwidget/django-olwidget')
sys.path.append('/usr/local/olwidget/trunk/olwidget/django-olwidget/
test_project')
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




RE: Django, Apache, mod_wsgi, GET works, POST doesn't

2010-01-05 Thread Patrick May

Can you make it fail in the development server, with DEBUG turned on?

If so, you can get more helpful error display and/or do pdb.set_trace() and
poke around.


I'll give that a try, thanks!

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




RE: Django, Apache, mod_wsgi, GET works, POST doesn't

2010-01-05 Thread Patrick May

Assuming the code you've posted is a real cut and paste, you have
"HTTPResponse" for POST but "HttpResponse" for GET. Python is case-
sensitive, so only "HttpResponse" will work.


Thanks, that was it.  Are errors like that written to a log file anywhere?

Thanks again,

Patrick

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: Django, Apache, mod_wsgi, GET works, POST doesn't

2010-01-04 Thread Bill Freeman
Can you make it fail in the development server, with DEBUG turned on?

If so, you can get more helpful error display and/or do pdb.set_trace() and
poke around.

On Mon, Jan 4, 2010 at 4:25 PM, Patrick May  wrote:
> Hi,
>
> I have Django running under Apache with mod_wsgi.  I've got a simple URL 
> handler that looks like this:
>
> def handler(request):
>    response = None
>
>    if request.method == 'POST' or request.method == 'PUT':
>        response = HTTPResponse(status=201)
>    elif request.method == 'GET':
>        response = HttpResponse("Success")
>    else:
>        raise Http404
>
>    return response
>
> My django.wsgi looks like this:
>
> import os
> import sys
>
> sys.path.append('/Users/Patrick/codestreet/src/rest')
>
> os.environ['DJANGO_SETTINGS_MODULE'] = 'server.settings'
>
> import django.core.handlers.wsgi
>
> application = django.core.handlers.wsgi.WSGIHandler()
>
> When I connect to the URL for the handler with a GET like this:
>
>        request = urllib2.Request(self.URL)
>
> it works fine, returning a 200.  However, when I connect with a POST like 
> this:
>
>        request = urllib2.Request(self.URL,self.data)
>
> I get an exception thrown with a 500 code and this in the Apache error log:
>
> [Mon Jan 04 16:20:08 2010] [error] [client ::1] mod_wsgi (pid=48698): 
> Exception occurred processing WSGI script 
> '/Users/Patrick/codestreet/src/rest/django.wsgi'.
> [Mon Jan 04 16:20:08 2010] [error] [client ::1] IOError: failed to write data
>
> Do I have something misconfigured?
>
> Thanks,
>
> Patrick
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: Django, Apache, mod_wsgi, GET works, POST doesn't

2010-01-04 Thread Daniel Roseman
On Jan 4, 9:25 pm, Patrick May  wrote:
> Hi,
>
> I have Django running under Apache with mod_wsgi.  I've got a simple URL 
> handler that looks like this:
>
> def handler(request):
>     response = None
>
>     if request.method == 'POST' or request.method == 'PUT':
>         response = HTTPResponse(status=201)
>     elif request.method == 'GET':
>         response = HttpResponse("Success")
>     else:
>         raise Http404
>
>     return response
>
> My django.wsgi looks like this:
>
> import os
> import sys
>
> sys.path.append('/Users/Patrick/codestreet/src/rest')
>
> os.environ['DJANGO_SETTINGS_MODULE'] = 'server.settings'
>
> import django.core.handlers.wsgi
>
> application = django.core.handlers.wsgi.WSGIHandler()
>
> When I connect to the URL for the handler with a GET like this:
>
>         request = urllib2.Request(self.URL)
>
> it works fine, returning a 200.  However, when I connect with a POST like 
> this:
>
>         request = urllib2.Request(self.URL,self.data)
>
> I get an exception thrown with a 500 code and this in the Apache error log:
>
> [Mon Jan 04 16:20:08 2010] [error] [client ::1] mod_wsgi (pid=48698): 
> Exception occurred processing WSGI script 
> '/Users/Patrick/codestreet/src/rest/django.wsgi'.
> [Mon Jan 04 16:20:08 2010] [error] [client ::1] IOError: failed to write data
>
> Do I have something misconfigured?
>
> Thanks,
>
> Patrick

Assuming the code you've posted is a real cut and paste, you have
"HTTPResponse" for POST but "HttpResponse" for GET. Python is case-
sensitive, so only "HttpResponse" will work.
--
DR.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Django, Apache, mod_wsgi, GET works, POST doesn't

2010-01-04 Thread Patrick May
Hi,

I have Django running under Apache with mod_wsgi.  I've got a simple URL 
handler that looks like this:

def handler(request):
response = None

if request.method == 'POST' or request.method == 'PUT':
response = HTTPResponse(status=201)
elif request.method == 'GET':
response = HttpResponse("Success")
else:
raise Http404

return response

My django.wsgi looks like this:

import os
import sys

sys.path.append('/Users/Patrick/codestreet/src/rest')
 
os.environ['DJANGO_SETTINGS_MODULE'] = 'server.settings'

import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()

When I connect to the URL for the handler with a GET like this:

request = urllib2.Request(self.URL)

it works fine, returning a 200.  However, when I connect with a POST like this:

request = urllib2.Request(self.URL,self.data)

I get an exception thrown with a 500 code and this in the Apache error log:

[Mon Jan 04 16:20:08 2010] [error] [client ::1] mod_wsgi (pid=48698): Exception 
occurred processing WSGI script 
'/Users/Patrick/codestreet/src/rest/django.wsgi'.
[Mon Jan 04 16:20:08 2010] [error] [client ::1] IOError: failed to write data

Do I have something misconfigured?

Thanks,

Patrick

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




  1   2   >