You are not logged in.

#1 2008-12-27 10:11:32

fuzzyman
Member
From: UK
Registered: 2008-12-27
Posts: 10
Website

Zine

Zine is a new Python based blogging platform. Anyone using it with Webfaction yet?

If so I'd love some advice on deployment options.

Michael

Offline

 

#2 2008-12-27 12:12:35

seanf
Administrator
Registered: 2008-02-01
Posts: 1899
Website

Re: Zine

Hi Michael,

As far as I can tell, you're the first user to ask about Zine.

I just set up a Zine blog under mod_wsgi without too much difficulty. Here's what I did:

1. Create a new MySQL database and make a note of the database name and password.

2. Create a new mod_wsgi app in the control panel, named for example 'myapp'.

3. Install Zine's Python dependencies with the following command:

Code:

PYTHONPATH=/home/username/webapps/myapp/lib/python2.5 easy_install-2.5 --install-dir=/home/username/webapps/myapp/lib/python2.5 --script-dir=/home/username/webapps/myapp/bin Werkzeug Jinja2 SQLAlchemy simplejson pytz Babel lxml==1.3.6

4. Download, build, and install Zine:

Code:

cd ~
wget http://zine.pocoo.org/releases/Zine-0.1.tar.gz
tar zxf Zine-0.1.tar.gz
cd ~/Zine-0.1
./configure --prefix=/home/username/webapps/myapp --python=/usr/local/bin/python2.5 && make install

5. Set up a blog directory:

Code:

mkdir ~/webapps/myapp/blog
cp ~/webapps/myapp/share/zine/servers/zine.wsgi ~/webapps/myapp/blog/

6. Edit zine.wsgi to point it at the proper directory by changing the INSTANCE_FOLDER variable:

Code:

INSTANCE_FOLDER = '/home/username/webapps/myapp/blog'

7. Configure Apache to serve the blog by adding the following to myapp's httpd.conf:

Code:

WSGIScriptAlias /blog /home/username/webapps/myapp/blog/zine.wsgi

8. Restart Apache

9. Go to the control panel and set up your mod_wsgi app on website record, wait a few minutes, then go to whateverdomain.com/blog and follow the Zine installation wizard. You'll need the database info from step one to set up the connection string.

Have fun! smile

Offline

 

#3 2008-12-27 12:15:38

fuzzyman
Member
From: UK
Registered: 2008-12-27
Posts: 10
Website

Re: Zine

Thanks Sean I'll give it a try.

Offline

 

#4 2008-12-27 13:34:42

fuzzyman
Member
From: UK
Registered: 2008-12-27
Posts: 10
Website

Re: Zine

It works! Thanks for such a detailed response. Looks nice too: http://www.python3000.com/blog

Michael

Offline

 

#5 2008-12-27 13:46:24

seanf
Administrator
Registered: 2008-02-01
Posts: 1899
Website

Re: Zine

Nice! Glad it worked out for you smile

Offline

 

#6 2008-12-27 15:11:19

fuzzyman
Member
From: UK
Registered: 2008-12-27
Posts: 10
Website

Re: Zine

For the record I've moved the blog to: http://www.ironpythoninaction.com/news/

Getting the HTML parser to work also required me to install html5lib.

Offline

 

#7 2008-12-30 05:59:10

fuzzyman
Member
From: UK
Registered: 2008-12-27
Posts: 10
Website

Re: Zine

Note that to use the latest release (0.1.1), and probably similar changes for future releases, all that is needed is to modify the instructions to:

Code:

wget http://zine.pocoo.org/releases/Zine-0.1.1.tar.gz
tar zxf Zine-0.1.1.tar.gz
cd ~/Zine-0.1.1
./configure --prefix=/home/username/webapps/myapp --python=/usr/local/bin/python2.5 && make install

The same steps will also upgrade an existing install to the newer version.

Michael Foord

Last edited by fuzzyman (2008-12-30 05:59:45)

Offline

 

#8 2008-12-30 09:54:12

seanf
Administrator
Registered: 2008-02-01
Posts: 1899
Website

Re: Zine

Makes sense smile

So, since you've been using Zine for a few days, any initial thoughts?

