Cache directory "/home/.quiterie/timc3/blog.timc3.com/wp-content/headlines" is not writable.

hellahella on Apache 2

I have been using hellahella using paster serve and I must say the performance was terrible. I don’t think that it is mean’t to be run for any length of time which is at odds with hellahella, the web interface to hellanzb, which is.

I have documented before that I am using hellanzb to manage my nzb files, and hellahella makes it even easier and with integration with http://www.newzbin.com it is even better (how about one click downloads, unrar, par, and ready to view – yes I have it!)

So I wanted to run hellahella using Apache2 on my Debian box. Luckly just as I wanted to do this a new FAQ was put up on the Pylons web site on how to achieve this using mod_python (which I also wanted to use). Pylons is a web framework for python and it seems quite good too and I got alot of help from the very helpful pylons-discuss group on groups.google.com.
So I setup Apache2 or rather Debian did using apt-get, and I got a fairly normal install. If you haven’t used version2 of apache before the configuration has changed somewhat and all the config files are now split. At the same time I also installed mod_python using apt-get and as this is rather well documented I am not going to write it down here. Now all we need do is follow the first part of the instructions on the Pylons site:

  1. Install hellahella (I assume you are running hellanzb already otherwise go and download and install it) and make sure it works with paster serve hella.ini
  2. Make sure mod_python is installed and enabled.
  3. Save the http://projects.amor.org/misc/svn/modpython_gateway.py script as wsgi.py in your mod_python python directory which is /usr/lib/python2.3/site-packages/mod_python/ on my system.
  4. Create a project directory. I used /www/hellahella
  5. Create startup.py file in this directory with the following information:from paste.deploy import loadapp
    app = loadapp(“config:/www/hellahella/hella.ini”)
  6. Create a link to your hella.ini file: ln -s /etc/hella.ini hella.ini
  7. Go into your apache2 sites directory: cd /etc/apache2/sites-available/
  8. Create a new site: vi hellahellaSite
  9. And input the following information:

    VirtualHost 127.0.0.1
    ServerAdmin tim@timc3.com
    DocumentRoot /www/hellahella/
    SetHandler mod_python
    PythonHandler mod_python.wsgi
    PythonPath "['/www/hellahella/'] + sys.path"
    PythonOption wsgi.application startup::app
    PythonOption SCRIPT_NAME /
    ErrorLog /var/log/apache2/error.log
    Alias /stylesheets/ "/www/hellahellaMedia/stylesheets/"
    Alias /javascripts/ "/www/hellahellaMedia/javascripts/"
    Alias /images/ "/www/hellahellaMedia/images/"
    LogLevel warn
    CustomLog /var/log/apache2/access.log combined
    /VirtualHost
  10. Remember to change the ipaddress 127.0.0.1 to whatever ipaddress or domain name you need.
  11. The to a level above your doc root: cd /www
  12. Then create a link from the public media files for hellahella to a directory here: ln -s /usr/lib/python2.3/site-packages/hellahella-0.1dev_r782-py2.3.egg/hellahella/public
  13. Rename public: mv public hellahellaMedia
  14. You might need to chgrp and chown the files under this directory.
  15. Then enable this site: a2ensite hellahellaSite
  16. Restart apache2: /etc/init.d/apache2 stop; /etc/init.d/apache2 start
  17. Then test.
  18. And it should work aslong as hellanzb.py is running and hellahella is setup correctly.

And I must say it is looking good!


