备注: 我开发测试的环境时centos
1. 预备环境
1. opensslyum install -y openssl-devel2. xmlyum install -y expat-devel3. yamlyum install -y libyaml-devel
2. 项目创建
mix new ejapp项目结构├── Jenkinsfile├── README.md├── config│ ├── config.exs│ └── ejabberd.yml├── lib│ └── ejapp.ex├── mix.exs├── mix.lock└── test ├── ejapp_test.exs └── test_helper.exs主要是 config/ 目录中文件的配置config/config.exsconfig :ejabberd, file: "config/ejabberd.yml", log_path: 'logs/ejabberd.log'# Customize Mnesia directory:config :mnesia, dir: 'mnesiadb/'config/ejabberd.ymlwget https://gist.githubusercontent.com/mremond/383666d563025e86adfe/raw/723dfa50c955c112777f3361b4f2067b76a55d7b/ejabberd.yml
3. 运行
a. 依赖下载&& 编译运行mix deps.getmix compileiex -S mixb. 注册用户:ejabberd_auth.try_register("test", "localhost", "passw0rd")
4. 参考资料
https://docs.ejabberd.im/developer/extending-ejabberd/elixir/https://github.com/rongfengliang/ejabberd-elixir