您好,欢迎访问一九零五行业门户网

statusnet是什么?StatusNet怎么配置安装?

statusnet是什么?statusnet怎么配置安装?下面本篇文章给大家介绍一下statusnet安装配置方法,希望对大家有帮助。
statusnet是什么?
statusnet是个相当老牌的开源微博程序,相当多的国外微博网站都是基于它架设的。不过statusnet对于服务器的要求的确是多。
statusnet支持文件分享、用户群组、自定义皮肤、与其它社会网络(如twitter、facebook等)互联互通、从手机端和pc桌面发起访问、浏览器插件、短信接口、即时通信接口、多国语言包,还有很多的插件和应用。
statusnet兼容twitter的api,大部分的twitter客户端可以容易就支持statusnet,这使得statusnet显得非常灵活。
statusnet使用了包括pear、oauth、xmpphp、openid、markdown、yadis在内的大量开源程序,也使用了许多在线服务(如:snapshot、tinyurl)。
statusnet安装配置
由于statusnet引用大量的开源项目,加上在中文环境中有点水土不服,导致statusnet的安装过程会出现许多的不好处理问题,在此我记录下我的安装过程及碰到的问题和解决方式。
一、运行环境配置
php 5.2.3+
1、开启curl模块,curl最好支持https;
2、开启xmlwriter模块
3、开启mysql模块
4、开启gd模块
5、开启mbstring模块
6、开启gettext模块
7、开启tidy模块
mysql 5.x
关闭mysql strict mode,即在my.ini或者my.cnf里将下面这行注释掉:
sql-mode=strict_trans_tables,no_auto_create_user,no_engine_substitution
apache 2.2.x
开启mod_rewrite模块
二、准备相关开源项目代码
1、启用php的pear,具体启用方式请自己搜索解决方案
2、在pear中使用如下命令,下载相关源码:
pear install db
pear install validate-0.8.3
pear install mdb2
pear install mdb2#mysql
pear install db_dataobject
pear install date
pear install mail
pear install net_smtp
pear install mail_mime
pear install mail_mimedecode
3、下载其它扩展项目代码
3.1、在statusnet程序目录创建“ext”文件夹;
3.2、从 http://code.google.com/p/xmpphp/下载xmphp,并解压到ext目录;
3.3、从 http://oauth.googlecode.com/svn/code/php/oauth.php下载oauth.php,保存到ext目录;
3.4、从 http://openidenabled.com/下载php openid library,解压auth目录到ext目录;
3.5、从http://michelf.com/projects/php-markdown/下载php mark down,解压markdown.php到ext目录;
上面工作做好后,ext目录结构应该是下面这样,另外你可以下载我打包的ext目录:ext库
目录结构树h:\13.php\04.workspaces\statusnet\statusnet-0.8.2\ext│ markdown.php│ oauth.php├─auth│ │ openid.php│ ├─openid│ │ association.php│ │ ax.php│ │ bigmath.php│ │ consumer.php│ │ cryptutil.php│ │ databaseconnection.php│ │ diffiehellman.php│ │ discover.php│ │ dumbstore.php│ │ extension.php│ │ filestore.php│ │ hmac.php│ │ hmacsha1.php│ │ interface.php│ │ kvform.php│ │ memcachedstore.php│ │ message.php│ │ mysqlstore.php│ │ nonce.php│ │ pape.php│ │ parse.php│ │ postgresqlstore.php│ │ server.php│ │ serverrequest.php│ │ sqlitestore.php│ │ sqlstore.php│ │ sreg.php│ │ trustroot.php│ │ urinorm.php│ ├─services│ │ └─yadis│ │ httpfetcher.php│ │ manager.php│ │ misc.php│ │ paranoidhttpfetcher.php│ │ parsehtml.php│ │ plainhttpfetcher.php│ │ xml.php│ │ xrds.php│ │ xri.php│ │ xrires.php│ │ yadis.php│ └─yadis│ httpfetcher.php│ manager.php│ misc.php│ paranoidhttpfetcher.php│ parsehtml.php│ plainhttpfetcher.php│ xml.php│ xrds.php│ xri.php│ xrires.php│ yadis.php├─services│ └─yadis│ httpfetcher.php│ manager.php│ misc.php│ paranoidhttpfetcher.php│ parsehtml.php│ plainhttpfetcher.php│ xml.php│ xrds.php│ xri.php│ xrires.php│ yadis.php└─xmpphp bosh.php exception.php log.php roster.php xmlobj.php xmlstream.php xmpp.php xmpp_old.php
三、开始安装和配置
1、在服务器里配置statusnet的目录,在浏览器中访问statusnet目录下的install.php来安装;
2、打开statusnet目录下生成的config.php,进行如下配置:
2.1、指定ext目录:
$extra_path = array("h:/13.php/04.workspaces/statusnet/statusnet-0.8.2/ext/"); set_include_path(implode(path_separator, $extra_path) . path_separator . get_include_path());
2.2、配置email发送账号:
#email info, used for sms send. gmail example $config['mail']['notifyfrom'] = 'test@canbeing.com'; $config['mail']['domain'] = canbeing.com'; # see http://pear.php.net/manual/en/package.mail.mail.factory.php for options $config['mail']['backend'] = 'smtp'; $config['mail']['params'] = array('host' => 'smtp.canbeing.com', 'port' => 25, 'auth' => true, 'username' => 'test', 'password' => 'test');
3.3、设置mysql mdb2 ini文件目录:
$config['db']['ini_statusnet'] = 'h:/13.php/04.workspaces/statusnet/statusnet-0.8.2/classes/statusnet.ini';
到此为止,statusnet基本功能已经有了,可以先注册一个用户发发牢骚。
四、可能碰到的问题
1、中文站点名称显示乱码,php报错“string is not in utf-8”:
将config.php别存为“utf-8”编码即可解决问题。
2、安装完成后,注册用户失败,mdb2报错“500 the database for a1 isn't responding correctly”:
一般原因是mysql不正常,最常见的可能是没有关闭mysql的strict mode,即在my.ini或者my.cnf里将下面这行注释掉:
sql-mode="strict_trans_tables,no_auto_create_user,no_engine_substitution"
3、用户注册完成后无法登录,或者只能通过“记住登录状态”的方式才能登录进去,而且进用户面板又会提示重新登录:
statusnet登录信息都是以session的方式传递的,但基sessionid存放到了cookie里,而其程序中又使用不安全的$_request来获取客户端的sessionid,如果php.ini里的“request_order”配置没有“c”(php production配置是:request_order = "gp"),那么就读不到cookie,那么就无法登录。
解决方案是在php.ini里设置:request_order = "gpc"
4、邮件标题乱码
发出的邮件标题乱码,这与文件编码没有关系,可能与邮件发送服务器的问题,我使用gmail发出的邮件正常,配置如下:
#email info, used for sms send. gmail example$config['mail']['notifyfrom'] = 'canbeing.com@gmail.com';$config['mail']['domain'] = 'gmail.com';$config['mail']['backend'] = 'smtp';$config['mail']['params'] = array('host' => 'ssl://smtp.gmail.com', 'port' => 465, 'auth' => true, 'username' => 'canbeing.com@gmail.com', 'password' => 'test');
其它类似信息

推荐信息