Midphase + web2py how do I set it up?

122 views
Skip to first unread message

Chris S

unread,
Oct 1, 2009, 11:26:45 AM10/1/09
to web2py-users
I've got a friend that's letting me try out web2py on his unlimited
host so I can compare to the GAE. However, I'm just not clear on how
to get this setup.

He's using midphase and I have cPanel and FTP access to the site.
I've uploaded the contents of my web2py folder into the Public_html/
myfolder.

Going to www.example.com/myfolder
shows an Index of all files in the folder.

I tried adding a .htaccess file with:
Options +ExecCGI
AddHandler fastcgi-script .fcgi
RewriteEngine On
RewriteBase /
RewriteRule ^dispatch\.fcgi/ - [L]
RewriteRule ^(.*)$ dispatch.fcgi/$1 [L]

With that I renamed the fastcgihandler.py to dispatch.fcgi. I've
given 755 permisions to the dispatch.fcgi file as well as
fcgihandler.py. I get an error message saying that dispatch.fcgi
can't be found.

Then I tried using:
SetHandler python-program
PythonHandler web2py_modpython
##PythonDebug On

This time I set the web2py_modpython.py to 755 as well as
wsgihandler.py. Now I get a 500 Internal Server error.

Midphase support says they support both FastCGI and WSGI. Where do I
go from here? What information do I need to ask for to get this
setup? I had this same copy of web2py running via WSGI + Apache
following the instructions on in the book, but it's really lacking in
information if you can't setup the Apache config file and have to
use .htaccess with WSGI or FastCGI.

Thanks!

Chris S

unread,
Oct 2, 2009, 9:58:57 AM10/2/09
to web2py-users
Just wanted to update here for anyone else that tries to implement on
Midphase hosting.

1 - The RewriteBase for me needed to be:
RewriteBase /home/<username>/public_html/<installfolder>

That changed from 'file not found' to 'bad request'

2 - I contacted customer support and it seems python isn't installed
but it is supported. I put in a ticket to have python installed on
our host, and hopefully if the customer service rep was right I'll be
updating you with more info once that's done.

DenesL

unread,
Oct 2, 2009, 10:17:47 AM10/2/09
to web2py-users
Hi Chris,

Interesting... are you using shared hosting or dedicated?

Chris S

unread,
Oct 2, 2009, 11:13:42 AM10/2/09
to web2py-users
This is on a shared host.

Álvaro Justen [Turicas]

unread,
Oct 4, 2009, 11:18:46 PM10/4/09
to web...@googlegroups.com
On Fri, Oct 2, 2009 at 10:58, Chris S <sander...@gmail.com> wrote:
>
> Just wanted to update here for anyone else that tries to implement on
> Midphase hosting.
>
> 1 - The RewriteBase for me needed to be:
> RewriteBase /home/<username>/public_html/<installfolder>

You should not use a "public" (Web-acessible) directory to install
web2py. It is more safe to have web2py files in a non-public
directory.
Using WSGI is preferable than CGI/FastCGI.
--
Álvaro Justen
Peta5 - Telecomunicações e Software Livre
21 3021-6001 / 9898-0141
http://www.peta5.com.br/

Chris S

unread,
Oct 5, 2009, 9:15:53 AM10/5/09
to web2py-users
I heard back from tech support. Python is 'supported' on midphase but
they still have version 2.4 installed with no ETA on any upgrades. I
think that means I can't use them as a host am I correct?

When you say not to use a public folder, what would I need to do to
avoid that. If I put the web2py files in a non-public folder where do
I put .htacecss and the WSGI or FastCGI handlers? Do I just leave
them in the current public folder and point them somehow to the non-
public folder with the RewriteBase command in .htaccess?

On Oct 4, 10:18 pm, Álvaro Justen [Turicas] <alvarojus...@gmail.com>
wrote:
> On Fri, Oct 2, 2009 at 10:58, Chris S <sanders.ch...@gmail.com> wrote:
>
> > Just wanted to update here for anyone else that tries to implement on
> >Midphasehosting.
>
> > 1 - The RewriteBase for me needed to be:
> > RewriteBase /home/<username>/public_html/<installfolder>
>
> You should not use a "public" (Web-acessible) directory to install
> web2py. It is more safe to have web2py files in a non-public
> directory.
> Using WSGI is preferable than CGI/FastCGI.
>
>
>
> > That changed from 'file not found' to 'bad request'
>
> > 2 - I contacted customer support and it seems python isn't installed
> > but it is supported.  I put in a ticket to have python installed on
> > our host, and hopefully if the customer service rep was right I'll be
> > updating you with more info once that's done.
>
> > On Oct 1, 10:26 am, Chris S <sanders.ch...@gmail.com> wrote:
> >> I've got a friend that's letting me try out web2py on his unlimited
> >> host so I can compare to the GAE.  However, I'm just not clear on how
> >> to get this setup.
>
> >> He's usingmidphaseand I have cPanel and FTP access to the site.
> >> I've uploaded the contents of my web2py folder into the Public_html/
> >> myfolder.
>
> >> Going towww.example.com/myfolder
> >> shows an Index of all files in the folder.
>
> >> I tried adding a .htaccess file with:
> >> Options +ExecCGI
> >> AddHandler fastcgi-script .fcgi
> >> RewriteEngine On
> >> RewriteBase /
> >> RewriteRule ^dispatch\.fcgi/ - [L]
> >> RewriteRule ^(.*)$ dispatch.fcgi/$1 [L]
>
> >> With that I renamed the fastcgihandler.py to dispatch.fcgi.  I've
> >> given 755 permisions to the dispatch.fcgi file as well as
> >> fcgihandler.py.  I get an error message saying that dispatch.fcgi
> >> can't be found.
>
> >> Then I tried using:
> >> SetHandler python-program
> >> PythonHandler web2py_modpython
> >> ##PythonDebug On
>
> >> This time I set the web2py_modpython.py to 755 as well as
> >> wsgihandler.py.  Now I get a 500 Internal Server error.
>
> >>Midphasesupport says they support both FastCGI and WSGI.  Where do I

