centos上安装letschat

参考如下两个文档进行安装。主要参考第一个文章20180507

How to Deploy a Let's Chat Server on CentOS 7

How to Install Let’s Chat on CentOS 7

  1. nginx问题汇总

安装源问题

先安装epel:

[plain]  view plain  copy
  1. yum install epel-release  

如果还是搞不定,则试一下解决方案:

出现这个的原因是因为本地yum源中没有我们想要的nginx,那么我们就需要创建一个“/etc/yum.repos.d/nginx.repo”的文件,新增一个yum源。

[root@localhost data]# vim /etc/yum.repos.d/nginx.repo

在这个文件中写入以下内容:

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

退出保存后,我们可以使用yum命令来查询nginx的yum源配置好了没有。

[root@localhost ~]# yum list |grep nginx
nginx.x86_64                               1:1.12.2-1.el7_4.ngx        nginx
nginx-debug.x86_64                         1:1.8.0-1.el7.ngx           nginx
nginx-debuginfo.x86_64                     1:1.12.2-1.el7_4.ngx        nginx
nginx-module-geoip.x86_64                  1:1.12.2-1.el7_4.ngx        nginx
nginx-module-geoip-debuginfo.x86_64        1:1.12.2-1.el7_4.ngx        nginx
nginx-module-image-filter.x86_64           1:1.12.2-1.el7_4.ngx        nginx
nginx-module-image-filter-debuginfo.x86_64 1:1.12.2-1.el7_4.ngx        nginx
nginx-module-njs.x86_64                    1:1.12.2.0.1.14-1.el7_4.ngx nginx
nginx-module-njs-debuginfo.x86_64          1:1.12.2.0.1.14-1.el7_4.ngx nginx
nginx-module-perl.x86_64                   1:1.12.2-1.el7_4.ngx        nginx
nginx-module-perl-debuginfo.x86_64         1:1.12.2-1.el7_4.ngx        nginx
nginx-module-xslt.x86_64                   1:1.12.2-1.el7_4.ngx        nginx
nginx-module-xslt-debuginfo.x86_64         1:1.12.2-1.el7_4.ngx        nginx
nginx-nr-agent.noarch                      2.0.0-12.el7.ngx            nginx
pcp-pmda-nginx.x86_64                      3.11.8-7.el7                bas
则我们nginx的yum源就配置成功啦!

最后就可以直接安装:

[root@localhost data]# yum -y install nginx

大功告成!

2、配置文件问题


在修改配置文件nginx.conf,老是出现错误

[emerg]: unknown directive "location" in /opt/nginx/conf/nginx.conf:35

多次修改文件均无效。最后只能,针对配置文件一条 一条 添加,并增量测试。才算顺利完成。 其中location必须放到server模块中,同时需要注意左右括弧对应,不要少了括弧。

Ensure that location directive located inside of server block:

http {
...
    server {
        ...
        location ...
    }
}

为了关闭自己申请账号功能,需要修改配置文件

If you want to customize Let's Chat, you can create a file named /opt/lets-chat/settings.yml and then put your custom settings in it:

sudo cp settings.yml.sample settings.yml
并且在 settings.yml 中修改配置项


2、REST相关问题

RESTful API的理解

3、API测试

发送消息

curl -i -H Accept:application/json -H authorization:Bearer ****token**** -X POST http://localsever:50001/messages -H Content-Type:application/json -d '{ "text":"It's a unix system! I know this!", "room":"****roomid*****" }'


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值