19 Responses to “hellahella on Apache 2”

  1. Nicholas Says:

    Cool!

    I think i noticed one error though: “Install the http://projects.amor.org/misc/svn/modpython_gateway.py script as wscgi.py”. You probably mean saving it as ‘wsgi.py’

  2. timc3 Says:

    Great, thanks for that! I have amended the instructions.

  3. WoodsDog Says:

    K..I am trying to do this. I do not claim to be an expert at apache2, but I have gone through and setup everything as you had suggested. I am not getting this to work. Let me as a few questions:

    -in step 10 you suggest changing the IP address. Where is this IP that I am supposed to change?

    -in step 17 it says to “test” Does this just come up on the port that is specified in the hella.ini? Mine isn’t coming up. if it’s not supposed to come up on this port, is there a path I need to go to to get to hellahella?

    Thanks…Woody

  4. timc3 Says:

    In step 10 I was presuming that I had entered the ipaddress in the document, but it scripted out the tags that I wanted to put in. I was putting the VirtualHost statement in with an ip address of 127.0.0.1. I will try and sort out my text entry so it doesn’t think that I am trying to put in HTML tags!

    As for step 17, it will come up on Port80 or whatever port you have setup Apache to run on.

  5. Liam Says:

    Hi, I followed the steps you have, have the virtualhost and everything setup, however, it seems to fail on reading the stylesheets and such and therefore I don’t get the functionality that I should, did you have a similar issue and if so what did you do to correct it?

  6. Dingir Xul Says:

    I do not have a ’sites-available’ directory. Nor do I have a command called ‘a2enable’. Just a streight apache2 install. Its up and running with the modules correctly installed. Where are you getting this dir and utility from?

  7. timc3 Says:

    Hi there,

    Basically I have a ’split’ install with all the config options in different files. You probably have a standard Apache2 installation with most of the configuration in the httpd.conf file.

    Its actually reasonably the same, you have to put in the configuration options into Apache2 httpd.conf like you would do for any host/virtualhost, enable mod_pythoon (you might have to download and install it) and then restart Apache2.

  8. Pie Says:

    Hi,
    Great “How-To” thanks for that…

    I have completed your instructions and *think* it is actually working… however when I browse to the hellahella server I am redirect to http://login... which is then auto searched for and I end up at https://login.postini.com/.

    Have you seen anything like this or can you point me where I may be going wrong?

    From what I recall if you launch the server using paster you are directed to a login page(?).

    Pie

  9. timc3 Says:

    Thats an interesting problem that I haven’t seen before. How about pasting up your apache file so that I can have a look at the configuration.

    It sounds like apache is redirecting you to that for some reason, and its probably the url isn’t correct, because it should be http://123.123.123.123/login where 123.123.123.123 is your IP address.

  10. Pie Says:

    This is my hellahellasite file:
    NameVirtualHost *:80

    ServerName hella.piesweb.co.uk
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/hellahella/
    SetHandler mod_python
    PythonHandler mod_python.wsgi
    PythonPath “['/var/www/hellahella/'] + sys.path”
    PythonOption wsgi.application startup::app
    PythonOption SCRIPT_NAME /
    ErrorLog /var/log/apache2/error.log
    Alias /stylesheets/ “/var/www/hellahellaMedia/stylesheets/”
    Alias /javascripts/ “/var/www/hellahellaMedia/javascripts/”
    Alias /images/ “/var/www/hellahellaMedia/images/”
    LogLevel warn
    CustomLog /var/log/apache2/access.log combined

    startup.py:
    from paste.deploy import loadapp
    app = loadapp(“config:/var/www/hellahella/hella.ini”)

    Any thoughts? :)

    Pie

  11. Pie Says:

    The VirtualHost tags are there in the blanks ;)
    VirtualHost *:80

    Pie

  12. smbh Says:

    Has anyone done it on OS X (10.4+) ? I am trying to get it working, no luck so far, error log throws up a huge amount of info.

  13. smbh Says:

    Ok, got it working with “PythonOption SCRIPT_NAME /login” , however now I have the same problems Liam described – the stylesheet etc are not loading. Maybe a permission issue?

  14. excentral » Fedora n Mythtv n Hellanzb oh my! Says:

    [...] Getting the rest of my required stack (Hellanzb, Hellahella, etc.) was a snap. There’s no packages for the Hella* stuff, but most of the deps are in extras so installing was a snap. I ended up getting MythWeb installed as part of the ‘Mythtv-Suite’ metapackage so I attempted to run Hellahella behind an apache proxy. Failure was complete there due to hardcoded paths. A bit of Googling later and I found some very helpful instructions on setting it up via mod_python. Those instructions assume you are running apache for Hellahella exclusively (or as a NameVirtualHost). I’m not, so here’s my config: <location /hella> SetHandler mod_python PythonHandler mod_python.wsgi PythonPath “['/var/www/hellahella/'] + sys.path” PythonOption wsgi.application startup::app PythonOption SCRIPT_NAME /hella </Location> Alias /stylesheets/ “/var/www/hellahellaMedia/stylesheets/” Alias /javascripts/ “/var/www/hellahellaMedia/javascripts/” Alias /images/ “/var/www/hellahellaMedia/images/” Fedora, Hellahella, Hellanzb, Linux, MythTV Comments: [...]

  15. Bram Says:

    Pie and Liams problem can be solved by changing the PythonOption to “” instead of /. Took me ages before i figured this..

    PythonOption SCRIPT_NAME “”

  16. Bram Says:

    ok, the cache was fooling me, above solution doesnt fix it. hellaPHP has similar functionality so i went for that: http://zeus.dogtoe.com/projects/hellaphp/

  17. orbisvicis Says:

    can you write a guide for hellahella using mod_wsgi ?

  18. timc3 Says:

    I am not using hellahella very much at the moment, but I think that if you look for a guide to using Pylons with mod_wsgi then it should be pretty much the same.

  19. orbisvicis Says:

    I did end up figuring it out, but it was really ambiguous: sometimes in config files its hard to tell the difference between files and folders.

    Unfortunately I’m not using usenet much anymore these sad days

    But come again, deluge + pylons

Leave a Reply