Discussion:
Web host for Django, what to ask for?
Michael Hipp
2005-12-31 18:39:28 UTC
Permalink
I'm hoping to convince my current hosting provider (zipa.com) to support
Django. (Switching providers would be a pain right now.) What would I tell
them I need?

apache
mod_python
psycopg
postgresql (or mysql) (1 database?)

Is there any chance of convincing them to modify their httpd.conf file for me
as in http://www.djangoproject.com/documentation/modpython/ ?

Anything else I should ask for or any best way to pose the question?

Thanks,
Michael

P.S. Here are their shared hosting plans:
http://zipa.com/shared/index.php?group_id=192788&plan_id=&ln=1&all=1
PythonistL
2005-12-31 19:44:06 UTC
Permalink
Hello Michael,
You face the similar problem I did few weeks ago.
I also have a webhosting provider (http://www.imhosted.com/)who offered
a good webhosting plan and I bought his webhosting plan.Later after I
learned how good Django is I also tried to convince him to install the
Django.I found out that they did not have mod_python installed, so
first I asked him if they would install it.After spending some time to
talk with them they decided not to install mod_python, saying that it
would not be good for their servers( compatibility and overload
issues).
I do not know your provider but I think it is a problem ( if you do not
have a good provider)
to use Django with mod_python because Django doesn't use autoreloading
.
If your provider make changes into httpd.conf to setup your Django
project on their server, I doubt they will be willing to make
restarting Apache whenever you upload a new version of your project.
I think it is a big problem of Django installation with mod_python.
Maybe using fast_CGI would be a better solution but not sure.( I wish
Django had an easier installation)

Regards,
L.
Eugene Lazutkin
2005-12-31 21:54:52 UTC
Permalink
I use Apache + FastCGI + MySQL. I think this is the easiest combination for
hosting providers. If they provide all 3, you can install the rest locally.

Thanks,

Eugene
Post by Michael Hipp
I'm hoping to convince my current hosting provider (zipa.com) to support
Django. (Switching providers would be a pain right now.) What would I tell
them I need?
apache
mod_python
psycopg
postgresql (or mysql) (1 database?)
Is there any chance of convincing them to modify their httpd.conf file for
me as in http://www.djangoproject.com/documentation/modpython/ ?
Anything else I should ask for or any best way to pose the question?
Thanks,
Michael
http://zipa.com/shared/index.php?group_id=192788&plan_id=&ln=1&all=1
s***@colorado.edu
2006-01-03 22:52:16 UTC
Permalink
Post by Eugene Lazutkin
I use Apache + FastCGI + MySQL. I think this is the easiest combination for
hosting providers. If they provide all 3, you can install the rest locally.
Is it possible to take advantage of Apache+FastCGI+MySQL without
reconfiguring Apache as per these instruction (assuming FastCGI is
already installed):
https://simon.bofh.ms/cgi-bin/trac-django-projects.cgi/wiki/DjangoFcgi

If so, is there any documentation for this? Thanks. -Garett
David MacKinnon
2006-01-03 23:20:49 UTC
Permalink
Post by s***@colorado.edu
Post by Eugene Lazutkin
I use Apache + FastCGI + MySQL. I think this is the easiest combination for
hosting providers. If they provide all 3, you can install the rest locally.
Is it possible to take advantage of Apache+FastCGI+MySQL without
reconfiguring Apache as per these instruction (assuming FastCGI is
https://simon.bofh.ms/cgi-bin/trac-django-projects.cgi/wiki/DjangoFcgi
If so, is there any documentation for this? Thanks. -Garett
You can use it without using external servers. If you have flup
installed, something like this as your .fcgi

#!/usr/bin/env python2.4
import sys
sys.path += ['/home/www/05/welvic.org.au/data']
from flup.server.fcgi_fork import WSGIServer
from django.core.handlers.wsgi import WSGIHandler
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'welsite.settings'
WSGIServer(WSGIHandler()).run()

In the apache virtual host config, assuming fastcgi is enabled.

User wel
Group wel

<Location / >
Options +ExecCGI
AddHandler cgi-script .cgi .pl
AddHandler cgi-script .php .php3
AddHandler fastcgi-script .fcgi
</Location>

RewriteEngine On
RewriteRule ^/media/(.*)
/home/www/05/welvic.org.au/data/welsite/media/$1 [L]
RewriteRule ^/site_media/(.*)
/home/www/05/welvic.org.au/data/welsite/site_media/$1 [L]
RewriteRule ^(.*)$ /home/www/05/welvic.org.au/www/welsite.fcgi$1 [L]

This is, IMHO the easiest way to run it in a shared hosting
environment (i'll admit, we control the environment in this case, but
I dislike "special" setups where they can be avoided)

We also use suExec as the FastCGIWrapper, so it runs as the user (this
site isn't live yet btw :)).

-David
Eugene Lazutkin
2006-01-04 02:54:57 UTC
Permalink
These are instructions for my setup:
http://wiki.dreamhost.com/index.php/Django --- actually I use full-blown
flup now, but it is a tiny change to one script.

Thanks,

Eugene
Post by s***@colorado.edu
Post by Eugene Lazutkin
I use Apache + FastCGI + MySQL. I think this is the easiest combination for
hosting providers. If they provide all 3, you can install the rest locally.
Is it possible to take advantage of Apache+FastCGI+MySQL without
reconfiguring Apache as per these instruction (assuming FastCGI is
https://simon.bofh.ms/cgi-bin/trac-django-projects.cgi/wiki/DjangoFcgi
If so, is there any documentation for this? Thanks. -Garett
David MacKinnon
2006-01-04 04:45:30 UTC
Permalink
Post by Eugene Lazutkin
http://wiki.dreamhost.com/index.php/Django --- actually I use full-blown
flup now, but it is a tiny change to one script.
That looks like where I got the setup I'm using from. Thanks, forgot
where I found it :)

I really wish it was possible to run things as different users under
mod_python and the like :( Running stuff as the apache user in any
shared environment just gives me the willies.

-David
Kenneth Gonsalves
2006-01-01 02:32:14 UTC
Permalink
Post by Michael Hipp
I'm hoping to convince my current hosting provider (zipa.com) to
support Django. (Switching providers would be a pain right now.)
What would I tell them I need?
apache
mod_python
psycopg
postgresql (or mysql) (1 database?)
using apache2+mod_python is practically impossible without root
access. I use zettai.net - their core hosting plan gives me root
access, so i can do practically anything i want except setup
databases, pick up dns and set up mail - all of which they do
almost immediatly on request. (i am not an employee of zettai and
dont get commission for recomending them)
--
regards
kg

http://www.livejournal.com/users/lawgon
tally ho! http://avsap.org.in
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!
Joshua D. Drake
2006-01-02 00:23:09 UTC
Permalink
Post by Kenneth Gonsalves
using apache2+mod_python is practically impossible without root
access.
Well I don't know about that at all. You simply request a proxy.
That is what we do for our accounts and commandprompt.com. We have
a main apache2 instance that proxies to a private instance of apache2
for the customer.

This allows the custom to run mod_python and any other oddities they
may need on their own apache instance that they can stop/start, configure
etc...

No root access required.

As far as the database is concerned we configure a private postgresql
instance on its own port/socket for the customer only. No shared clusters.

It really isn't that hard and I am surprised that more hosting providers
don't do it this way as it is more manageable (in a lot of ways) then jailed
roots or vm's.

Sincerely,

Joshua D. Drake
Post by Kenneth Gonsalves
I use zettai.net - their core hosting plan gives me root
access, so i can do practically anything i want except setup
databases, pick up dns and set up mail - all of which they do
almost immediatly on request. (i am not an employee of zettai and
dont get commission for recomending them)
--
The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: PLphp, PLperl - http://www.commandprompt.com/
PythonistL
2006-01-02 06:17:03 UTC
Permalink
Joshua, can you please share with some of us some more details, when
you say
Post by Joshua D. Drake
You simply request a proxy.
That is what we do for our accounts and commandprompt.com. We have
a main apache2 instance that proxies to a private instance of apache2 for
the customer.
This allows the custom to run mod_python and any other oddities they may
need on their own apache instance that they can stop/start, configure
etc...
?
Thank you
Regards,
Lad.
James Bennett
2006-01-02 06:23:33 UTC
Permalink
Post by PythonistL
Joshua, can you please share with some of us some more details, when
you say
Post by Joshua D. Drake
You simply request a proxy.
That is what we do for our accounts and commandprompt.com. We have
a main apache2 instance that proxies to a private instance of apache2 for
the customer.
'Proxying' with Apache basically means that you tell Apache to take
all requests of a certain type, and forward them somewhere else. In
this case, I assume each user has a separate instance of Apache which
they're allowed to configure and which listens on a port other than
80; then you just proxy requests on port 80 for a user's domain to the
port their Apache is listening on, and their Apache processes the
request.

I do the same thing with my TextDrive account; I'm currently running
an instance of the poll app from the tutorial using lighttpd+FastCGI,
and I just have Apache proxy requests for that domain to the port
lighttpd is listening on. It's a pretty handy trick.



--
"May the forces of evil become confused on the way to your house."
-- George Carlin
PythonistL
2006-01-02 06:43:52 UTC
Permalink
James, Thank you for the explanation.
Does it also mean that I can install my own mod_python( if I have SSH
access on my webhosting disk) together with my instance of the Apache
and then I can restart Apache by myself whenever I need?
Regards,
Lad.
Joshua D. Drake
2006-01-02 07:16:01 UTC
Permalink
Post by PythonistL
James, Thank you for the explanation.
Does it also mean that I can install my own mod_python( if I have SSH
access on my webhosting disk) together with my instance of the Apache
and then I can restart Apache by myself whenever I need?
Yes it does. Although in our case we provide you with the latest stable
mod_python and python already.

Sincerely,

Joshua D. Drake
Post by PythonistL
Regards,
Lad.
--
Command Prompt, Inc., Your PostgreSQL solutions company. 503-667-4564
Custom programming, 24x7 support, managed services, and hosting
Open Source Authors: plPHP, pgManage, Co-Authors: plPerlNG
Reliable replication, Mammoth Replicator - http://www.commandprompt.com/
Joshua D. Drake
2006-01-02 07:18:35 UTC
Permalink
Post by James Bennett
'Proxying' with Apache basically means that you tell Apache to take
all requests of a certain type, and forward them somewhere else. In
this case, I assume each user has a separate instance of Apache which
they're allowed to configure and which listens on a port other than
80; then you just proxy requests on port 80 for a user's domain to the
port their Apache is listening on, and their Apache processes the
request.
That is correct. The account also gets a minimum of two acounts:

1. Main account
2. Web account (what apache runs as)

The web account doesn't have a shell and we use group rights to
allow the main account to write to the document root.

Sincerely,

Joshua D. Drake
Post by James Bennett
I do the same thing with my TextDrive account; I'm currently running
an instance of the poll app from the tutorial using lighttpd+FastCGI,
and I just have Apache proxy requests for that domain to the port
lighttpd is listening on. It's a pretty handy trick.
--
"May the forces of evil become confused on the way to your house."
-- George Carlin
--
Command Prompt, Inc., Your PostgreSQL solutions company. 503-667-4564
Custom programming, 24x7 support, managed services, and hosting
Open Source Authors: plPHP, pgManage, Co-Authors: plPerlNG
Reliable replication, Mammoth Replicator - http://www.commandprompt.com/
PythonistL
2006-01-05 13:48:00 UTC
Permalink
Hello James Bennett and Joshua D. Drake ,
Thank you for some ideas about using Django with share webhosting .
I have some more questions:
1. Does it mean that I should ask my webhosting provider to install
mod_proxy Apache module( my provider uses Apache server)?
2.After enabling proxy, is it possible ( via SSH access) to install my
own Apache and mod_Python and configure it for Django?
3. Is there any cookbook how to setup proxy?
Thank you for help
Regards,
Lad.

Kenneth Gonsalves
2006-01-03 02:07:16 UTC
Permalink
Post by Joshua D. Drake
Post by Kenneth Gonsalves
using apache2+mod_python is practically impossible without root
access.
Well I don't know about that at all. You simply request a proxy.
That is what we do for our accounts and commandprompt.com. We
have a main apache2 instance that proxies to a private instance
of apache2 for the customer.
This allows the custom to run mod_python and any other oddities
they may need on their own apache instance that they can
stop/start, configure etc...
No root access required.
true - i have some sites hosted on this kind of set-up, but zope
sites. I also need root access for setting up new users and also
for installing python apps
--
regards
kg

http://www.livejournal.com/users/lawgon
tally ho! http://avsap.org.in
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!
James Bennett
2006-01-01 02:36:26 UTC
Permalink
Post by Michael Hipp
I'm hoping to convince my current hosting provider (zipa.com) to support
Django. (Switching providers would be a pain right now.) What would I tell
them I need?
Depends. If you're on shared hosting, you'll probably want to run
Django via FastCGI or SCGI, just because that tends to be easiest for
both customer and host. In which case you'll want Apache plus either
the FastCGI or SCGI module, and a single MySQL or PostgreSQL database
(go with whatever you prefer, they're both good. In my experience
you're more likely to get MySQL on shared hosting, though).

If you've got a VPS or dedicated server, then go for mod_python; at
that level they should be giving you the access you need to use it
well.

In either case, you'll want a recent Python (2.3 or 2.4, 2.4 is best)
and the bindings for the database you plan to use.

--
"May the forces of evil become confused on the way to your house."
-- George Carlin
Simon Willison
2006-01-01 12:19:45 UTC
Permalink
Post by Michael Hipp
I'm hoping to convince my current hosting provider (zipa.com) to
support Django. (Switching providers would be a pain right now.)
What would I tell them I need?
apache
mod_python
psycopg
postgresql (or mysql) (1 database?)
One approach might be to encourage them to add FastCGI support and
tell them that it will let them support both Django /and/ Rails in
one shot. Since Rails is way ahead in terms of marketing right now it
makes sense to ride on their coat tails when it comes to getting
hosts to support Django.

Cheers,

Simon
Continue reading on narkive:
Loading...