Installation Guide
Komplette Anleitung zur Installation und Einrichtung der Appiyon-Plattform.
System Requirements
- PHP: 8.2 oder höher
- PostgreSQL: 16 oder höher
- Composer: 2.x
- Apache: 2.4+ mit mod_rewrite ODER Nginx
- Git: Für Version Control
PHP Extensions (Required)
bash
php -m | grep -E "pdo|pdo_pgsql|intl|mbstring|xml|zip|curl|json|tokenizer|ctype"Alle müssen vorhanden sein:
- pdo
- pdo_pgsql
- intl
- mbstring
- xml
- zip
- curl
- json
- tokenizer
- ctype
- opcache (empfohlen)
Installation Steps
1. Repository clonen
bash
cd /var/www/vhosts/canshare.me/appiyon.com
git clone <repository-url> appisym
cd appisym2. Composer Dependencies installieren
bash
composer installBei Problemen:
bash
composer install --no-scripts
composer install3. Environment konfigurieren
bash
# .env.local erstellen
cp .env .env.local.env.local bearbeiten:
bash
APP_ENV=dev
APP_SECRET=<generiere-mit: php -r "echo bin2hex(random_bytes(16));">
DATABASE_URL="postgresql://appiyonadmin:password@127.0.0.1:5432/symfony?serverVersion=16&charset=utf8"
ADMIN_DOMAIN=localhost:8000
MAILER_DSN=smtp://localhost:1025
MESSENGER_TRANSPORT_DSN=doctrine://defaultSiehe auch: Environment Setup
4. PostgreSQL Database einrichten
bash
# Als postgres User
sudo -u postgres psql
-- User erstellen
CREATE USER appiyonadmin WITH PASSWORD 'secure_password';
-- Database erstellen
CREATE DATABASE symfony OWNER appiyonadmin;
-- Privileges
GRANT ALL PRIVILEGES ON DATABASE symfony TO appiyonadmin;
\c symfony
GRANT ALL ON SCHEMA public TO appiyonadmin;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO appiyonadmin;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO appiyonadmin;
\qOder via Symfony Command:
bash
php bin/console doctrine:database:createSiehe auch: Database Setup
5. Migrations ausführen
bash
php bin/console doctrine:migrations:migrate --no-interactionPrüfen:
bash
php bin/console doctrine:schema:validate6. Ersten Admin erstellen
bash
php bin/console admin:createInteraktiv Name, Email und Passwort eingeben.
Oder non-interaktiv:
bash
php bin/console admin:create \
--name="Super Admin" \
--email="admin@appiyon.com" \
--password="SecureP@ss123"7. Assets installieren (falls vorhanden)
bash
php bin/console assets:install --symlink public8. Cache aufwärmen
bash
php bin/console cache:warmup9. Permissions setzen
bash
# var/ und public/ beschreibbar machen
chmod -R 775 var/ public/
chown -R www-data:www-data var/ public/
# Oder für Development
chmod -R 777 var/ public/10. Webserver konfigurieren
Apache
.htaccess prüfen:
bash
ls -la public/.htaccessSollte existieren und mod_rewrite Rules enthalten.
VirtualHost (falls nötig):
apache
<VirtualHost *:80>
ServerName appisym.go4family.net
DocumentRoot /var/www/vhosts/canshare.me/appiyon.com/appisym/public
<Directory /var/www/vhosts/canshare.me/appiyon.com/appisym/public>
AllowOverride All
Require all granted
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</Directory>
ErrorLog ${APACHE_LOG_DIR}/appiyon-error.log
CustomLog ${APACHE_LOG_DIR}/appiyon-access.log combined
</VirtualHost>mod_rewrite aktivieren:
bash
sudo a2enmod rewrite
sudo systemctl restart apache2Nginx
nginx
server {
listen 80;
server_name appisym.go4family.net;
root /var/www/vhosts/canshare.me/appiyon.com/appisym/public;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php(/|$) {
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
internal;
}
location ~ \.php$ {
return 404;
}
error_log /var/log/nginx/appiyon-error.log;
access_log /var/log/nginx/appiyon-access.log;
}Plesk
- Öffne Domain-Einstellungen
- Gehe zu "Apache & Nginx Settings"
- Setze Document Root:
/var/www/vhosts/canshare.me/appiyon.com/appisym/public - Speichern
Siehe: Troubleshooting Admin
11. Testen
bash
# CLI
php bin/console about
# Web
curl http://localhost:8000
# Admin-Panel
curl https://appisym.go4family.net/adminDevelopment Setup
Symfony CLI (Empfohlen)
bash
# Installieren
wget https://get.symfony.com/cli/installer -O - | bash
# Server starten
symfony serve
# Mit SSL
symfony serve --allow-httpÖffne: https://localhost:8000
PHP Built-in Server (Alternative)
bash
cd public/
php -S localhost:8000Docker (Optional)
yaml
# docker-compose.yml
version: '3.8'
services:
app:
build: .
ports:
- "8000:80"
volumes:
- .:/var/www/html
environment:
- APP_ENV=dev
- DATABASE_URL=postgresql://appiyon:appiyon@db:5432/appiyon
depends_on:
- db
db:
image: postgres:16
environment:
POSTGRES_USER: appiyon
POSTGRES_PASSWORD: appiyon
POSTGRES_DB: appiyon
ports:
- "5432:5432"
volumes:
- db-data:/var/lib/postgresql/data
volumes:
db-data:bash
docker-compose up -dPost-Installation
1. Code Style
bash
# PHP-CS-Fixer installieren (falls nicht via Composer)
composer require --dev friendsofphp/php-cs-fixer
# Code-Style prüfen
vendor/bin/php-cs-fixer fix --dry-run --diff
# Code-Style anwenden
vendor/bin/php-cs-fixer fix2. PHPStan (Static Analysis)
bash
composer require --dev phpstan/phpstan
# Analyse durchführen
vendor/bin/phpstan analyse src3. Tests einrichten
bash
# Test-Database
php bin/console doctrine:database:create --env=test
php bin/console doctrine:migrations:migrate --env=test --no-interaction
# Tests ausführen
vendor/bin/phpunit4. Git Hooks (Optional)
bash
# Pre-commit Hook
cat > .git/hooks/pre-commit << 'EOF'
#!/bin/bash
vendor/bin/php-cs-fixer fix --dry-run --diff
vendor/bin/phpstan analyse src
EOF
chmod +x .git/hooks/pre-commitProduction Setup
1. APP_ENV=prod setzen
bash
# Via Symfony Secrets
php bin/console secrets:set APP_ENV --env=prod
# Value: prod
# Via Server Environment
# Apache: SetEnv APP_ENV prod
# Nginx: fastcgi_param APP_ENV prod2. Cache optimieren
bash
# Cache leeren und warmup
php bin/console cache:clear --env=prod
php bin/console cache:warmup --env=prod3. Assets optimieren
bash
# Wenn Webpack Encore verwendet wird
npm run build4. OPcache aktivieren
ini
; php.ini
opcache.enable=1
opcache.memory_consumption=256
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=20000
opcache.validate_timestamps=0 ; Production5. Permissions
bash
chown -R www-data:www-data .
chmod -R 755 .
chmod -R 775 var/6. Security
bash
# APP_SECRET neu generieren
php -r "echo bin2hex(random_bytes(32));"
# In Symfony Secrets speichern
php bin/console secrets:set APP_SECRET --env=prodTroubleshooting
Composer Install Fehler
bash
# Memory Limit erhöhen
php -d memory_limit=-1 /usr/local/bin/composer install
# Autoloader regenerieren
composer dump-autoloadPermission Denied
bash
# Besitzer prüfen
ls -la var/
# Besitzer ändern
chown -R www-data:www-data var/ public/Database Connection Error
bash
# Verbindung testen
psql -U appiyonadmin -d symfony -h localhost
# DATABASE_URL prüfen
php bin/console debug:container --env-var=DATABASE_URL
# Sonderzeichen in Passwort escapen
# @ = %40, # = %23, $ = %24, etc.500 Internal Server Error
bash
# Logs prüfen
tail -f var/log/dev.log
tail -f /var/log/apache2/error.log
# Debug-Modus aktivieren
# .env.local
APP_DEBUG=1404 auf /admin
Siehe: Troubleshooting Admin - 404 Not Found
Update/Upgrade
bash
# Dependencies aktualisieren
composer update
# Neue Migrations
php bin/console doctrine:migrations:migrate
# Cache leeren
php bin/console cache:clearUninstall
bash
# Database löschen
php bin/console doctrine:database:drop --force
# Verzeichnis löschen
cd ..
rm -rf appisym
# PostgreSQL User löschen (optional)
sudo -u postgres psql -c "DROP USER appiyonadmin;"Checkliste
- [ ] PHP 8.2+ mit allen Extensions
- [ ] PostgreSQL 16+ installiert
- [ ] Composer installiert
- [ ] Repository gecloned
- [ ]
composer installausgeführt - [ ]
.env.localkonfiguriert - [ ] Database erstellt und User konfiguriert
- [ ] Migrations ausgeführt
- [ ] Schema validiert
- [ ] Erster Admin erstellt
- [ ] Permissions gesetzt
- [ ] Webserver konfiguriert (Document Root auf public/)
- [ ] mod_rewrite aktiviert (Apache)
- [ ] .htaccess vorhanden in public/
- [ ] Admin-Panel erreichbar
- [ ] Logs prüfen (keine Fehler)
Nächste Schritte
- Environment Setup - Environment-Variablen konfigurieren
- Database Setup - Datenbank-Management
- Troubleshooting - Probleme lösen
- Development Guides - Mit der Entwicklung starten
Support
Bei Problemen:
- Troubleshooting Admin
- Known Issues
- Logs prüfen:
var/log/dev.log