CMS/BookStack
Entwicklung Server
sudo apt-get install php-mysql
Mysql Datenbank Einrichten
sudo mysql
CREATE DATABASE bookstack CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'thorsten'@'localhost' IDENTIFIED BY 'DEIN_STARKES_PASSWORT';
GRANT ALL PRIVILEGES ON bookstack.* TO 'thorsten'@'localhost';
FLUSH PRIVILEGES;
BookStack herunterladen
sudo git clone https://source.bookstackapp.com/bookstack.git --branch release --single-branch bookstack
cd bookstack
sudo composer install --no-dev
sudo cp .env.example .env
Konfiguration von BookStack
sudo nano .env
Dateiberechtigungen setzen
sudo chmod 777 -R storage
sudo chmod 777 -R bootstrap/cache
sudo chmod 777 -R public/uploads
sudo chown -R www-data:www-data storage bootstrap/cache
Artisan Nutzen
php artisan key:generate --force --no-interaction
php artisan migrate --force --no-interaction
Nginx Einstellung
sudo nano /etc/nginx/conf.d/bookstack.conf
Geben Sie Folgendes in die Datei `/etc/nginx/conf.d/bookstack.conf` ein:
server {
listen 80;
listen [::]:80;
server_name bookstack.localhost;
root /var/www/bookstack/public;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.4-fpm.sock;
}
}
Datenbank Übertragen auf dem Server
Auf dem Server
mysql -u root -p
CREATE USER 'BENUTZERNAME'@'localhost' IDENTIFIED BY 'DEIN_STARKES_PASSWORT';
CREATE DATABASE DATENBANKNAME CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT PROCESS ON *.* TO 'BENUTZERNAME'@'localhost';
FLUSH PRIVILEGES;
Auf dem Entwicklungsserver
mysqldump -u BENUTZERNAME -p DATENBANKNAME > backup.sql
scp backup.sql thorsten@Servername:/home/thorsten/backup.sql
rsync -avz --exclude '.env' --exclude 'vendor/' /var/www/bookstack/ user@prod:/var/www/bookstack/
composer install
sudo cp .env.example .env
sudo nano .env
Auf dem Server
mysql -u thorsten -p DATENBANKNAME < backup.sql
Nginx Einstellung
sudo nano /etc/nginx/conf.d/bookstack.conf
Geben Sie Folgendes in die Datei `/etc/nginx/conf.d/bookstack.conf` ein:
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name bookstack.ahrensburg.city
root /var/www/bookstack/public;
index index.php index.html;
ssl_certificate /etc/letsencrypt/live/ahrensburg.city/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ahrensburg.city/privkey.pem;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}
}
Kategorien:
Keine
Zuletzt aktualisiert am 26.01.2026 23:53