90 lines
1.6 KiB
Markdown
90 lines
1.6 KiB
Markdown
# Deployment-Anleitung für ypchat.net
|
|
|
|
## Voraussetzungen
|
|
|
|
- Die Anwendung muss nach `/opt/ypchat` kopiert werden
|
|
- Node.js muss installiert sein
|
|
- Apache muss konfiguriert sein
|
|
|
|
## Schritte
|
|
|
|
### 1. Anwendung nach /opt/ypchat kopieren
|
|
|
|
```bash
|
|
# Als root oder mit sudo
|
|
sudo mkdir -p /opt/ypchat
|
|
sudo cp -r /home/torsten/Programs/SingleChat/* /opt/ypchat/
|
|
sudo chown -R www-data:www-data /opt/ypchat
|
|
```
|
|
|
|
### 2. Installation durchführen
|
|
|
|
```bash
|
|
cd /opt/ypchat
|
|
sudo -u www-data ./install.sh
|
|
```
|
|
|
|
### 3. Service installieren
|
|
|
|
```bash
|
|
cd /opt/ypchat
|
|
sudo ./install-service-ypchat.sh
|
|
```
|
|
|
|
### 4. Alten Service stoppen
|
|
|
|
```bash
|
|
sudo systemctl stop ypchat
|
|
sudo systemctl disable ypchat # Optional: Alten Service deaktivieren
|
|
```
|
|
|
|
### 5. Neuen Service starten
|
|
|
|
```bash
|
|
sudo systemctl start ypchat
|
|
sudo systemctl status ypchat
|
|
```
|
|
|
|
### 6. Logs prüfen
|
|
|
|
```bash
|
|
sudo journalctl -u ypchat -f
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
### Service startet nicht
|
|
|
|
```bash
|
|
# Prüfe Logs
|
|
sudo journalctl -u ypchat -n 50
|
|
|
|
# Prüfe ob Node.js verfügbar ist
|
|
which node
|
|
/usr/bin/node --version
|
|
|
|
# Prüfe ob .env existiert
|
|
ls -la /opt/ypchat/.env
|
|
cat /opt/ypchat/.env
|
|
```
|
|
|
|
### Alte Seite wird noch angezeigt
|
|
|
|
1. Prüfe ob der neue Service läuft: `sudo systemctl status ypchat`
|
|
2. Prüfe ob Port 4000 belegt ist: `sudo lsof -i :4000`
|
|
3. Prüfe Apache-Logs: `sudo tail -f /var/log/apache2/error.log`
|
|
4. Apache neu laden: `sudo systemctl reload apache2`
|
|
|
|
### Gebaute Dateien fehlen
|
|
|
|
```bash
|
|
# Prüfe ob dist existiert
|
|
ls -la /opt/ypchat/docroot/dist
|
|
|
|
# Falls nicht, baue neu:
|
|
cd /opt/ypchat
|
|
sudo -u www-data npm run build
|
|
sudo -u www-data cp -r client/dist docroot/
|
|
```
|
|
|