meshcentral-sur-lxc
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| meshcentral-sur-lxc [2020/11/08 14:57] – créée pielo | meshcentral-sur-lxc [2021/12/26 09:35] (Version actuelle) – [Apache revese proxy] pielo | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== Installation de Meshcentral sur LXC ====== | + | ====== Installation de Meshcentral sur LXC Ubuntu 18.04 ====== |
| ===== Liens ===== | ===== Liens ===== | ||
| - | * http:// | + | |
| + | * [[http:// | ||
| + | ===== Outils ===== | ||
| + | |||
| + | <code bash> | ||
| + | apt install net-tools bash-completion software-properties-common | ||
| + | |||
| + | dpkg-reconfigure locales | ||
| + | |||
| + | cat <<EOF | tee -a / | ||
| + | if [ -f / | ||
| + | . / | ||
| + | fi | ||
| + | EOF | ||
| + | </ | ||
| + | |||
| + | ===== Réseau ===== | ||
| <code bash> | <code bash> | ||
| Ligne 21: | Ligne 37: | ||
| - 8.8.8.8 | - 8.8.8.8 | ||
| EOF | EOF | ||
| + | </ | ||
| + | |||
| + | ===== Meshcentral ===== | ||
| + | |||
| + | <code bash> | ||
| + | apt install -y nodejs npm | ||
| + | node -v | ||
| + | npm -v | ||
| + | apt install mongodb -y | ||
| + | systemctl start mongodb | ||
| + | systemctl enable mongodb | ||
| + | setcap cap_net_bind_service=+ep / | ||
| + | echo " | ||
| + | useradd -r -d / | ||
| + | mkdir / | ||
| + | cd / | ||
| + | npm install meshcentral | ||
| + | npm install archiver@4.0.2 otplib@10.2.3 mongodb | ||
| + | mkdir / | ||
| + | chown -R meshcentral: | ||
| + | chmod 755 -R / | ||
| + | |||
| + | |||
| + | cat <<' | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | " | ||
| + | "": | ||
| + | } | ||
| + | } | ||
| + | EOF | ||
| + | |||
| + | sudo -u meshcentral node ./ | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Apache reverse proxy ===== | ||
| + | |||
| + | https:// | ||
| + | |||
| + | |||
| + | <code apache> | ||
| + | RewriteEngine on | ||
| + | RewriteCond %{HTTP: | ||
| + | RewriteCond %{HTTP: | ||
| + | RewriteRule . " | ||
| + | ProxyPass / http:// | ||
| + | ProxyPassReverse / http:// | ||
| + | ProxyPreserveHost On | ||
| + | </ | ||
| + | |||
| + | ===== Systemd service ===== | ||
| + | |||
| + | < | ||
| + | cat <<EOF | tee / | ||
| + | [Unit] | ||
| + | Description=MeshCentral Server | ||
| + | |||
| + | [Service] | ||
| + | Type=simple | ||
| + | LimitNOFILE=1000000 | ||
| + | ExecStart=/ | ||
| + | WorkingDirectory=/ | ||
| + | Environment=NODE_ENV=production | ||
| + | User=meshcentral | ||
| + | Group=meshcentral | ||
| + | Restart=always | ||
| + | # Restart service after 10 seconds if node service crashes | ||
| + | RestartSec=10 | ||
| + | # Set port permissions capability | ||
| + | AmbientCapabilities=cap_net_bind_service | ||
| + | |||
| + | [Install] | ||
| + | WantedBy=multi-user.target | ||
| + | EOF | ||
| + | |||
| + | systemctl enable meshcentral.service | ||
| + | systemctl start meshcentral.service | ||
| + | systemctl status meshcentral.service | ||
| + | systemctl stop meshcentral.service | ||
| </ | </ | ||
meshcentral-sur-lxc.1604847420.txt.gz · Dernière modification : de pielo
