我需要为我的SOGo安装创buildSQLauthentication,并且我相信我已经设置了所有符合文档的东西。 他们要我做以下事情:
第一,他们希望我用这些命令创build数据库用户sogo和db的架构(这里是部分: https : //sogo.nu/files/docs/SOGoInstallationGuide.html#_database_configuration ):
su - postgres createuser --no-superuser --no-createdb --no-createrole \ --encrypted --pwprompt sogo (specify “sogo” as password) createdb -O sogo sogo
然后pg_hba.conf下行添加到postgresql pg_hba.conf文件中:
host sogo sogo 127.0.0.1/32 md5
最后在sogo.conf中修改以下几行:
SOGoProfileURL = "postgresql://sogo:sogo@localhost:5432/sogo/sogo_user_profile"; OCSFolderInfoURL = "postgresql://sogo:sogo@localhost:5432/sogo/sogo_folder_info"; OCSSessionsFolderURL = "postgresql://sogo:sogo@localhost:5432/sogo/sogo_sessions_folder";
那么对于真正的authentication,我需要调整SOGoUserSources以下:
SOGoUserSources = ( { type = sql; id = directory; viewURL = "postgresql://sogo:[email protected]:5432/sogo/sogo_view"; canAuthenticate = YES; isAddressBook = YES; userPasswordAlgorithm = md5; } );
我也这样做了,但不幸的是,我不知道如何创build用户的数据库和表,以使用此身份validation。 处理。
我创build了一个sogo数据库,它也是所有者,这里是我的数据库列表:
Name | Owner | Encoding | Collate | Ctype | Access privileges --------------+----------+----------+-------------+-------------+----------------------- postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | sogo | sogo | UTF8 | en_US.UTF-8 | en_US.UTF-8 | sogocreatedb | sogo | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres
然后我创build了一个sogo_view表,因为我认为这就是我应该做的。 这是一个关系列表:
List of relations Schema | Name | Type | Owner --------+-----------+-------+------- public | sogo_view | table | sogo
最后,我在表格中创build了一个用户:
c_uid | c_name | c_password | c_cn | mail ---------+---------+---------------+---------+------------------------- Luciano | Luciano | Something | Luciano | [email protected]
但是连接还没有发生,有没有人有这方面的经验?
在您的密码栏中,您应该设置密码的MD5。 像这样插入一条logging:
INSERT INTO sogo_view VALUES ( 'Luciano', 'Luciano', MD5('Something'), 'Luciano', '[email protected]');
在debian wiki中有一个如何设置db和插入login的说明。 这是为MySQL,但也适用于postgres。 只要确保你设置数据库和表所有者sogo ,你显然做了。
在debian示例中,用户表被称为sogo_users而不是sogo_view 。 所以要么在下面的例子sogo_view其重命名为sogo_view ,要么将您的SOGoconfigurationviewURL更改为.../sogo_users 。 这里是最初的debian例子:
CREATE TABLE sogo_users ( c_uid VARCHAR(10) PRIMARY KEY, c_name VARCHAR(10), c_password VARCHAR(32), c_cn VARCHAR(128), mail VARCHAR(128)); INSERT INTO sogo_users VALUES ('paul', 'paul', MD5('zxc'), 'Paul Example', '[email protected]'); INSERT INTO sogo_users VALUES ('piet', 'piet', MD5('zxc'), 'Piet Jansen', '[email protected]'); INSERT INTO sogo_users VALUES ('klaas', 'klaas', MD5('zxc'), 'Klaas van der Zee', '[email protected]');
参考: https : //wiki.debian.org/SOGo
试图连接时,程序抛出的确切错误信息是什么?
我注意到你有
sogocreatedb | sogo | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
在你的数据库列表中。 你打算创build一个sogocreatedb数据库吗?