hubzilla-nginx-v0.2

This commit is contained in:
2025-05-20 19:30:00 +02:00
parent a148a8a1ad
commit 6f6cc8fc63
4 changed files with 36 additions and 28 deletions

View File

@@ -1,12 +0,0 @@
<VirtualHost *:80>
ServerName yourdomain.com
DocumentRoot /var/www/html
<Directory /var/www/html>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

20
src/hubzilla-nginx.conf Normal file
View File

@@ -0,0 +1,20 @@
server {
listen 80;
server_name localhost;
root /hubzilla-src;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}

View File

@@ -1,12 +0,0 @@
<VirtualHost *:80>
ServerName yourdomain.com
DocumentRoot /var/www/html
<Directory /var/www/html>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

View File

@@ -1,7 +1,19 @@
#!/bin/bash #!/bin/bash
# Démarrage du service Apache # Copie automatique si le volume bindé est vide
service apache2 start if [ ! "$(ls -A /var/www/html)" ]; then
echo "📁 Volume vide, initialisation des fichiers Hubzilla..."
cp -a /hubzilla-src/. /var/www/html/
chown -R www-data:www-data /var/www/html/
else
echo "📁 Volume déjà initialisé."
fi
# Attente indéfinie pour maintenir le conteneur en cours d'exécution # Démarrage des services PHP-FPM et Nginx
echo "🚀 Démarrage des services PHP-FPM et Nginx..."
service php8.2-fpm start
service nginx start
# Maintien du conteneur actif
echo "📡 En attente (container actif)..."
tail -f /dev/null tail -f /dev/null