Arquivo da categoria: script

Metabase script install

Script de instalação Metabase

metabase-install.sh (103 downloads )

#!/bin/bash
# Para Centos 7
# Metabase, Openjdk 1.8, Postgresql-15, Nginx como proxy
# Banco: metabseappdb
#
# Por Ronaldo davi
# 27/04/2023
# Versão 1.0.0.6

# Desativando selinux
setenforce 0
wait
sudo sed -i ‘s/enforcing/disabled/g’ /etc/selinux/config /etc/selinux/config
setsebool -P httpd_can_network_connect_db 1
systemctl stop firewalld
systemctl disable firewalld
wait
yum -y update
wait
yum install -y epel-release yum-utils
wait
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
wait
sleep 5
sudo yum install -y postgresql15-server
wait
sleep 5
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb
wait
sudo systemctl enable postgresql-15
sudo systemctl start postgresql-15
wait
sudo -u postgres createdb metabaseappdb
wait
rm -rf /var/lib/pgsql/15/data/pg_hba.conf
echo ”
# TYPE DATABASE USER ADDRESS METHOD

# “local” is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 trust
host all all 0.0.0.0/0 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 trust
host replication all ::1/128 trust
” >> /var/lib/pgsql/15/data/pg_hba.conf

wait
systemctl restart postgresql-15
wait
yum -y install java-1.8.0-openjdk vim wget epel-release
wait
readlink -f /usr/bin/java | sed “s:/jre/bin/java::”
wait
echo “export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.362.b08-1.el7_9.x86_64″ | tee -a /etc/profile
wait
source /etc/profile
wait
wget http://downloads.metabase.com/v0.29.3/metabase.jar
wait
adduser –home-dir /var/metabase –comment=”Metabase User” –shell /sbin/nologin metabase
wait
mv metabase.jar /var/metabase
wait
chown metabase:metabase -R /var/metabase
wait
#touch /var/metabase/metabase.env
echo ”
if $programname == ‘metabase’ then /var/log/metabase.log
& stop
” >> /etc/rsyslog.d/metabase.conf
#sudo chown syslog:adm /var/log/metabase.log
wait
sudo systemctl restart rsyslog.service

echo ”
MB_PASSWORD_COMPLEXITY=normal
MB_DB_TYPE=postgres
MB_DB_DBNAME=metabaseappdb
MB_DB_PORT=5432
MB_DB_USER=postgres
MB_DB_PASS=q1w2e3r4
MB_DB_HOST=localhost
MB_EMOJI_IN_LOGS=true
# any other env vars you want available to Metabase
” >> /etc/default/metabase
wait
echo “[Unit]
Description=Metabase server
After=syslog.target
After=network.target

[Service]
EnvironmentFile=/etc/default/metabase
User=metabase
Group=metabase
Type=simple
ExecStart=/usr/bin/java -jar /var/metabase/metabase.jar
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=metabase

[Install]
WantedBy=multi-user.target ” >> /etc/systemd/system/metabase.service

wait
systemctl enable metabase
systemctl start metabase
systemctl status metabase
systemctl status postgresql-15

yum -y install nginx

systemctl start nginx

systemctl enable nginx

echo ” server {
listen 80;
server_name metabase.example.com;
access_log /var/log/nginx/metabase.access.log;
error_log /var/log/nginx/metabase.error.log;

location / {
proxy_pass http://localhost:3000;
}
} ” >> /etc/nginx/conf.d/metabase.conf

systemctl restart nginx
systemctl status metabase

xibo script 2.3.16

xibo-install2.3.16.sh (98 downloads ) Versão:
#!/bin/bash
# Para Centos 7
# Xibo install script
# CMS 2.2.16, MariaDB 5.5 , Apache, PHP7.4, zeromq, openXR
# Por Ronaldo davi
# 25/04/2023
# Versão 1.0.2.3

# Desativando selinux
setenforce 0
wait
sudo sed -i ‘s/enforcing/disabled/g’ /etc/selinux/config /etc/selinux/config
wait
# Atualizando SO
yum update -y
wait
# instalando apache e utils
yum install -y httpd libtool gcc-c++ glib* zip vim wget git yum-utils
wait
yum install -y epel-release
wait
yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm
wait
# ativar PHP 7.4
yum-config-manager –disable ‘remi-php*’
wait
yum-config-manager –enable remi-php74
wait
# cache rapido do yum
sudo yum makecache fast -y
wait
yum update -y
wait
# Instalar MariaDB5.5 e php7.4
yum install -y php
wait
yum install -y php-devel php-soap php-common php-mysql php-gd php-mbstring php-mcrypt php-xmlrpc php-zip php-intl php-mysqlnd php-dom php-simplexml php-xml php-xmlreader php-curl php-exif php-ftp php-gd php-iconv php-json php-mbstring php-posix php-sockets php-tokenizer php-cli php-smtp php-imagick php-opcache
wait
yum install -y zeromq-devel
wait
## install zmq.so
cd ~
wait
git clone https://github.com/zeromq/php-zmq.git
wait
cd php-zmq
wait
phpize && ./configure
wait
make && make install
wait
yum install -y mariadb-server mariadb

# Ativar MariaDB
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
wait
# Adicionar zeromq config
echo “; Enable ZeroMQ extension module
extension=zmq.so
” >> /etc/php.d/20-zmq.ini
wait
# Configurando PHP
upload_max_filesize=256M
post_max_size=256M
max_execution_time=300
max_input_time=300

for key in upload_max_filesize post_max_size max_execution_time max_input_time
do
sed -i “s/^\($key\).*/\1 $(eval echo = \${$key})/” /etc/php.ini
done
wait

# Download xibo
cd /var/www/
wait
wget https://github.com/xibosignage/xibo-cms/releases/download/2.3.16/xibo-cms-2.3.16.tar.gz

# Descompactando e instalando
tar xvf /var/www/xibo-cms-2.3.16.tar.gz
mv /var/www/xibo-cms-2.3.16 /var/www/html/xibo2.3.16

sudo chown -R apache:apache /var/www/html/
sudo chmod -R 755 /var/www/html/

systemctl enable –now httpd
systemctl start –now httpd
systemctl disable –now firewalld
systemctl stop –now firewalld

#Criacao virtualhost
echo ”


DocumentRoot /var/www/html/xibo2.3.16/web/
CustomLog /var/log/httpd/xibo-access.log combined
ErrorLog /var/log/httpd/xibo-error.log
ServerName xibo.foo.bar

Options Indexes FollowSymLinks MultiViews
Order allow,deny
Allow from all
Require all granted
Allowoverride All
RewriteEngine On

” >> /etc/httpd/conf.d/xibo.foo.bar.conf

systemctl restart httpd

mysql_secure_installation