TeamTalk部署 ubuntu18.04

  Root用户

一 依赖安装 

1.1 安装依赖
 

apt-get -y install cmake
apt-get -y install libuu-dev
apt-get -y install libcurl4-openssl-dev
apt-get -y install libhiredis-dev
apt-get install -y libapr1-dev
apt-get install -y libaprutil1-dev     


1.2 切换gcc版本


      Ubuntu18.04默认的gcc版本是7.0以上的版本,太高了。编译TeamTalk有问题,会报一些错误,所有降低到4.8.5版本

apt-get install -y gcc-4.8 g++-4.8
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 100
查看版本是否已经变成4.8.5

gcc --version
g++ --version


1.3 安装redis


    Redis使用Ubuntu18.04默认的就可以

apt-get install -y redis-server
1.4 安装mysql
     Mysql使用Ubuntu18.04默认的版本,如果需要使用特定的版本,请保证安装的版本高于5.1,否则因为数据库的配置中会设置utf8mb4,以支持emoji表情的存储,mysql 5.1 默认是不支持utf8mb4的

apt-get install -y mysql-server
apt-get install -y mysql-client
apt-get install -y libmysqlclient-dev
   

设置libmysqlclient_r.so的软链接,否则编译db_proxy_server是会报错

使用下面的命令查看mysql的版本

mysql –version
 

 跳转到/usr/lib/x86_64-linux-gnu/目录下,设置软链接

cd /usr/lib/x86_64-linux-gnu/
sudo ln -s libmysqlclient.so.20.3.17 libmysqlclient_r.so

2.0 编译TeamTalk

2.1编译protobuf


    设置脚本执行权限

chmod a+x make_protobuf.sh
./make_protobuf.sh


2.2 编译hiredis


    设置脚本执行权限

chmod a+x make_hiredis.sh
./make_hiredis.sh


2.3  编译log4cxx 

log4cxx依赖于apache 的 apr 和 apr-util,所以安装顺序是: apr, apr-util, log4cxx。

详细 见 log4cxx 安装

 设置脚本执行权限

chmod a+x make_log4cxx.sh

修改 make_log4cxx.sh


./make_log4cxx.sh

 

 

 


2.4 生成protobuf文件

 


    Protobuf的定义TeamTalk\pb目录下

chmod a+x create.sh
chmod a+x sync.sh
./create.sh
./sync.sh


2.5 编译服务器代码


    服务器代码在TeamTalk/server/src目录下,cd到这个目录开始编译

chmod a+x build_ubuntu.sh
./build_ubuntu.sh version 1

Guess you like

Origin blog.csdn.net/TyearLin/article/details/118903890