Offline

 

#9 2008-12-30 14:00:07

oubipaws
Member
Registered: 2008-12-20
Posts: 6

Re: Zine

Looks pretty simple to setup, I might have to try this out on my development server at home tonight.

Offline

 

#10 2008-12-30 15:50:48

fuzzyman
Member
From: UK
Registered: 2008-12-27
Posts: 10
Website

Re: Zine

I really like it. It is very slick and although there is still a lot to do, what is there works very well (the admin interface is very impressive).

Once they add support for a WYSIWYG editor and a few other niceties then I will switch my main blog over to it. Currently it is basically HTML for adding new entries, but it is fine for the news blog I'm using it for. It is by the same folk who maintain projects like Sphinx, Pygments and so on - so I trust the code quality.

Once I've finished IronPython in Action I hope to be able to contribute some plugins.

Michael

Offline

 

#11 2009-01-05 13:27:13

allanw
Member
Registered: 2009-01-05
Posts: 4

Re: Zine

When I run the command to install Zine's Python dependencies I get an error saying:

error: Setup script exited with error: command 'gcc' failed with exit status 1

I think the install of lxml is failing. Any help would be appreciated.

Offline

 

#12 2009-01-06 10:07:28

seanf
Administrator
Registered: 2008-02-01
Posts: 1899
Website

Re: Zine

allanw wrote:

When I run the command to install Zine's Python dependencies I get an error saying:

error: Setup script exited with error: command 'gcc' failed with exit status 1

I think the install of lxml is failing. Any help would be appreciated.

What's the exact command you're running? What's the complete output?

Offline

 

#13 2009-01-07 04:04:39

allanw
Member
Registered: 2009-01-05
Posts: 4

Re: Zine

The command I'm running is shown below. I have created a mod_wsgi app called 'zineapp'.

PYTHONPATH=/home/allanw/webapps/zineapp/lib/python2.5 easy_install-2.5 --install-dir=/home/allanw/webapps/zineapp/lib/python2.5 --script-dir=/home/allanw/webapps/zineapp/bin Werkzeug Jinja2 SQLAlchemy simplejson pytz Babel lxml==1.3.6

The output I get is very long. I've pasted the relevant bit here: http://dpaste.com/106324/

Offline

 

#14 2009-01-07 17:37:30

seanf
Administrator
Registered: 2008-02-01
Posts: 1899
Website

Re: Zine

Allan - your server was missing the libxml2-devel and libxslt-devel packages. I've installed them, so you should be able to install the dependencies now. Also, since you're on a newer server, you can use the latest version of lxml, so the command would be:

Code:

PYTHONPATH=/home/allanw/webapps/zineapp/lib/python2.5 easy_install-2.5 --install-dir=/home/allanw/webapps/zineapp/lib/python2.5 --script-dir=/home/allanw/webapps/zineapp/bin Werkzeug Jinja2 SQLAlchemy simplejson pytz Babel lxml

Hope that helps!

Regards,

Sean F
--
WebFaction - Agile hosting for everyone
http://webfaction.com - http://twitter.com/webfaction

Offline

 

#15 2009-01-10 17:34:03

fuzzyman
Member
From: UK
Registered: 2008-12-27
Posts: 10
Website

Re: Zine

Just upgraded to 0.1.2 without problems by the way. :-)

Offline

 

#16 2009-01-12 16:24:56

allanw
Member
Registered: 2009-01-05
Posts: 4

Re: Zine

Thanks Sean, that fixed the problem. However, I have another issue. In the websites section of the control panel, I have the following set up:

- Application called 'django' (default application installed when I created my account) mapped to the URL '/'
- My Zine application ('zineapp') mapped to '/blog'