Álvaro Justen [Turicas]

unread,
Oct 5, 2009, 11:03:25 AM10/5/09
to web...@googlegroups.com
On Mon, Oct 5, 2009 at 10:15, Chris S <sander...@gmail.com> wrote:
>
> I heard back from tech support.  Python is 'supported' on midphase but
> they still have version 2.4 installed with no ETA on any upgrades.  I
> think that means I can't use them as a host am I correct?

Well, so your hosting company doesn't matter to have up-to-date
software? web2py runs on python 2.4 but I think the better option is
to change your hosting company since others provide a lot of features
(including updated versions of python) and don't cost so much. Search
in this list for hosting companies.

> When you say not to use a public folder, what would I need to do to
> avoid that.  If I put the web2py files in a non-public folder where do
> I put .htacecss and the WSGI or FastCGI handlers?  Do I just leave
> them in the current public folder and point them somehow to the non-
> public folder with the RewriteBase command in .htaccess?

Yes, I think it'll work.

Chris S

unread,
Oct 5, 2009, 5:39:33 PM10/5/09
to web2py-users
Is there any information I should be aware of when trying to run
web2py on Python 2.4? I do agree I wouldn't choose this host, but
this is a FREE opportunity for me to check out web2py on a friends
paid for account. I'm using this to compare/contrast a host with GAE
before I start paying hosting fees myself so swapping isn't an option
though I would look for a different host if I decide I prefer the non-
google option.



On Oct 5, 10:03 am, Álvaro Justen [Turicas] <alvarojus...@gmail.com>
wrote:

mdipierro

unread,
Oct 5, 2009, 6:50:28 PM10/5/09
to web2py-users
You may need this:
http://www.web2py.com/AlterEgo/default/show/219

You may also have problems with appliances that use 2.5 syntax but
nothing that you cannot find a way around to. The source of web2py is
2.4 compliant.

Massimo

Chris S

unread,
Oct 9, 2009, 9:27:58 AM10/9/09
to web2py-users
I just wanted to throw out another update since I've received e-mails
from others who are/were interested in using web2py on Midphase. I
received an e-mail from one of the sales reps at Midphase asking what
they would need to change for Midphase to be considered a good option
for web2py hosting.

I said:
Python 2.5 or 2.6 support
FastCGI/WSGI help files
Best case, web2py FastCGI/WSGI instructions

I'll post here again if something changes. I'll be honest I haven't
even messed with the Python 2.4 support any further. After finding
basically no WSGI/FsatCGI help on the midphase site and being told the
wrong answers from the live tech support I've just been using GAE for
now. Hopefully this really does change I'd love to try out web2py on
a host with a SQL database as I think I'll like it a lot better than
GAE.

DenesL

unread,
Oct 9, 2009, 10:02:48 AM10/9/09
to web2py-users

On Oct 9, 9:27 am, Chris S <sanders.ch...@gmail.com> wrote:
> I just wanted to throw out another update since I've received e-mails
> from others who are/were interested in using web2py on Midphase. I
> received an e-mail from one of the sales reps at Midphase asking what
> they would need to change for Midphase to be considered a good option
> for web2py hosting.
>
> I said:
> Python 2.5 or 2.6 support
> FastCGI/WSGI help files
> Best case, web2py FastCGI/WSGI instructions
>
> I'll post here again if something changes. I'll be honest I haven't
> even messed with the Python 2.4 support any further. After finding
> basically no WSGI/FsatCGI help on the midphase site and being told the
> wrong answers from the live tech support I've just been using GAE for
> now. Hopefully this really does change I'd love to try out web2py on
> a host with a SQL database as I think I'll like it a lot better than
> GAE.

I had a similarly bad experience with their tech "support" when I
approached them about python a while ago. Maybe now that their sales
end of business is involved things will change, otherwise its their
loss as hosting will be done somewhere else.
Thanks and keep us posted.

Reply all
Reply to author
Forward
0 new messages