vagrantfile + scripts
This commit is contained in:
commit
25aaa220cd
1
.vagrant/bundler/global.sol
Normal file
1
.vagrant/bundler/global.sol
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"dependencies":[["vagrant-berkshelf",["= 5.1.2"]],["vagrant-hostmanager",["= 1.8.10"]],["vagrant-omnibus",["= 1.5.0"]],["log4r",[">= 0"]],["concurrent-ruby",["~> 1.0"]],["i18n",[">= 0"]],["micromachine",[">= 2","< 4"]],["vagrant-vbguest",["= 0.31.0"]]],"checksum":"ecea410ec36ec38b3c619188d2eb3a079a46b7b7b2ec2e158d9c6e155205cb88","vagrant_version":"2.3.7"}
|
1
.vagrant/machines/default/virtualbox/action_provision
Normal file
1
.vagrant/machines/default/virtualbox/action_provision
Normal file
@ -0,0 +1 @@
|
|||||||
|
1.5:c451b4a2-b878-489f-a7aa-f79a776e1b2a
|
1
.vagrant/machines/default/virtualbox/action_set_name
Normal file
1
.vagrant/machines/default/virtualbox/action_set_name
Normal file
@ -0,0 +1 @@
|
|||||||
|
1695196649
|
1
.vagrant/machines/default/virtualbox/box_meta
Normal file
1
.vagrant/machines/default/virtualbox/box_meta
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name":"ubuntu/trusty64","version":"20190514.0.0","provider":"virtualbox","directory":"boxes/ubuntu-VAGRANTSLASH-trusty64/20190514.0.0/virtualbox"}
|
1
.vagrant/machines/default/virtualbox/creator_uid
Normal file
1
.vagrant/machines/default/virtualbox/creator_uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
1000
|
1
.vagrant/machines/default/virtualbox/id
Normal file
1
.vagrant/machines/default/virtualbox/id
Normal file
@ -0,0 +1 @@
|
|||||||
|
c451b4a2-b878-489f-a7aa-f79a776e1b2a
|
1
.vagrant/machines/default/virtualbox/index_uuid
Normal file
1
.vagrant/machines/default/virtualbox/index_uuid
Normal file
@ -0,0 +1 @@
|
|||||||
|
1d1a58671337462a981d203f438e32b3
|
27
.vagrant/machines/default/virtualbox/private_key
Normal file
27
.vagrant/machines/default/virtualbox/private_key
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIIEpQIBAAKCAQEAxFOYk+qeLRrB5Brypj27Z176JNkRI/EFzfHzSgUGcIw7aXKB
|
||||||
|
kHYZdnMYtVOaVrgnHifE76VffnYPJ/D3tUlo6JC5t4Bxr9jNrzhElTAyBDJSZOvG
|
||||||
|
K0dDFddLaCgPtYWxcZRaPoOw0wCf9cpiSi0DGjm0iZW/w9LPsFdchKZJdFpHk79q
|
||||||
|
6aLKER3assBbgSfO+7Vp0L+qQbScLqmGtEUOmNjRkCsqsQXC0DrRsw01DLdgJ3Qm
|
||||||
|
51U6mD9NNhOpjWT3B5aQqouZMNZi5sSSwkBgdF7lbUJFcH6AAD/Po3uKZfcn+8I8
|
||||||
|
stHoDjJe8dLOpTQNgBxqu3p3FRRWB3RvQ+twiwIDAQABAoIBAAo67O1wQVPKXCYd
|
||||||
|
vV0qRFSrn09CPGFqEspbfDj0MBS3SfVBsTys2sDQWI5CT/2K1Qb+PYXbUTGOx1Vm
|
||||||
|
ehHpRF0yBWtpdwMZwgYKYZCAlWqgkKiPnKDusrE1qclApSjpUYjAmT8+r30fQDaX
|
||||||
|
mC2TUOER9rVgp0B2ALqIotqKq7MzVbB6uLOs/xM4IAyUY9DxGKB34j65QPcIF7yK
|
||||||
|
vt6xyGdrhQYJHEjs6Wvd0nIMBOIqKclpUjaWFFSZ66fTY7jLUe1SBFJzV55GMOTU
|
||||||
|
KvUJV9wX/MlZfix7Y0rBjJrRGhYG4DjAKLxAw18NAnRu8ChmOl1motFNFohGJgl+
|
||||||
|
il0aFMECgYEA8RPhqUSfRMU5U7+Mk879z5EJ1SwPj0+XU9zy/IkVHxK0o0O1ByB/
|
||||||
|
vFPll8Jt+Tpc+pgmVo/vsYq8G1bGbu4WcMyEANilUoJ7mYZ2zumNdlF86V0fEdUG
|
||||||
|
YMC6xSsdduUiJ5wP2A2FjKrpUxyxFWpihpz6J+mWpQrw7ys6bjWM5SsCgYEA0HqW
|
||||||
|
hxGCJw0iIH9GpCNwuHWAbFepwbfJ3ZlEVu+K295N08a3e6TS6WqfkQ6lwr31pkj6
|
||||||
|
7rVg+AXFvjkHjATN1UTlnE3Do0okk1N6++deg3qGw12NwqOsUENuAAXYbHmjbpkX
|
||||||
|
G4aGobeqYsHDAB6toxnumEhqBHZ7/DbQZC8+siECgYEAmrik0qsNAOkHIt3DzjVB
|
||||||
|
pg6y3dJ6ZgKx34vlkvgzyw6JSmMw8tMDyA2cQ6rwQ80WUWqG6HVWY37jvTQTBKzf
|
||||||
|
UCOh8J0adXry8pRe+erg9HfWEDvIrfwnLL9k3xgNv/nM0tkRPhtng+FJACNg75qo
|
||||||
|
gzaKQkVjfqcn/Iek54iM1aMCgYEAgdenwq274viCBb1fUMEl5iyAdHnQp28BEbvw
|
||||||
|
XTjJwhBdZoWAJ0jLd0bJ5L07reNDiHIxntRmdXKa6tN4CNPBIo/LdaLVMvDtgLhg
|
||||||
|
g11hdv+rySeOL+hiXIbyjp8VYNINYMeGJcWOOlA6lVFaUsvIlymCeWO4a9kjdTzq
|
||||||
|
Y0stgCECgYEAogGgWxS1DRhlHNIwRiZiTJGghL75OaDj70/8NCpdytABHYnUabYZ
|
||||||
|
gUE9ganijXqED0I+L7cL9Q9rOg5ZSbhAsI/w0Sd3pgTKd6BzO2Z1cNFwbinQfosA
|
||||||
|
X+NO7QUjRtFA081njXDziJwUAbHXSOC58xS3XylbsaURlu3NCMAR6vM=
|
||||||
|
-----END RSA PRIVATE KEY-----
|
1
.vagrant/machines/default/virtualbox/synced_folders
Normal file
1
.vagrant/machines/default/virtualbox/synced_folders
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"virtualbox":{"/vagrant":{"guestpath":"/vagrant","hostpath":"/home/aardouin/Workspace/Xibo","disabled":false,"__vagrantfile":true}}}
|
1
.vagrant/machines/default/virtualbox/vagrant_cwd
Normal file
1
.vagrant/machines/default/virtualbox/vagrant_cwd
Normal file
@ -0,0 +1 @@
|
|||||||
|
/home/aardouin/Workspace/Xibo
|
9
.vagrant/rgloader/loader.rb
Normal file
9
.vagrant/rgloader/loader.rb
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# This file loads the proper rgloader/loader.rb file that comes packaged
|
||||||
|
# with Vagrant so that encoded files can properly run with Vagrant.
|
||||||
|
|
||||||
|
if ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]
|
||||||
|
require File.expand_path(
|
||||||
|
"rgloader/loader", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"])
|
||||||
|
else
|
||||||
|
raise "Encoded files can't be read outside of the Vagrant installer."
|
||||||
|
end
|
19
Vagrantfile
vendored
Normal file
19
Vagrantfile
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# -*- mode: ruby -*-
|
||||||
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
Vagrant.configure("2") do |config|
|
||||||
|
config.vm.define "web" do |web|
|
||||||
|
web.vm.box = "generic/debian11"
|
||||||
|
web.vm.provision "shell", path: "web.sh"
|
||||||
|
web.vm.network "private_network", ip: "192.168.56.60"
|
||||||
|
web.vm.network "forwarded_port", guest: 80, host: 1234, id: "nginx"
|
||||||
|
web.vm.hostname = "web"
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.define "db" do |db|
|
||||||
|
db.vm.box = "generic/debian11"
|
||||||
|
db.vm.provision "shell", path: "db.sh"
|
||||||
|
db.vm.network "private_network", ip: "192.168.56.61", hostname: true
|
||||||
|
db.vm.hostname = "db"
|
||||||
|
end
|
||||||
|
end
|
13
db.sh
Normal file
13
db.sh
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
wget https://dev.mysql.com/get/mysql-apt-config_0.8.26-1_all.deb
|
||||||
|
dpkg -i ./mysql-apt-config_0.8.26-1_all.deb
|
||||||
|
yes | apt-get update
|
||||||
|
yes | apt-get install mysql-server
|
||||||
|
|
||||||
|
mysql -h 'localhost' << EOF
|
||||||
|
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
|
||||||
|
CREATE USER 'xibo'@'192.168.56.60' IDENTIFIED BY 'xibo';
|
||||||
|
CREATE DATABASE xibo_db;
|
||||||
|
GRANT ALL PRIVILEGES ON xibo_db.* TO 'xibo'@'192.168.56.60' WITH GRANT OPTION;
|
||||||
|
FLUSH PRIVILEGES;
|
||||||
|
EOF
|
96
web.sh
Normal file
96
web.sh
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Installation des paquets
|
||||||
|
apt-get update
|
||||||
|
yes | apt-get install apache2 ufw php php7.4-gd php-common php-cli php-json php-dom php-mysql php-zip php-soap php-curl php-xml php-mbstring php-zmq libapache2-mod-wsgi-py3 libapache2-mod-xsendfile python-dev
|
||||||
|
|
||||||
|
|
||||||
|
# Installation Xibo cms
|
||||||
|
mkdir /srv/xibo-cms
|
||||||
|
cd /srv/xibo-cms
|
||||||
|
wget https://github.com/xibosignage/xibo-cms/releases/download/2.3.3/xibo-cms-2.3.3.tar.gz
|
||||||
|
tar -xvzf xibo-cms-2.3.3.tar.gz --strip-components=1
|
||||||
|
rm xibo-cms-2.3.3.tar.gz
|
||||||
|
chown -R www-data:www-data /srv/xibo-cms
|
||||||
|
rm -r /var/www
|
||||||
|
ln -s /srv/xibo-cms /var/www
|
||||||
|
a2enmod rewrite
|
||||||
|
a2enmod ssl
|
||||||
|
cat > /etc/apache2/sites-available/xibo-cms.conf << EOF
|
||||||
|
<VirtualHost *:80>
|
||||||
|
DocumentRoot "/var/www/web"
|
||||||
|
ServerName xibo.domain.com
|
||||||
|
XSendFile on
|
||||||
|
XSendFilePath /var/www/Library
|
||||||
|
<Directory "/var/www/web">
|
||||||
|
AllowOverride All
|
||||||
|
Options Indexes FollowSymLinks MultiViews
|
||||||
|
Order allow,deny
|
||||||
|
Allow from all
|
||||||
|
Require all granted
|
||||||
|
</Directory>
|
||||||
|
</VirtualHost>
|
||||||
|
<VirtualHost *:443>
|
||||||
|
DocumentRoot "/var/www/web"
|
||||||
|
ServerName xibo.domain.com
|
||||||
|
XSendFile on
|
||||||
|
XSendFilePath /var/www/Library
|
||||||
|
<Directory "/var/www/web">
|
||||||
|
AllowOverride All
|
||||||
|
Options Indexes FollowSymLinks MultiViews
|
||||||
|
Order allow,deny
|
||||||
|
Allow from all
|
||||||
|
Require all granted
|
||||||
|
</Directory>
|
||||||
|
</VirtualHost>
|
||||||
|
EOF
|
||||||
|
a2dissite 000-default.conf
|
||||||
|
a2ensite xibo-cms.conf
|
||||||
|
sed -i -e "s/\(max_execution_time =\).*/\1 300/" \
|
||||||
|
-e "s/\(memory_limit =\).*/\1 256M/" \
|
||||||
|
-e "s/\(post_max_size =\).*/\1 2G/" \
|
||||||
|
-e "s/\(upload_max_filesize =\).*/\1 2G/" \
|
||||||
|
-e "/^;session.cookie_secure =/ csession.cookie_secure = Off" \
|
||||||
|
-e "s/\(session.cookie_httponly =\).*/\1 On/" \
|
||||||
|
-e "s/\(session.cookie_samesite =\).*/\1 Lax/" /etc/php/7.4/apache2/php.ini
|
||||||
|
cat > /srv/xibo-cms/vendor/xibosignage/xibo-xmr/bin/config.json << EOF
|
||||||
|
{
|
||||||
|
"listenOn": "tcp://127.0.0.1:50001",
|
||||||
|
"pubOn": ["tcp://127.0.0.1:1234"],
|
||||||
|
"debug": false
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
chown www-data:www-data /srv/xibo-cms/vendor/xibosignage/xibo-xmr/bin/config.json
|
||||||
|
cat > /etc/systemd/system/xibo-xmr.service << EOF
|
||||||
|
[Unit]
|
||||||
|
Description=Xibo XMR
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=www-data
|
||||||
|
Group=www-data
|
||||||
|
ExecStart=/usr/bin/php /srv/xibo-cms/vendor/bin/xmr.phar
|
||||||
|
Restart=always
|
||||||
|
KillMode=process
|
||||||
|
RestartSec=1
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl enable xibo-xmr.service
|
||||||
|
systemctl start xibo-xmr.service
|
||||||
|
|
||||||
|
cat > /var/spool/cron/crontabs/www-data << EOF
|
||||||
|
{
|
||||||
|
* * * * * /usr/bin/php /srv/xibo-cms/bin/xtr.php
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
ufw allow ssh
|
||||||
|
ufw allow http
|
||||||
|
ufw allow https
|
||||||
|
ufw allow 1234/tcp
|
||||||
|
yes | ufw enable
|
||||||
|
|
||||||
|
systemctl restart apache2
|
Loading…
Reference in New Issue
Block a user