Untitled
unknown
plain_text
2 years ago
3.5 kB
13
Indexable
Mise en place et configuration de l'access point sur le raspberry PI :
1. Mise à jour complète du système
sudo apt-get update ; sudo apt-get upgrade
2. Installation des dépendances nécessaires
sudo apt-get install dnsmasq hostapd
3. Configuration de l'interface wlan0
3.1. Informer le service DHCPD d'ignorer l'interface wlan0
sudo nano /etc/dhcpcd.conf
# Ajout à la fin du fichier :
denyinterfaces wlan0
4. Définition d'une adresse IP statique sur l'interface Wi-Fi
sudo nano /etc/network/interfaces
# Ajout à la fin du fichier :
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.5.1
netmask 255.255.255.0
network 192.168.5.0
broadcast 192.168.5.255
5. Configuration de Hostapd
5.1. Créer une configuration personnalisée
sudo nano /etc/hostpad/hostapd.conf
# Ajout à la fin du fichier :
interface=wlan0
driver=nl80211
ssid=DashRig
hw_mode=g
channel=6
ieee80211n=1
wmm_enabled=1
ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_passphrase=dashrig-m115
rsn_pairwise=CCMP
5.2. Indiquer le chemin de configuration à Hostapd
sudo nano /etc/default/hostpad
# Remplacer la ligne "#DAEMON_CONF=""" par :
DAEMON_CONF="/etc/hostapd/hostapd.conf"
6. Configuration de Dnsmasq
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
sudo nano /etc/dnsmasq.conf
# Contenu de la configuration :
interface=wlan0
listen-address=192.168.5.1
bind-interfaces
server=8.8.8.8
domain-needed
bogus-priv
dhcp-range=192.168.5.100,192.168.5.200,24h
Déploiement de l'application Frontend ViteJS :
1. Construction de l'application en mode production
"npm run build"
2. Hébergement local de l'application en production
sudo cp -r dist/* /var/www/html
3. Création du fichier .htaccess
sudo nano /var/www/html/.htaccess
# Contenu du fichier :
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
4. Configuration du VirtualHost apache2
sudo a2enmod rewrite
sudo nano /etc/apache2/sites-available/000-default.conf
# Lignes à modifier/ajouter :
DocumentRoot /var/www/html
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
sudo service apache2 restart
5. Création d'un service pour le serveur ExpressJS Backend
5.1. Création du service
sudo nano /etc/systemd/system/dashrig-backend.service
# Contenu du fichier
[Unit]
Description=Service for DashRig's Express Backend server
After=network.target
[Service]
ExecStart=/usr/bin/node /home/dashrig/ICT-M115_DashRig--backend/index.js
WorkingDirectory=/home/dashrig/ICT-M115_DashRig--backend/
Restart=always
User=dashrig
Group=dashrig
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target
5.2. Démarrage, activation et test du service
sudo systemctl daemon-reload
sudo systemctl enable dashrig-backend
sudo systemctl start dashrig-backend
sudo systemctl status dashrig-backend
Editor is loading...
Leave a Comment