linux centos安装配置prosody

贡威
2023-12-01

linux centos安装配置prosody

 

安装:
#yum install prosody

配置:
配置文件路径
/etc/prosody/prosody.cfg.lua

在prosody.cfg.lua添加主机
#vi /etc/prosody/prosody.cfg.lua
找到VirtualHost
———– Virtual hosts ———–
VirtualHost “localhost”
VirtualHost “域名/IP”

保存后重启服务
#/etc/init.d/prosody restart

#prosodyctl restart

添加用户:
#prosodyctl adduser ie01@域名/IP
修改密码:
#prosodyctl passwd ie01@域名/IP

开启防火墙:
XMPP服务器的著名端口为TCP/5222,XMPP服务器间互联的著名端口为TCP/5269
防火墙需开启5222端口
iptables -A INPUT -p tcp –dport 5222 -j ACCEPT

开启SSL/TLS:
Prosody 0.9+ run:
#prosodyctl cert generate example.com
For older versions (e.g. 0.8), you can run openssl manually like so:
#openssl req -new -x509 -days 365 -nodes -out “prosody.crt” -newkey rsa:2048 -keyout “prosody.key”
此步骤需要输入一些证书信息,解释如下:
Country Name (2 letter code) [GB]:【在此输入两个字符的国家名。中国的为CN 】
State or Province Name (full name) [Berkshire]:【省份名称,如北京为beijing 】
Locality Name (eg, city) [Newbury]:【城市名称,如beijing】
Organization Name (eg, company) [My Company Ltd]:【公司名称】
Organizational Unit Name (eg, section) []:【部门名称】
Common Name (eg, your name or your server’s hostname) []:【姓名,通常即证书名,prosody需输你的虚拟主机名/IP】
Email Address []:【电子邮箱地址】

#mkdir /etc/prosody/certs
#mv prosody.* /etc/prosody/certs
#vi /etc/prosody/prosody.cfg.lua
在Virtual hosts项下更改key/crt证书保存路径
———– Virtual hosts ———–
ssl = {
key = “/etc/pki/tls/private/prosody.key”;
certificate = “/etc/pki/tls/certs/prosody.crt”;
}
上面是默认路径,改为你存放证书的路径
ssl = {
key = “/etc/prosody/certs/prosody.key”;
certificate = “/etc/prosody/certs/prosody.crt”;
}

 

参看:

http://prosody.im/doc

转载于:https://www.cnblogs.com/helinzi/p/4600151.html

 类似资料: