在Fedora Core 8上安装laconica
权承
2023-12-01
在Fedora Core 6上试安装过,但因为Fedora Core 6提供的PHP等的版本可能过低,运行不成功。现在测试过在Fedora Core 8上安装成功,所以写上来先做个Milestone吧。
1. 安装LAMP
这个可以参考本blog中的"在Fedora Core 8上半手动安装LAMP"
2. 下载laconica。打到最新版本的laconica及其URL下载。laconica的主页上是建议用darcs来做这件事,但我直接下载snapshot就算了。
#curl http://laconi.ca/laconica-0.4.4.tar.gz -O
3. 下载php-pear
不知道为什么Fedora Core 8的DVD中没有提供这东西。我只好上rpmfind找去了。
#curl -O ftp://195.220.108.108/linux/fedora/releases/8/Everything/i386/os/Packages/php-pear-1.6.2-2.fc8.noarch.rpm
#rpm -ivh php-pear-1.6.2-2.fc8.noarch.rpm
4. 安装PHP-Pear相关的东西:
不少人的主机在防火墙之后,不能直接连到国外的服务器。那你可以用
#pear config-set http_proxy <your.proxy.host>:<port>
来设置pear的proxy,然后再做下面的操作
#pear channel-update pear.php.net
#pear install channel://pear.php.net/Validate-0.8.1
#pear install DB_DataObject
#pear install Mail
#pear install Net_SMTP
5. 安装extlib所需的东西
把laconica-0.4.4.tar.gz解压后,进入laconica-0.4.4目录,在下面建立两个子目录:
#mkdir extlib xfers
#cd xfers
#curl -O http://openidenabled.com/files/php-openid/packages/php-openid-2.1.1.zip
#curl -O http://michelf.com/docs/projets/php-markdown-1.0.1m.zip
#curl -O http://oauth.googlecode.com/svn/code/php/OAuth.php
#curl -O http://xmpphp.googlecode.com/files/xmpphp-0.1beta-r21.tar.gz
#unzip php-markdown-1.0.1m.zip
#cp 'PHP Markdown 1.0.1m/markdown.php' ../extlib/
#unzip php-openid-2.1.1.zip
#cp -r php-openid-2.1.1/Auth ../extlib/
#cp OAuth.php ../extlib/
#tar -zxf xmpphp-0.1beta-r21.tar.gz
#cp xmpphp/*.php ../extlib/
#cp -r xmphp/XMPPHP ../extlib/.
#cd ..
#rm -rf xfers
事实上xmpphp已经更新了,目前的最新版是
xmpphp-0.1beta-r50.tar.gz
建立下载最新版的,尤其是遇到下面的错误时:
Fatal error: Class 'XMPPHP_XMPP' not found in /var/www/lib/jabber.php on line 47
6. MySQL数据表
mysql -uroot -p -e 'create database laconica';
mysql -uroot -p -e "grant all privileges on laconica.* to laconica@localhost identified by 'PASSWORD'";
mysql -uroot -p laconica < db/laconica.sql
7. 把laconica移到apache目录下:
cp -r laconica-0.4.4 /var/www/html/laconica
8. 配置laconica
把config.php.sample转成config.php,把dataobject.ini.sample转成dataobject.ini,把htaccess.sample转成 .htaccess
改动config.php
#If you have downloaded libraries in random little places, you
#can add the paths here
define('INSTALLDIR', dirname(__FILE__));
set_include_path(get_include_path() . PATH_SEPARATOR . INSTALLDIR . '/extlib');
再改动config.php
$config['site']['name'] = 'cafeonica';
$config['site']['server'] = 'braveo.com';
$config['site']['path'] = 'laconica';
$config['site']['fancy'] = false;
$config['site']['theme'] = 'stoica';
$config['site']['email'] = 'webmaster@braveo.com';
$config['site']['broughtby'] = 'Braveo Huang';
$config['site']['broughtbyurl'] = 'http://www.braveo.com/';
$config['db']['database'] = 'mysql://laconica:PASSWORD@localhost/laconica';
$config['db']['ini_laconica'] = $config['db']['schema_location'].'/stoica.ini';
改动dataobject.ini
database = mysql://laconica:PASSWORD@localhost/laconica
schema_location = /var/www/html/laconica/classes
class_location = /var/www/html/laconica/classes
require_prefix = /var/www/html/laconica/classes/
9. 把stoica.ini转成laconica.ini
这个有点奇怪,不过的确可以避免出现
DB_DataObject Error: Unable to load schema for database and table (turn debugging up to 5 for full error message)
参考文档:
http://decafbad.com/blog/2008/07/03/getting-laconica-up-and-running