Howto install flectra on minimal centos
The issues are with selinux, firewalld (which are not used in NethServer) and postgres.
Disable firewall. For production please keep security in mind and configure the firewall instead of disabling it.
systemctl disable firewalld --now
Disable selinux:
Edit /etc/selinux/config
and set SELINUX=disabled
. Reboot the system.
Install and prepare postgres:
yum -y install postgresql postgresql-server
postgresql-setup initdb
Edit /var/lib/pgsql/data/pg_hba.conf and replace the lines at the end to look like this:
# "local" is for Unix domain socket connections only
local all postgres ident
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
Restart postgres:
systemctl restart postgresql
Go on with the rest of the installation (same except of e-smith commands):
yum -y install python36u python36u-pip python36u-devel wget unzip postgresql-devel npm nodejs git libjpeg-devel libxml2-devel libxslt-devel openldap-devel cyrus-sasl-devel
pip3.6 install --upgrade pip
ln -s /usr/bin/python3.6 /usr/bin/python3
wget -nc https://gitlab.com/flectra-hq/flectra/repository/master/archive.zip
unzip -nq archive.zip
mkdir -p /opt/flectra
mkdir -p /etc/flectra
mkdir -p /var/log/flectra
mv flectra-master* flectra
mv flectra /opt/flectra/
chown flectra:flectra /opt/flectra/ -R && chown flectra:flectra /var/log/flectra/ -R
cd /opt/flectra/flectra && pip3.6 install -r requirements.txt
npm install -g less less-plugin-clean-css -y
mkdir /opt/wkhtmltox && cd /opt/wkhtmltox && wget -nc https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
cd /opt/wkhtmltox/wkhtmltox
cp -R /opt/wkhtmltox/wkhtmltox/* /usr/local/
ln -s /usr/local/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
ln -s /usr/local/bin/wkhtmltoimage /usr/bin/wkhtmltoimage
mkdir /opt/geolite && cd /opt/geolite && wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoLiteCity.dat.gz
mkdir /usr/share/GeoIP
mv /opt/geolite/GeoLiteCity.dat /usr/share/GeoIP
postgresql-setup initdb
systemctl enable --now postgresql
su - postgres -c "createuser -s flectra"
su - postgres -c "psql -c \"alter user flectra with encrypted password 'flectra';\""
su - flectra -c "/opt/flectra/flectra/flectra-bin --addons-path=/opt/flectra/flectra/addons -s --stop-after-init"
mv /opt/flectra/.flectrarc /etc/flectra/flectra.conf
sed -i "s,^\(logfile = \).*,\1"/var/log/flectra/flectra-server.log"," /etc/flectra/flectra.conf
sed -i "s,^\(logrotate = \).*,\1"True"," /etc/flectra/flectra.conf
sed -i "s,^\(proxy_mode = \).*,\1"True"," /etc/flectra/flectra.conf
sed -i "s,^\(db_host = \).*,\1"localhost"," /etc/flectra/flectra.conf
sed -i "s,^\(db_name = \).*,\1"flectra"," /etc/flectra/flectra.conf
sed -i "s,^\(db_password = \).*,\1"flectra"," /etc/flectra/flectra.conf
sed -i "s,^\(db_template = \).*,\1"template0"," /etc/flectra/flectra.conf
sed -i "s,^\(db_user = \).*,\1"flectra"," /etc/flectra/flectra.conf
ln -s /opt/flectra/flectra/flectra-bin /usr/bin/flectra
cat << EOF > /usr/lib/systemd/system/flectra.service
[Unit]
Description=Flectra
Wants=network.target
[Service]
Type=simple
User=flectra
Group=flectra
ExecStart=/usr/bin/flectra --config /etc/flectra/flectra.conf --logfile /var/log/flectra/flectra-server.log
[Install]
WantedBy=multi-user.target
EOF
systemctl enable --now flectra