さくらにpybloxsomをインストールする
Blogだけでなく、サイト全般のCMS替わりとして、pybloxsomを導入してみる。
PyBlosxom: http://pyblosxom.sourceforge.net/
果たして使えるものだろうか。
さくらの上ではcgiしか動かないので、インストールもcgiベースで行う。
http://pyblosxom.sourceforge.net/1.4/manual/install_cgi.html
%wget http://jaist.dl.sourceforge.net/sourceforge/pyblosxom/pyblosxom-1.4.2.tar.gz %tar zxvf pyblosxom-1.4.2.tar.gz %cd pyblosxom-1.4.2 %python setup.py install (略) copying build/scripts-2.4/pyblcmd -> /usr/local/bin error: /usr/local/bin/pyblcmd: Permission denied
ダメじゃん。
.pydistutils.cfgが効いてない?
%python setup.py install --home=~ running install running build running build_py running build_scripts running install_lib running install_scripts changing mode of /home/mogeuser/bin/pyblcmd to 755 running install_data creating /usr/local/lib/python2.4/site-packages/Pyblosxom error: could not create '/usr/local/lib/python2.4/site-packages/Pyblosxom': Permission denied
なんで指定してあるのに、/usr/local/lib使いたがるかね。
しょうがないので、続きはマニュアルでやってみたが、何かウロウロするばかりでちっとも進まないので、ベタ置きしてみることに。
%mkdir www/blog %cp pyblosxom-1.4.2.tar.gz www/blog %cd www/blog %tar zxvf pyblosxom-1.4.2.tar.gz %cd pyblosxom-1.4.2 %mv Pyblosxom ../ %mv web/* ../ %cd .. %rm -r pyblosxom-1.4.2 pyblosxom-1.4.2.tar.gz %ls Pyblosxom blog.ini config.py pyblosxom.cgi pyblosxom.tac %mkdir entries cache plugins static log %vi config.py py["blog_title"] = "SAKURA BLOG TEST" py["blog_description"] = "blosxom test of sakura" py["blog_author"] = "mogeuser" py["blog_email"] = "kinneko@gmail.com" py["blog_language"] = "ja" py["blog_encoding"] = "utf-8" py["blog_rights"] = "Copyright 2007 kinneko" #py["blog_icbm"] = '37.448089,-122.159259' py["datadir"] = "/home/mogeuser/www/blog/entries" py["ignore_directories"] = ["Pyblosxom"] py["log_file"] = "/home/mogeuser/www/blog/log/pyblosxom.log" py["log_level"] = "debug" py["base_url"] = "http://mogeuser.sakura.ne.jp/blog" py["parser"] = "plain" py["plugin_dirs"] = ["/home/mogeuser/www/blog/plugins"] py["load_plugins"] = [] #py["cacheDriver"] = "xxxx"あとで #py["cacheConfig"] = ""あとで py["static_dir"] = "/home/mogeuser/www/blog/static" py["static_flavours"] = ["html"] #py["static_urls"] = ["/path/to/url1", "/path/to/url2"]あとで %./pyblosxom.cgi Trying to import the config module.... PyBlosxom version: 1.4.2 8/16/2007 Welcome to PyBlosxom's installation verification system. ------ ]] printing diagnostics [[ pyblosxom: 1.4.2 8/16/2007 sys.version: 2.4.3 (#2, Nov 7 2006, 13:07:47) [GCC 3.4.4 [FreeBSD] 20050518] os.name: posix codebase: --default-- ------ ]] checking config file [[ config has 23 properties set. You're missing optional properties. These are not required, but some of them may interest you. Refer to the documentation for more information. missing optional property: 'blog_icbm' missing optional property: 'renderer' missing optional property: 'cacheDriver' missing optional property: 'cacheConfig' missing optional property: 'flavourdir' missing optional property: 'logdir' These are properties PyBlosxom doesn't know about. They could be used by plugins or could be ones you've added. Remove them if you know they're not used. i don't know about: 'ignore_directories' i don't know about: 'parser' i don't know about: 'static_dir' i don't know about: 'static_flavours' i don't know about: 'stdoutput' PASS: config file is fine. ------ ]] checking datadir [[ datadir '/home/www/blog/entries' does not exist. You need to create your datadir and give it appropriate permissions. This must be done before we can go further. Exiting. %ls -l total 30 drwxr-xr-x 6 mogeuser users 512 Oct 7 10:00 Pyblosxom -rw-r--r-- 1 mogeuser users 848 Jul 27 13:20 blog.ini drwxr-xr-x 2 mogeuser users 512 Oct 7 09:48 cache -rw-r--r-- 1 mogeuser users 6711 Oct 7 09:59 config.py -rw-r--r-- 1 mogeuser users 1050 Oct 7 10:00 config.pyc drwxr-xr-x 2 mogeuser users 512 Oct 7 09:48 entries drwxr-xr-x 2 mogeuser users 512 Oct 7 09:48 log drwxr-xr-x 2 mogeuser users 512 Oct 7 09:48 plugins -rwxr-xr-x 1 mogeuser users 3174 Jul 26 06:33 pyblosxom.cgi -rw-r--r-- 1 mogeuser users 1589 Jul 26 06:33 pyblosxom.tac drwxr-xr-x 2 mogeuser users 512 Oct 7 09:48 static %vi entries/firstpost.txt これがわたしの最初のうたぁ。 <p> これがわたしのさいしょの夢。 </p>
ブラウザでチェック。
http://mogeuser.sakura.ne.jp/blog/pyblosxom.cgi
出た。
うーん。ベタ置きだとすごく簡単だな... orz
だいぶ時間の無駄をしてしまったよ。
pyblosxom.cgiでのローカルテストは、config.pyで指定したパラメータのチェックまでやっているわけではないので、PASSしてもブラウザからはパラメータのtypoだけでも動作しないので注意。
そういうバグは、pyblosxom.cgiの
import cgitb; cgitb.enable()
を有効にして調べる。
調べ終わったら無効にしておくこと。