meshcentral-sur-lxc
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| meshcentral-sur-lxc [2020/11/08 15:02] – 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 ===== | ===== Outils ===== | ||
| <code bash> | <code bash> | ||
| apt install net-tools bash-completion software-properties-common | apt install net-tools bash-completion software-properties-common | ||
| - | |||
| dpkg-reconfigure locales | dpkg-reconfigure locales | ||
| Ligne 52: | Ligne 50: | ||
| setcap cap_net_bind_service=+ep / | setcap cap_net_bind_service=+ep / | ||
| echo " | 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.1604847770.txt.gz · Dernière modification : de pielo
