ejabberd 管理,添加管理员登陆

安装好ejabberd后

修改管理员密码:
ejabberdctl register admin localhost password

给管理员赋予权限:
编辑配置文件 /usr/local/ejabberd/etc/ejabberd/ejabberd.yml
在97行左右,修改为

hosts:
  - "xxtime.com"

在400行左右,修改为

###.   ====================
###'   ACCESS CONTROL LISTS
acl:
  ## 
  ## The 'admin' ACL grants administrative privileges to XMPP accounts.
  ## You can put here as many accounts as you want.
  ## 
  admin:
    user:
      - "admin": "xxtime.com"
  ##     - "ermine": "example.org"
  ## 
  ## Blocked users
  ## 
  ## blocked:
  ##   user:
  ##     - "baduser": "example.org"
  ##     - "test"

重启

ejabberdctl restart

登陆管理后台:
http://localhost:5280/admin
根据自己设置输入用户名和密码
用户名:admin@xxtime.com
密码:123456

参考文献:
https://www.digitalocean.com/community/tutorials/how-to-install-ejabberd-xmpp-server-on-ubuntu
http://coderplay.iteye.com/blog/99893

nginx日志切割

#!/bin/bash
#设置日志文件存放目录
logs_path="/usr/local/nginx/logs/"

#设置pid文件
pid_path="/usr/local/nginx/logs/nginx.pid"

#仅linux 不支持unix
#yesterday=`date -d "yesterday" +"%Y%m%d"`

#同时支持 linux unix
#echo `TZ=aaa16 date +%Y%m%d\ %H:%M:%S`
yesterday=`TZ=aaa16 date +%Y%m%d`

#重命名日志文件
mv ${logs_path}xxtime.com_access.log ${logs_path}xxtime.com_access${yesterday}.log

#向nginx主进程发信号重新打开日志
kill -USR1 `cat ${pid_path}`