FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


[Server 4] Mod_python





Cheeldash
Is mod_python working on server 4? I can't get it to work, i've done as said in the forums, and tried both mod_ptyhon and cgi, but nothing worked.
And the error log shows no errors.
Bondings
No, it wasn't working anymore, it seems. Anyway, I added it again now. Please try again, I hope it works now.
Bondings
I tested it and it seems to work. You do need some .htaccess directives in the same directory as your python files. It depends on what you need, I guess.

http://modpython.frihost.org/

Code:
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonOption session DbmSession
PythonOption session_dbm /home/user/domains/test.com/session.dbm
PythonOption ApplicationPath /
PythonDebug On ## Turn this off when done with debugging

DirectoryIndex index.py


Code:
## index.py
from mod_python import apache

def index(req):
    req.content_type = 'text/plain'
    req.write('Hello from mod_python\n')
    return apache.OK


(code from DirectAdmin forums, here: http://www.directadmin.com/forum/showthread.php?t=14933 )
Cheeldash
It's working now, thanks.
I found that there is no MySQLdb module, can you install it or there is another way to use mysql with python?
Bondings
I installed it. Please test it and report whether or not it works. (and if it doesn't, which errors you got)
Cheeldash
It returns an error when i import MySQLdb

Code:

ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

  [Errno 13] Permission denied: '/var/www/.python-eggs'

The Python egg cache directory is currently set to:

  /var/www/.python-eggs

Perhaps your account does not have write access to this directory?  You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.


Bondings
I changed the egg cache to the tmp directory, could you please try if it works now?

By the way, my apologies for all the problems but most users use php here.
Cheeldash
Bondings wrote:
I changed the egg cache to the tmp directory, could you please try if it works now?

By the way, my apologies for all the problems but most users use php here.

The support is fantastic, you don't need to apologize.
I'm getting the same errror as before
Code:

 [Errno 13] Permission denied: '/var/www/.python-eggs'

The Python egg cache directory is currently set to:

  /var/www/.python-eggs

Bondings
Ok, I did 2 things at once. Not great for testing what works, but maybe this will get a solution faster.

Anyway, I set the path for the eggs to the tmp directory inside httpd.conf, maybe that should work.

Secondly, I unzipped the egg, so normally it doesn't need to unzip it anymore and hence this error shouldn't occur - I hope.

Please try it out. Very Happy
Cheeldash
Now it's working, thanks.
Cheeldash
I'm having again the same problem with the egg cache, probably you forget to set it after the server failure in january.
Bondings
Could you try again now?

And if you still get an error, what is it and on which page (so I can test if it works while I try out different things)?
Cheeldash
I'm getting error no 13 again.
You can use http://www.odmed.frihost.org/menu.py/Menu
The error occurs when the file imports mysqldb and python pages that do not use it infact are working.
Bondings
What about now? I unzipped the MySQL egg, however to change the python_egg_cache to the tmp directory doesn't want to work.

By the way, the url didn't work, but I tried to login and got the error. I changed some stuff and it gives a different error which I'm hoping is in your script.
Cheeldash
Thats my fault. The url is wrong and the login won't work until i run the starting script.
Anyway now mysqldb is working so the problem is solved.
alamier
Hi. Maybe it's not the right place to ask for it, but it's a place where I see some successful activity with python on server 4, so let me apologise in forehand and let me beg to move this post to the proper area, while I learn the structure of the forum as well.

My request is as simple as: I intend (why, Lord, if blogger was so darn easy and looked so darn good?) to install and use TiddlyWeb http://tiddlyweb.com/, which is build upon Python.

I have managed to install python locally on a Xampp-packaged apache 2.2. so far, using mod_wsgi, just to learn a bit about the implementation and about TiddlyWeb itself, as my sole experience is on TiddlyWiki.

Now I've got granted a hosting account on server 4, but I'm not familiar with the control panel and the options there. I'm a bit lost about what is needed, what is not and I am still afraid to break something.

Would it be possible to get a step-by-step, clumsy-proof guide on "Getting Python to work on server 4?

Eternally thankful.
Bondings
alamier wrote:
Hi. Maybe it's not the right place to ask for it, but it's a place where I see some successful activity with python on server 4, so let me apologise in forehand and let me beg to move this post to the proper area, while I learn the structure of the forum as well.

My request is as simple as: I intend (why, Lord, if blogger was so darn easy and looked so darn good?) to install and use TiddlyWeb http://tiddlyweb.com/, which is build upon Python.

I have managed to install python locally on a Xampp-packaged apache 2.2. so far, using mod_wsgi, just to learn a bit about the implementation and about TiddlyWeb itself, as my sole experience is on TiddlyWiki.

Now I've got granted a hosting account on server 4, but I'm not familiar with the control panel and the options there. I'm a bit lost about what is needed, what is not and I am still afraid to break something.

Would it be possible to get a step-by-step, clumsy-proof guide on "Getting Python to work on server 4?

Eternally thankful.

The problem is that it seems that TiddlyWeb was rather created for running it on a local machine or server that you have and not on a shared hosting account. First of all you need to execute a lot of command line commands (although this can be circumvented) and secondly if you run it as a cgi they claim it will be quite slow since the whole application needs to be compiled every time.

I have tried to install the tiddlywebwiki library as is described here: http://tiddlyweb.peermore.com/wiki/recipes/docs/tiddlers/Installing%20TiddlyWeb . Unfortunately it doesn't even want to install and results in an error (selector package) - the same case for trying to install it with easy_install instead of pip. I tried a lot, but it seems that the python version (2.4) is the problem and CentOS seems to rely on Python 2.4.

You could try to do something like here: http://bengillies.net/.a/recipes/sitecontent/tiddlers/CGI%20and%20TiddlyWeb%201.0 , but it will probably give the same errors and you would need to execute the commands by cron or in a script as shell access is not given by us (way too dangerous for free hosting).

So all by all, I doubt that it will be possible. My apologies.

Maybe try at http://tiddlyspace.com/ or http://hoster.peermore.com/ which are 2 free hosts dedicated to Tiddlyweb (or at least they are on Tiddlyweb's front page).
alamier
Humm.... I managed to install an instance of tiddlywebwiki (another different issue is configuring it with my knowledge).

I already have an account at tiddlyspace, but I wanted to give it a try anyway, you know... vanitas vanitatum...

CGI is not even worth the attempt. I will have to try with CCtiddly, which relies on PhP and MySql -and which seems waaaaay much easier to install and configure than tiddlyweb.

Thank you very much for the clear and QUICKK response.
Yours, paul.
Related topics
Server 4 opened for new accounts
php not on?
mod_python server 4
server 4 - down for at least a week
time on server 4
server 4 down?
server 4 - down
Python - Django Framework in server 4?
SMTP on Server 4?
Mysql Down on Server 4
Hard disk failure for Server 4
Server 4 to be moved to a new server next month
Up and running in server 4
Mod_python not working on server 4
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.