Differences between revisions 6 and 8 (spanning 2 versions)
Revision 6 as of 2004-09-03 03:43:55
Size: 3950
Editor: limodou
Comment:
Revision 8 as of 2006-10-31 12:40:32
Size: 1532
Editor: 61
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
##language:zh
'''
含有章节索引的中文 文章模板
'''

-- limodou [[[DateTime(2004-09-03T03:04:09Z)]]]
[[TableOfContents]]
= pyBlosxom的安装及配置 =
''个人测试经历''
== 安装准备 ==

 * 下载pyBlosxom的[http://sourceforge.net/project/showfiles.php?group_id=67445 安装文件] (我用的是1.0.0版)
 * 一台装有Linux/Unic的机器
 * 安装好Apache (我的是Apache 2.0)
 * 安装好Python (我的是Python 2.3.4)

其实原来Linux中已经带有一个2.2版本的 Python 了,但我为了使用最新了,自行下载了2.3.4版本,编译后安装了。结果发现Apache在处理pyblosxom.cgi(pyBlosxom的入口文件)时会报错,而这个文件在命令行下单独运行时是正常的。我感觉是Apache可能还是使用老的python 2.2版本来处理的,但由于pyBlosxom是安装在 2.3.4 上的,因此报错。于是我修改了pyblosxom.cgi文件的第一行:#!/usr/bin/evn python为 #!/usr/local/bin/python (我机器上的Python实际安装文件)。一切OK了。

== 正式安装 ==

 * 使用root用户登录
 * 解压pyBlosxom安装包。进入解压后的目录,执行: python setup.py install

   这样将把pyBlosxom中公共的东西安装到python的site-packages目录下,因此这种安装可以被他人共享。
   其它还有一部分是缺省安装到/usr/local/share/pyblosxom-1.0.0目录下,一会要用到这个目录

 * 确定在Apache中的目录

   在我的机器上文档根目录为/var/www/html。因此,我在/var/www/html下建立了一个limodou子目录,作为pyBlosxom的起始目录。

   开始我并没有在Apache的文档根目录下创建子目录,而是在其它地方建的,结果总是不成功。搬过来就好了。我想还是对Apache不熟造成的。

 * 拷贝/usr/local/share/pyblosxom-1.0.0/web目录下的所有东西到/var/www/html/limodou下。

   其实只有两个文件,一个是config.py,还一个是pyblosxom.cgi。config.py是配置文件。pyblosxom.cgi是启动脚本,同时还可以对你的配置进行检查。
 * 修改config.py以满足你的要求。

   主要修改以下几项:

{{{
# Blog的标题
py['blog_title'] = "limodou's blog"

# Blog的描述用于RSS Feed
py['blog_description'] = "remember what I saw and what I thought"

# Blog作者的用户名和邮箱
py['blog_author'] = "limodou [email protected]"

# Blog的主要语言用于Rss Feed
py['blog_language'] = "zh"

# 输出编码
py['blog_encoding'] = "utf-8"

# Blog日志存放路径
py['datadir'] = "entries"

# 日志文件存放路径
py['logdir'] = "logs"
}}}

   其它的可以暂时不改。

 * 创建目录:entries(存放你的blog),plugins(以后存放插件),logs(以后存放日志)
 * 运行./pyblosxom.cgi

   如果可以运行,可以看一看输出,如果没有报错,只有一些提示,则不必管它。如果你象我安装了新的Python版本,请按上面我提到过的方法修改应该可以了。
 * 输入测试的blog

   进入entries目录,创建first.txt,随便输入内容。一般第一行是标题,其它是内容。如:
{{{
Testing!
this is my first blog entry!
}}}
 * 配置Apache

   修改/etc/httpd/conf/httpd.conf文件
  
  在最后增加虚拟主机配置:
{{{
<VirtualHost *:80>
 DocumentRoot /var/www/html

 ServerAdmin [email protected]
 ServerName 127.0.0.1

 <Directory "/var/www/html/*/">
  Options ExecCGI
  DirectoryIndex pyblosxom.cgi
  <Files config.py>
   deny from all
  </Files>
 </Directory>
</VirtualHost>
}}}

   如果AddHandler cgi-script .cgi前有注释,请去掉

 * 启动Apache

   httpd -k start

   如果已经启动,则执行httpd -k restart重启即可

 * 打开浏览器输入:http://IP地址/limodou应该就可以了

   现在的样子很丑陋,我的是这个样子的:

   attachment:firstblog.gif
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~
Troll is better than rubbish~

Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~ Troll is better than rubbish~

PyBlosxomIniLimodou (last edited 2009-12-25 07:15:22 by localhost)