206 lines
4.5 KiB
Markdown
Executable File
206 lines
4.5 KiB
Markdown
Executable File
# 🌐 Webspace Setup - NeoNail DB
|
|
|
|
## 🚨 Problem: Verzeichnisliste wird angezeigt
|
|
|
|
Wenn Sie eine Verzeichnisliste sehen statt der Laravel-Anwendung, liegt das daran, dass der Webserver nicht auf das `public/` Verzeichnis zeigt.
|
|
|
|
## 🔧 Lösungen je nach Hosting-Provider
|
|
|
|
### **Option A: Shared Hosting (cPanel, Plesk, etc.)**
|
|
|
|
**1. Document Root ändern:**
|
|
- Gehen Sie zu Ihrem Hosting-Panel
|
|
- Suchen Sie "Document Root" oder "Web Root"
|
|
- Ändern Sie von `/neonail/` zu `/neonail/public/`
|
|
|
|
**2. Oder Unterverzeichnis erstellen:**
|
|
```
|
|
public_html/
|
|
└── neonail/
|
|
└── public/ ← Hier alle Laravel-Dateien
|
|
```
|
|
|
|
### **Option B: VPS/Dedicated Server**
|
|
|
|
**1. Apache Virtual Host:**
|
|
```apache
|
|
<VirtualHost *:80>
|
|
ServerName ihre-domain.de
|
|
DocumentRoot /var/www/neonail/public
|
|
|
|
<Directory /var/www/neonail/public>
|
|
AllowOverride All
|
|
Require all granted
|
|
</Directory>
|
|
</VirtualHost>
|
|
```
|
|
|
|
**2. Nginx:**
|
|
```nginx
|
|
server {
|
|
listen 80;
|
|
server_name ihre-domain.de;
|
|
root /var/www/neonail/public;
|
|
|
|
index index.php index.html;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.php?$query_string;
|
|
}
|
|
|
|
location ~ \.php$ {
|
|
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
|
|
fastcgi_index index.php;
|
|
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
|
include fastcgi_params;
|
|
}
|
|
}
|
|
```
|
|
|
|
### **Option C: Automatische Umleitung (Empfohlen)**
|
|
|
|
**1. .htaccess im Hauptverzeichnis (bereits erstellt):**
|
|
```apache
|
|
RewriteEngine On
|
|
RewriteRule ^$ public/ [L]
|
|
RewriteRule (.*) public/$1 [L]
|
|
```
|
|
|
|
**2. index.php im Hauptverzeichnis (bereits erstellt):**
|
|
```php
|
|
<?php
|
|
$publicPath = __DIR__ . '/public';
|
|
if (file_exists($publicPath . '/index.php')) {
|
|
require_once $publicPath . '/index.php';
|
|
}
|
|
```
|
|
|
|
## 📋 Schritt-für-Schritt Setup
|
|
|
|
### **1. Dateien hochladen**
|
|
```
|
|
/neonail/
|
|
├── .htaccess ← Neue Datei (Umleitung)
|
|
├── index.php ← Neue Datei (Umleitung)
|
|
├── public/ ← Laravel public Verzeichnis
|
|
├── app/ ← Laravel App-Verzeichnis
|
|
├── bootstrap/ ← Laravel Bootstrap
|
|
├── config/ ← Laravel Konfiguration
|
|
├── database/ ← Datenbank-Migrationen
|
|
├── resources/ ← Views, Assets
|
|
├── routes/ ← Routen
|
|
├── storage/ ← Speicher (Schreibrechte!)
|
|
└── vendor/ ← Composer Dependencies
|
|
```
|
|
|
|
### **2. .env erstellen**
|
|
```bash
|
|
# Kopieren Sie env-sqlite-example.txt zu .env
|
|
cp env-sqlite-example.txt .env
|
|
```
|
|
|
|
**In .env anpassen:**
|
|
```env
|
|
APP_ENV=production
|
|
APP_DEBUG=false
|
|
APP_URL=https://ihre-domain.de/neonail
|
|
|
|
# SQLite (einfachste Option)
|
|
DB_CONNECTION=sqlite
|
|
DB_DATABASE=/path/to/neonail/database.sqlite
|
|
```
|
|
|
|
### **3. Berechtigungen setzen**
|
|
```bash
|
|
chmod -R 755 storage/
|
|
chmod -R 755 bootstrap/cache/
|
|
chmod 644 .env
|
|
```
|
|
|
|
### **4. SQLite-Datenbank erstellen**
|
|
```bash
|
|
touch database.sqlite
|
|
chmod 664 database.sqlite
|
|
```
|
|
|
|
### **5. Composer installieren (falls verfügbar)**
|
|
```bash
|
|
composer install --optimize-autoloader --no-dev
|
|
```
|
|
|
|
### **6. Laravel Setup**
|
|
```bash
|
|
php artisan migrate --force
|
|
php artisan storage:link
|
|
php artisan config:cache
|
|
```
|
|
|
|
### **7. Admin-User erstellen**
|
|
```bash
|
|
php artisan tinker
|
|
```
|
|
```php
|
|
use App\Models\User;
|
|
User::create([
|
|
'name' => 'Admin',
|
|
'email' => 'admin@neonail.com',
|
|
'password' => bcrypt('ihr_passwort')
|
|
]);
|
|
```
|
|
|
|
## 🐛 Troubleshooting
|
|
|
|
### **Problem: "500 Internal Server Error"**
|
|
**Lösung:**
|
|
1. `.env` Datei prüfen
|
|
2. Berechtigungen prüfen
|
|
3. PHP-Version prüfen (8.1+)
|
|
4. Logs prüfen: `storage/logs/laravel.log`
|
|
|
|
### **Problem: "Class not found"**
|
|
**Lösung:**
|
|
```bash
|
|
composer dump-autoload
|
|
```
|
|
|
|
### **Problem: "Database connection failed"**
|
|
**Lösung:**
|
|
1. SQLite-Datei erstellen
|
|
2. Berechtigungen prüfen
|
|
3. Pfad in .env prüfen
|
|
|
|
### **Problem: "Permission denied"**
|
|
**Lösung:**
|
|
```bash
|
|
chmod -R 755 storage/
|
|
chmod -R 755 bootstrap/cache/
|
|
chmod 664 database.sqlite
|
|
```
|
|
|
|
## 📱 Testen
|
|
|
|
### **Nach dem Setup:**
|
|
1. **URL aufrufen:** `https://ihre-domain.de/neonail`
|
|
2. **Login testen:** `admin@neonail.com`
|
|
3. **Neuen Lack erstellen**
|
|
4. **Bild-Upload testen**
|
|
5. **Mobile-Ansicht prüfen**
|
|
|
|
### **Erwartetes Ergebnis:**
|
|
- ✅ Login-Seite wird angezeigt
|
|
- ✅ Keine Verzeichnisliste mehr
|
|
- ✅ Laravel-Anwendung läuft
|
|
- ✅ Alle Funktionen funktionieren
|
|
|
|
## 🆘 Support
|
|
|
|
**Falls nichts funktioniert:**
|
|
1. Hosting-Provider kontaktieren
|
|
2. PHP-Version prüfen (8.1+)
|
|
3. mod_rewrite aktiviert?
|
|
4. .htaccess erlaubt?
|
|
|
|
---
|
|
|
|
**Viel Erfolg beim Setup! 🎉**
|