- Laravel 11, Blade, Alpine.js, Tailwind CSS - Produkt- & Kategorieverwaltung mit Varianten - Checkout (Vorkasse + Rechnung), Session-Warenkorb - Admin-Backend (Dashboard, Bestellungen, Kunden, CMS) - DSGVO-konform: Cookie-Consent, Impressum, Widerruf, AGB - PDF-Rechnung via dompdf, SMTP-Mailversand - Kundenverwaltung mit manueller Freischaltung Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
118 lines
2.4 KiB
Markdown
118 lines
2.4 KiB
Markdown
# Deployment-Anleitung (VPS / Debian/Ubuntu)
|
|
|
|
## Voraussetzungen
|
|
|
|
- PHP 8.3 + Extensions: pdo_mysql, mbstring, xml, zip, gd, curl, intl
|
|
- MySQL 8+
|
|
- Nginx
|
|
- Composer 2
|
|
- Node.js 20 + npm
|
|
|
|
## Schritt 1: Projekt deployen
|
|
|
|
```bash
|
|
cd /var/www
|
|
git clone <repo-url> shop
|
|
cd shop
|
|
composer install --no-dev --optimize-autoloader
|
|
npm ci && npm run build
|
|
cp .env.example .env
|
|
php artisan key:generate
|
|
```
|
|
|
|
## Schritt 2: .env konfigurieren
|
|
|
|
Datenbankzugangsdaten, APP_URL und MAIL-Einstellungen eintragen.
|
|
|
|
```bash
|
|
nano .env
|
|
```
|
|
|
|
## Schritt 3: Datenbank & Storage
|
|
|
|
```bash
|
|
php artisan migrate --force
|
|
php artisan db:seed --force
|
|
php artisan storage:link
|
|
```
|
|
|
|
## Schritt 4: Berechtigungen
|
|
|
|
```bash
|
|
chown -R www-data:www-data /var/www/shop
|
|
chmod -R 755 /var/www/shop
|
|
chmod -R 775 /var/www/shop/storage /var/www/shop/bootstrap/cache
|
|
```
|
|
|
|
## Schritt 5: Nginx-Konfiguration
|
|
|
|
```nginx
|
|
server {
|
|
listen 80;
|
|
server_name example.de www.example.de;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name example.de www.example.de;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/example.de/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/example.de/privkey.pem;
|
|
|
|
root /var/www/shop/public;
|
|
index index.php;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.php?$query_string;
|
|
}
|
|
|
|
location ~ \.php$ {
|
|
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
|
|
fastcgi_index index.php;
|
|
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
|
include fastcgi_params;
|
|
}
|
|
|
|
client_max_body_size 20M;
|
|
|
|
location ~ /\.ht { deny all; }
|
|
}
|
|
```
|
|
|
|
## Schritt 6: Queue-Worker (für E-Mails)
|
|
|
|
```bash
|
|
# /etc/supervisor/conf.d/shop-worker.conf
|
|
[program:shop-worker]
|
|
command=php /var/www/shop/artisan queue:work --sleep=3 --tries=3 --max-time=3600
|
|
user=www-data
|
|
autostart=true
|
|
autorestart=true
|
|
redirect_stderr=true
|
|
stdout_logfile=/var/log/shop-worker.log
|
|
```
|
|
|
|
```bash
|
|
supervisorctl reread && supervisorctl update && supervisorctl start shop-worker
|
|
```
|
|
|
|
## Schritt 7: Admin-Account setzen
|
|
|
|
Nach dem ersten Login unter `/login` mit `admin@example.de` / `changeme123`:
|
|
→ Sofort das Passwort unter **Admin → Einstellungen → Mein Konto** ändern!
|
|
|
|
## Updates deployen
|
|
|
|
```bash
|
|
cd /var/www/shop
|
|
git pull
|
|
composer install --no-dev --optimize-autoloader
|
|
npm ci && npm run build
|
|
php artisan migrate --force
|
|
php artisan config:cache
|
|
php artisan route:cache
|
|
php artisan view:cache
|
|
supervisorctl restart shop-worker
|
|
```
|