惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
SegmentFault 最新的问题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - Franky
有赞技术团队
有赞技术团队
Last Week in AI
Last Week in AI
Martin Fowler
Martin Fowler
MyScale Blog
MyScale Blog
aimingoo的专栏
aimingoo的专栏
Recent Announcements
Recent Announcements
雷峰网
雷峰网
T
Tor Project blog
博客园_首页
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Register - Security
The Register - Security
T
The Blog of Author Tim Ferriss
Recorded Future
Recorded Future
V
Vulnerabilities – Threatpost
Project Zero
Project Zero
J
Java Code Geeks
AWS News Blog
AWS News Blog
Security Latest
Security Latest
Spread Privacy
Spread Privacy
T
Threatpost
博客园 - 三生石上(FineUI控件)
I
Intezer
G
Google Developers Blog
Scott Helme
Scott Helme
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The Hacker News
The Hacker News
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
NISL@THU
NISL@THU
A
Arctic Wolf
F
Full Disclosure
P
Proofpoint News Feed
G
GRAHAM CLULEY
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
N
Netflix TechBlog - Medium
C
Cybersecurity and Infrastructure Security Agency CISA
T
Threat Research - Cisco Blogs
B
Blog
IT之家
IT之家
MongoDB | Blog
MongoDB | Blog
L
LangChain Blog
Know Your Adversary
Know Your Adversary

博客园 - canbeing

Cocos2d-x游戏引擎实战开发炸弹超人项目教程 全套下载 1至6课 关于Android多项目依赖在Eclipse中无法关联源代码的问题解决 免费将Mac OS X从Snow Leopard升级到Mountain Lion 文档在线预览:文档生成技术细节 文档在线预览:总体思路 开发服务器恢复手记与心得 养成良好习惯 铸造高效管理 计算机管理:电脑定时开关机 [深圳]金蝶软件招聘多名网站架构师、规划师、开发工程师、策划师、设计师 微博平台StatusNet研究(5):支持Jabber/Gtalk 微博平台StatusNet研究(4):快速安装 微博平台StatusNet研究(3):友好URL与OpenID支持 微博平台StatusNet研究(1):介绍 分享微博平台间的信息同步方法 在线服务器性能状态监控预警软件推荐:监控宝 VPS上安装LAMP(Linux+Apache+MySQL+PHP)步骤 [已送完]赠送Google Wave 邀请码 偶对《蜗居》人物的观点感想 Linux使用入门与服务器管理交流 PPT
微博平台StatusNet研究(2):基本安装
canbeing · 2010-01-18 · via 博客园 - canbeing

由于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”文件夹;

上面工作做好后,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');

本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。