Files
ITL-Huge/README.md

221 lines
5.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# HUGE Installation und Setup
## Schnellstart
- Voraussetzungen prüfen (siehe unten)
- Abhängigkeiten installieren
- Datenbank anlegen
- Webserver auf `public/` zeigen lassen
- Starten und testen
Befehle (Beispiele):
```bash
# Composer installieren (macOS über Homebrew)
brew install composer
# Abhängigkeiten holen (im Projektordner)
composer install
# Datenbank & Tabellen anlegen
mysql -u root -p < application/_installation/01-create-database.sql
mysql -u root -p < application/_installation/02-create-table-users.sql
mysql -u root -p < application/_installation/03-create-table-notes.sql
# Rechte für Avatare (je nach OS anpassen)
# Ubuntu/Debian:
sudo chown -R www-data:www-data public/avatars
sudo chmod -R 775 public/avatars
# macOS (Apache Standardnutzer _www):
sudo chown -R _www:_www public/avatars
sudo chmod -R 775 public/avatars
```
---
## Voraussetzungen
- PHP >= 5.5 (laut composer.json)
- Composer
- Apache 2.4 mit `mod_rewrite`
- MySQL/MariaDB
- PHP-Erweiterungen: PDO + pdo_mysql, OpenSSL, mbstring
- Schreibrechte für `public/avatars/`
---
## Projekt beziehen
- Repository klonen oder entpacken
- In den Projektordner wechseln
---
## Abhängigkeiten installieren (Composer)
- Im Projektordner ausführen:
```bash
composer install
```
---
## Webserver konfigurieren (Apache)
- DocumentRoot auf `.../huge/public` setzen
- `AllowOverride All` aktivieren (damit `.htaccess` greift)
- `mod_rewrite` aktivieren
- Apache neu starten
Minimalbeispiel VirtualHost:
```apacheconf
<VirtualHost *:80>
ServerName huge.local
DocumentRoot "/pfad/zu/huge/public"
<Directory "/pfad/zu/huge/public">
AllowOverride All
Require all granted
</Directory>
SetEnv APPLICATION_ENV development
ErrorLog "${APACHE_LOG_DIR}/huge_error.log"
CustomLog "${APACHE_LOG_DIR}/huge_access.log" combined
</VirtualHost>
```
Hinweis: `.htaccess` leitet auf `public/index.php` um.
---
## Datenbank anlegen
- SQL-Skripte in dieser Reihenfolge ausführen (`application/_installation/`):
- `01-create-database.sql`
- `02-create-table-users.sql`
- `03-create-table-notes.sql`
Beispiel in der Shell:
```bash
mysql -u root -p < application/_installation/01-create-database.sql
mysql -u root -p < application/_installation/02-create-table-users.sql
mysql -u root -p < application/_installation/03-create-table-notes.sql
```
---
## Framework-Konfiguration (Entwicklung)
- Datei: `application/config/config.development.php`
- Wichtige Schlüssel:
- URL
- `URL` (Basis-URL, endet mit `/`; auto-detect möglich)
- Pfade
- `PATH_CONTROLLER`, `PATH_VIEW` (meist unverändert)
- Routing
- `DEFAULT_CONTROLLER`, `DEFAULT_ACTION`
- Datenbank
- `DB_TYPE`, `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER`, `DB_PASS`, `DB_CHARSET`
- Captcha
- `CAPTCHA_WIDTH`, `CAPTCHA_HEIGHT`
- Cookies & Session
- `COOKIE_RUNTIME`, `COOKIE_PATH`, `COOKIE_DOMAIN`, `COOKIE_SECURE`, `COOKIE_HTTP`
- `SESSION_RUNTIME`
- Avatare/Gravatar
- `USE_GRAVATAR`, `GRAVATAR_DEFAULT_IMAGESET`, `GRAVATAR_RATING`
- `AVATAR_SIZE`, `AVATAR_JPEG_QUALITY`, `AVATAR_DEFAULT_IMAGE`
- Ordner `public/avatars/` beschreibbar machen
- Sicherheit
- `ENCRYPTION_KEY`, `HMAC_SALT` (für eigene Installation ändern)
- E-Mail
- `EMAIL_USED_MAILER`, `EMAIL_USE_SMTP`
- `EMAIL_SMTP_HOST`, `EMAIL_SMTP_AUTH`, `EMAIL_SMTP_USERNAME`, `EMAIL_SMTP_PASSWORD`, `EMAIL_SMTP_PORT`, `EMAIL_SMTP_ENCRYPTION`
- `EMAIL_PASSWORD_RESET_*`, `EMAIL_VERIFICATION_*`
---
## Umgebungen (Environment)
- Klasse: `application/core/Environment.php`
- Ermittelt `APPLICATION_ENV` (Fallback: `development`)
- Weitere Datei möglich: `config.production.php`
- Apache-Variable setzen:
```apacheconf
SetEnv APPLICATION_ENV production
```
---
## Verzeichnisrechte
- `public/avatars/` beschreibbar
- Optional Logs/Uploads je nach Bedarf
---
## Starten
- Browser: `http://<host>/`
- Registrierung/Login testen
- Mailversand nur mit korrekt konfiguriertem SMTP
---
## Tests ausführen
- PHPUnit unter `vendor/bin/phpunit`
- Konfiguration: `tests/phpunit.xml`
```bash
vendor/bin/phpunit -c tests/phpunit.xml
```
---
## Häufige Probleme
- 404 bei allen Routen
- `mod_rewrite` aktivieren
- `AllowOverride All` setzen
- DocumentRoot auf `public/`
- Falsche Links/Assets
- `URL` in der Config prüfen
- Datenbankfehler
- `DB_*`-Werte und Rechte prüfen
- E-Mails kommen nicht an
- `EMAIL_USE_SMTP=true` und SMTP-Daten prüfen
- Avatare fehlen
- Schreibrechte für `public/avatars/`
---
## Option: Vagrant „One-Click-Installation“
- Ordner: `_one-click-installation/`
- Voraussetzungen: Vagrant + VirtualBox
```bash
cd _one-click-installation
vagrant up
```
- Projekt über die VM nutzen (Host/Ports laut Vagrant-Ausgabe)
---
## Struktur (Kurz)
- `public/` (Webroot, `.htaccess`, `index.php`)
- `application/controller/` (Controller)
- `application/model/` (Modelle)
- `application/view/` (Views)
- `application/config/` (Konfiguration je Environment)
- `application/_installation/` (SQL-Skripte)
- `vendor/` (Composer-Abhängigkeiten)
- `tests/` (PHPUnit)