After request I will share my guide how to install Domoticz on Centos 7 64 bit.
The guide is based on this post: viewtopic.php?f=17&t=2131 but with a few modifications (Some things from the original guide were not working for me. I think because I use 64 bit Centos and the original guide was based on 32 bit Centos).
1) Download source code:
git clone https://github.com/domoticz/domoticz.git domoticz-code
Domoticz source should now be at /usr/src/domoticz-code
2) Install with yum :
yum install cmake
yum install boost
yum install gcc
yum install libusb
yum install libcurl
yum install gcc-c++
yum install sqlite-devel
yum install boost-devel
yum install zlib-devel
yum install curl-devel
yum install boost-static
yum install libstdc++-static libstdc++-static.i686
3) Copy all boost libraries into /usr/lib/lib
md /usr/lib/lib
cd /usr/lib64/
cp libbost*.* /usr/lib/lib/
4) Modify CMakeLists.txt
Add just after unset(Boost_LIBRARY_DIRS CACHE) :
set(Boost_NO_BOOST_CMAKE ON)
5) Modify smtpclient/SMTPClient.cpp
Comment these lines :
// curl_easy_setopt(curl, CURLOPT_MAIL_FROM, m_From.c_str());
// curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, slist1);
6) Modify main/SQLHelper.cpp
Comment these lignes (two lignes in code) :
// sqlite3_wal_checkpoint(m_dbase, NULL);
7) Cmake
delete CMakeCache.txt
cmake -DCMAKE_BUILD_TYPE=Release CMakeLists.txt
8) Make
make
9) Install binaries
cd /usr/src/domoticz
md /usr/local/domoticz
cp domoticz /usr/local/domoticz
cp -r scripts /usr/local/domoticz
cp -r www /usr/local/domoticz
10) Copy domoticz.sh to /etc/init.d
rename domoticz.sh to domoticz
11) Modify /etc/init.d/domoticz
Code: Select all
#! /bin/sh
### BEGIN INIT INFO
# Provides: domoticz
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Home Automation System
# Description: This daemon will start the Domoticz Home Automation System
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DESC="Domoticz Home Automation System"
NAME=domoticz
USERNAME=domoticz
DAEMON=/usr/local/domoticz/$NAME
#DAEMON_ARGS="-daemon -www 8080 -log /tmp/domoticz.txt"
#DAEMON_ARGS="-daemon -www 8080 -syslog"
DAEMON_ARGS="-daemon -www 8080 -log /var/log/domoticz.log"
STOP_TIMEOUT=10
pidfile=/var/run/$NAME.pid
lockfile=/var/lock/subsys/$NAME}
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
#
# Function that starts the daemon/service
#
do_start()
{
echo -n $"Starting $NAME : "
daemon --pidfile=$pidfile $DAEMON $DAEMON_ARGS
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch ${lockfile}
return $RETVAL
}
#
# Function that stops the daemon/service
#
do_stop()
{
echo -n $"Stopping $NAME : "
killproc -p ${pidfile} -d ${STOP_TIMEOUT} $DAEMON
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}
case "$1" in
start)
do_start
;;
stop)
do_stop
;;
status)
status -p ${pidfile} DAEMON
RETVAL=$?
;;
restart)
do_stop
do_start
;;
*)
echo "Usage: service domoticz {start|stop|status|restart}" >&2
exit 3
;;
esac
:
12) Create user domoticz
useradd domoticks
13) Start service
service domoticz start
14) Test
http://127.0.0.1:8080