Skip to content

Install on Centos 7

mkezys edited this page Oct 21, 2021 · 4 revisions

Last time tested on 2021-10-21 using CentOS-7-x86_64-Minimal-2009.iso with yum -y update && reboot

packets

yum -y install epel-release

yum -y install gcc-c++ libevent libevent-devel openssl openssl-devel curl libcurl-devel git perl

yum -y install python-devel python3-devel hiredis-devel curl-devel gsm-devel speex-devel opus-devel

yum -y install spandsp spandsp-devel

mysql magic

yum -y install http://repo.mysql.com/mysql-community-release-el7.rpm

yum --enablerepo=mysql-connectors-community install -y mysql-connector-c++-devel

ln -s /usr/include/mysql-cppconn-8/jdbc /usr/include/mysql++

getting source

git clone https://github.com/sems-server/sems.git /usr/src/sems

setting correct path to the mysql-c++-connector dir

sed -i "s|/usr/include/mysql\+|/usr/include/mysql++|g" /usr/src/sems/apps/early_announce/Makefile

enabling spandsp for G722 codec support

sed -i "s|#USE_SPANDSP\+|USE_SPANDSP|g" /usr/src/sems/Makefile.defs

fixing python

ln -s /usr/lib64/libpython3.so /usr/lib64/libpython3.6.so

disabling broken modules

sed -i "s|#exclude_app_modules = py_sems ivr mailbox pin_collect conf_auth mp3 examples\+|exclude_app_modules = ivr pin_collect conf_auth examples|g" /usr/src/sems/Makefile.defs

install

cd /usr/src/sems

make

make install

symlink for sane etc location

ln -s /usr/local/etc/sems /etc/sems

configuring logging into /var/log/sems

sed -i "s|# syslog_facility=LOCAL0\+|syslog_facility=LOCAL0|g" /etc/sems/sems.conf

echo "local0.* -/var/log/sems/sems.log" >> /etc/rsyslog.conf

mkdir -p /var/log/sems

touch /var/log/sems/sems.log

perl -pi.bak -e 's#(\s+)\/var\/log\/messages#;local0.none/var/log/messages#' /etc/rsyslog.conf

systemctl restart rsyslog

configuring systemd service

useradd sems

groupadd sems

usermod -a -G sems sems

mkdir -p /var/run/sems

cp -fr /usr/src/sems/pkg/rpm/sems.systemd.service /etc/systemd/system/sems.service

correct path to sems

sed -i "s|/usr/sbin/sems\+|/usr/local/sbin/sems|g" /etc/systemd/system/sems.service

activating service

systemctl enable sems.service

systemctl start sems

check if all ok

systemctl status sems