首先需要apt-get apache2 php5-cgi php5-mysql mysql-server php5-gd
完成以后用phpinfo测试一下,看看有没有加载pdo和json,weave需要这两个,debian默认加载的,不需要操心。
从官方下载weave server所需文件,修改文件夹0.5中的default_constants.php.dist为default_constants.php,然后编辑其中的内容,主要是类似如下的部分,我的是
if (WEAVE_STORAGE_ENGINE == ‘mysql’)
{
#if using mysql, host, db name, username and password for the auth store
if (!defined(‘WEAVE_MYSQL_STORE_READ_HOST’)) { define(‘WEAVE_MYSQL_STORE_READ_HOST’, ‘localhost’); }
if (!defined(‘WEAVE_MYSQL_STORE_READ_DB’)) { define(‘WEAVE_MYSQL_STORE_READ_DB’, ‘weave’); }
if (!defined(‘WEAVE_MYSQL_STORE_READ_USER’)) { define(‘WEAVE_MYSQL_STORE_READ_USER’, ‘root’); }
if (!defined(‘WEAVE_MYSQL_STORE_READ_PASS’)) { define(‘WEAVE_MYSQL_STORE_READ_PASS’, ‘rootpass’); }
里面的rootpass是你的mysql的密码。然后把server文件夹传到服务器上,你传到哪儿就需要修改apache中的配置路径。
下面首先开始配置mysql
mysql -u root -p
输入密码后执行以下命令
create database weave;
CREATE TABLE `wbo` (
`username` varbinary(32) NOT NULL default ”,
`collection` varbinary(64) NOT NULL default ”,
`id` varbinary(64) NOT NULL default ”,
`parentid` varbinary(64) default NULL,
`predecessorid` varbinary(64) default NULL,
`modified` decimal(12,2) default NULL,
`sortindex` int(11) default NULL,
`depth` tinyint(4) default NULL,
`payload` longtext,
`payload_size` int(11) default NULL,
PRIMARY KEY (`username`,`collection`,`id`),
KEY `parentindex` (`username`,`collection`,`parentid`),
KEY `modified` (`username`,`collection`,`modified`),
KEY `weightindex` (`username`,`collection`,`sortindex`),
KEY `predecessorindex` (`username`,`collection`,`predecessorid`),
KEY `size_index` (`username`,`payload_size`)
) ENGINE=InnoDB;
因为我配置的过程不需要用到用户认证,所以我没有插入user表,此步省略;
下面开始配置apache,你可以照抄我的配置,注意需要修改一下实际路径
/etc/apache2/sites-available/default
ServerName weave.gzxkc.com
DocumentRoot /home/www/weave.gzxkc.com/server/
ErrorLog /var/log/apache2/weaveserver-error.log
CustomLog /var/log/apache2/weaveserver-access.log combined
Options Indexes FollowSymLinks
AllowOverride none
Order allow,deny
Allow from all
AuthType Basic
AuthName “Weave Server”
AuthUserFile /etc/apache2/auth
require valid-user
Alias /0.5 /home/www/weave.gzxkc.com/server/0.5/index.php
/etc/apache2/ports.conf
Listen 60002
# SSL name based virtual hosts are not yet supported, therefore no
# NameVirtualHost statement here
Listen 443
然后建立auth文件
htpasswd -c /etc/apache2/auth yourusername
输入密码
这样在weave的登录的地方就用你的用户名和密码登录
到此所有的配置结束,这里我用到了负载均衡,所以VirtualHost是内外那个地址,你需要修改成你的服务器地址。
完成以后重新启动一下apache即可
最新评论