When I go to www.allanwhatmough.com/blog I see a page but the output is unstyled (as if it can't find the CSS). And going to blog/admin gives me a 404 error. Does anybody have any idea what I might have done wroing here? Thanks

Last edited by allanw (2009-01-12 16:26:10)

Offline

 

#17 2009-01-12 16:29:56

fuzzyman
Member
From: UK
Registered: 2008-12-27
Posts: 10
Website

Re: Zine

Hmmm... it sounds to me like you have a mismatch between where the app is mapped to (/) and where the blog thinks it should be being served.

I have my zine app mapped to '/news/' but in the blog admin I have the following options set:

Blog URL prefix: (empty)
Admin URL prefix: /admin

etc...

HTH

Michael

Offline

 

#18 2009-01-12 16:37:22

allanw
Member
Registered: 2009-01-05
Posts: 4

Re: Zine

I changed it so that '/' pointed to my Zine application. I can now go to www.allanwhatmough.com/blog and it works. However, going to www.allanwhatmough.com gives me a mod_wsgi welcome message. Clearly, this isn't desirable, so it might only be a temporary solution.

Offline

 

#19 2009-01-12 16:40:16

fuzzyman
Member
From: UK
Registered: 2008-12-27
Posts: 10
Website

Re: Zine

This is why I mounted my app on the sub-url. I mounted a static site at the top level to serve content for the rest of the site (even if you just want a front page). If you really want the blog at /blog/ this is probably what you will need to do.

You could just serve the blog from the root level though.

Offline

 

#20 2009-02-01 06:13:02

Nergal
Member
Registered: 2009-02-01
Posts: 6

Re: Zine

My first try to setup Zine here resulted in the mod_wsgi-welcome page served out of the htdocs/index.py. I could not make out what was wrong. So I tried again and made a protocol.
what I kept from the previous try:
subdomain: hattusa.urigal.net
the mysql db
Here is what I did (my server is web 16):
creating new app: hattusa as mod_wsgi 2.0/Python 2.5
Preparing the dependencies according to the manual above with addition of html5lib for the version 0.1.2 of zine according to their installation manual
PYTHONPATH=/home/nergal/webapps/hattusa/lib/python2.5 easy_install-2.5 --install-dir=/home/nergal/webapps/hattusa/lib/python2.5 --script-dir=/home/nergal/webapps/hattusa/bin Werkzeug Jinja2 SQLAlchemy simplejson pytz Babel lxml==1.3.6

For Werkzeug I only got warnings concerning 'THANKS' and 'TODO'
For Jinja2:
warning: no files found matching 'Makefile'
warning: no files found matching 'ez_setup.py'
warning: no previously-included files matching '*' found under directory 'docs/_build/doctrees'
For lxml-1.3.6:
warning: no previously-included files found matching 'doc/pyrex.txt'
warning: no previously-included files found matching 'src/lxml/etree.pxi'
The manual of zine states: lxml* [2.0 or higher]
installing lxml without defining 1.3.6 did not work (it tried to get lxml-2.2beta2 and exited "command 'gcc' failed with exit status 1")
I added html5lib without any hassle, this also is according to the zine-manual
---
zine itself:
wget http://zine.pocoo.org/releases/Zine-0.1.2.tar.gz
tar zxf Zine-0.1.2.tar.gz 
cd Zine-0.1.2
./configure --prefix=/home/nergal/webapps/hattusa --python=/usr/local/bin/python2.5 && make install
mkdir ~/webapps/hattusa/blog
cp ~/webapps/hattusa/share/zine/servers/zine.wsgi ~/webapps/hattusa/blog/
cd ~/webapps/hattusa/blog/
nano zine.wsgi
Altered to INSTANCE_FOLDER = '/home/nergal/webapps/hattusa/blog'
cd ../apache2/conf/
nano httpd.conf
Added at the end: WSGIScriptAlias /blog /home/nergal/webapps/hattusa/blog/zine.wsgi
cd ../bin/
---
Now I created a new Website in the WebfactioPanel:
named: hattusa
Subdomains: hattusa.urigal.net
mapped to: '/blog'
---
back in the shell I restarted Apache:
sh restart
---
waited a few minutes ...
And again http://hattusa.urigal.net/blog shows only the welcome message.
The error_log of the Apache2 after the restart:
[Sun Feb 01 05:53:39 2009] [warn] mod_wsgi: Compiled for Python/2.5.
[Sun Feb 01 05:53:39 2009] [warn] mod_wsgi: Runtime using Python/2.5.1.
[Sun Feb 01 05:53:39 2009] [warn] mod_wsgi: Python module path '/home/nergal/webapps/hattusa/lib/python2.5:/usr/local/lib/python25.zip:/usr/local/lib/python2.5/:/usr/local/lib/python2.5/plat-linux2:/usr/local/lib/python2.5/lib-tk:/usr/local/lib/python2.5/lib-dynload'.
[Sun Feb 01 05:53:39 2009] [notice] Apache/2.0.52 (Red Hat) mod_wsgi/2.0 Python/2.5.1 configured -- resuming normal operations
[Sun Feb 01 05:53:40 2009] [error] server reached MaxClients setting, consider raising the MaxClients setting
---
So I altered httpd.conf: ServerLimit 5 #instead of 2, restarted it.
The same part after the restart as above except the MaxClients error.
But no Zine shows up. What am I doing wrong? I'm at the end of my wits.
Thanks for any suggestions.

Last edited by Nergal (2009-02-01 06:16:11)

Offline

 

#21 2009-02-01 08:53:44

seanf
Administrator
Registered: 2008-02-01
Posts: 1899
Website

Re: Zine

If you're using '/blog' as the URL path in the control panel, then change WSGIScriptAlias in httpd.conf to:

Code:

WSGIScriptAlias / /home/nergal/webapps/hattusa/blog/zine.wsgi

What's happening there is that the front-end Apache server is serving the root of your app on '/blog', so if you have /blog as the path for WSGIScriptAlias then the URL would be http://hattusa.urigal.net/blog/blog.

Offline

 

#22 2009-02-01 11:50:48

Nergal
Member
Registered: 2009-02-01
Posts: 6

Re: Zine

Thanks for the quick reply Sean.

I of course wanted to check out: http://hattusa.urigal.net/blog/blog ... it was not zine but the Internal ServerError from below.

I did as you wrote - the effect was even worse:
http://hattusa.urigal.net/blog -> Internal Server Error
http://hattusa.urigal.net -> Not application mounted at the root of this domain (well, the only working part it seems wink )

I tried to understand wether there was something funny in my installation. So I thought about setting up a temporary test-server via the Zine script:
[nergal@web16 hattusa]$ PYTHONPATH=/home/nergal/webapps/hattusa/lib/python2.5 ./share/zine/scripts/server -I blog
Traceback (most recent call last):
  File "./share/zine/scripts/server", line 15, in ?
    from werkzeug import run_simple, Response, DispatcherMiddleware
ImportError: cannot import name Response

Maybe it has nothing to do with the other problem, but I hope it gives you a hint ...

Thanks smile




Oh and an additional question (if I ever will see it running*g*): I have a testing version with the 'built-in' server running at home with an sqlite3-db. Will that work, as well? I read webfaction has sqlite-support, though not via panel.

Offline

 

#23 2009-02-01 12:33:23

seanf
Administrator
Registered: 2008-02-01
Posts: 1899
Website

Re: Zine

I noticed when I tested this earlier, I had to install flup.

Your Apache error log shows:

Code:

[Sun Feb 01 11:36:07 2009] [error] [client 127.0.0.1] ImportError: No module named flup.server.fcgi

So, that explains the internal server error.

I've just SSHd into your server and I've installed flup for you:

Code:

PYTHONPATH=/home/nergal/webapps/hattusa/lib/python2.5 easy_install-2.5 --install-dir=/home/nergal/webapps/hattusa/lib/python2.5 --script-dir=/home/nergal/webapps/hattusa/bin flup

And now http://hattusa.urigal.net/blog is working smile

Offline

 

#24 2009-02-01 13:09:18

Nergal
Member
Registered: 2009-02-01
Posts: 6

Re: Zine

Awww! Thank you so much!

That's sooo cool!

Offline

 

#25 2009-02-02 15:05:47

Nergal
Member
Registered: 2009-02-01
Posts: 6

Re: Zine

For those who might like to use an sqlite3 database with Zine:

I placed my database named 'blog.db' in the folder /home/nergal/webapps/hattusa/blog/
And in the setup-wizard enter: sqlite:///home/nergal/webapps/hattusa/blog/blog.db

That's it smile

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson