安装

  • 可以从 http://teaos.cn/download 下载对应的Release版本,目前支持MacOS(darwin)、Linux、Windows三种版本;
  • 使用unzip解压到某个目录,比如 teaweb-v0.0.1/;
  • 然后执行:
  1. cd teaweb-v0.0.1/ # 转到teaweb目录
  2. bin/teaweb start

如果是Windows,则可以直接运行安装目录下的start.bat

  • 如果没有出现错误的话,可以在浏览器中访问:
  1. http://127.0.0.1:7777

其中127.0.0.1可能需要换成你服务器的IP,而且我们默认使用了7777端口(可以在configs/server.conf中修改),如果访问遇到了问题,请检查防火墙设置;

  • 使用用户名admin和密码123456登录,可以在configs/admin.conf中修改这些信息,也可以在设置界面中修改;
  • 如果是Unix或者Linux,请确保安装目录下的configs/web/tmp/是有读取和写入权限的。
  • 设置MongoDB

MongoDB

TeaWeb需要使用MongoDB来记录日志和其他数据,如果已经安装,可以在”设置”>“MongoDB”中修改MongoDB的连接参数,具体请参考MongoDB设置一节。

CentOS 7

在CentOS 7上,如果你需要使用7777端口,可能要在firewall中注册一个规则:

  1. firewall-cmd --zone=public --add-port=7777/tcp --permanent
  2. firewall-cmd --reload

Red Hat Enterprise Linux Server 7

在Red Hat Enterprise Linux Server 7上,如果你需要使用7777端口,可能要在firewall中注册一个规则:

  1. firewall-cmd --zone=public --add-port=7777/tcp --permanent
  2. firewall-cmd --reload

Windows

Windows版本的目录下自带有 start.bat ,请解压后,直接双击运行 start.bat 即可。

开机启动脚本

通常我们在安装软件后,希望能随开机启动,以免重启时忘了启动服务。

自动安装

从v0.1.6开始,在Windows下可以运行bin\目录下的service-install.exeservice-uninstall.exe两个命令,分别是安装服务和卸载服务;如果后期TeaWeb安装目录改变了,需要先卸载服务再重新安装,以便服务能找到正确的TeaWeb目录。如果提示权限错误,以管理员身份运行这两个命令(通常在鼠标右键有”以管理员身份运行”)。如果提示A system shutdown is in process,则试着转到bin\目录下重新运行命令尝试。

在Linux下可以运行bin/下的service-installservice-uninstall两个命令,分别是安装服务和卸载服务;如果后期TeaWeb安装目录改变了,可以重新运行服务安装命令,以便服务能找到正确的TeaWeb目录。

手动安装

在v0.1.6之前,Linux二进制发行版自带启动脚本模板,可以在 scripts/ 目录下找到:

  1. teaweb - teaweb启动脚本
  2. teaweb-agent - agent启动脚本

使用步骤为:

  • 修改启动脚本中的INSTALL_DIR为实际的TeaWeb或Agent安装目录
  • 将启动脚本文件拷贝到 /etc/init.d 目录下
  • 使用root设置权限:chmod u+x /etc/init.d/teaweb 或者 chmod u+x /etc/init.d/teaweb-agent
  • 使用chkconfig添加到启动项中:chkconfig —add teaweb 或者 chkconfig —add teaweb-agent现在你就可以使用以下命令了:
  1. service teaweb start|stop|restart|reset
  2. service teaweb-agent start|stop|restart

而且开机启动的时候会自动执行:

  1. service teaweb start
  2. service teaweb-agent start