๐Ÿ“šBookStack

Let's setup a BookStack web server!

BookStack is an open-source platform for creating and managing documentation. It allows users to organize and share information in a simple and intuitive way.

Features

  • Simple and easy-to-use interface

  • Collaboration and permission controls

  • Versioning and revision history

  • Customizable branding and appearance

  • Integrations with external services

Getting Started

  1. Download and install BookStack on your server or hosting platform.

  2. Create an admin account and set up your organization or personal documentation space.

  3. Start creating and organizing pages and books.

  4. Invite collaborators and set permissions as needed.

  5. Customize the appearance and branding of your BookStack instance.

Resources

Example Use Case

BookStack can be used for creating and managing internal documentation for a company, such as policies, procedures, and guidelines. It can also be used for creating and sharing knowledge base for a product or service, or for creating and managing a personal documentation space.

Installation

#!/bin/bash
MP_ROOT_MDB=12345678
MP_MARIADB=bookstack
urlbookstack=https://wiki.papinutto.local
MDB_Database=bookstack
MDB_USER=bookstack
fqdn=wiki.papinutto.local

######################################### Tรฉlรฉchargement de mariadb nginx gir et composer #########################################
cd ~/
sudo apt install lynx mariadb-server-10.5 mariadb-client-10.5 nginx git php7.4-fpm php7.4-curl php7.4-mbstring php7.4-ldap php7.4-xml php7.4-zip php7.4-mysql php7.4-gd composer -y

### Paramรฉtrage des services pour dรฉmarrer automatiquement

sudo systemctl enable nginx
sudo systemctl enable mariadb
sudo systemctl enable php7.4-fpm

### Dรฉmarrage des services

sudo systemctl start nginx
sudo systemctl start mariadb
sudo systemctl start php7.4-fpm

######################################### Configuration de la basse SQL MariaDB #########################################

### Sรฉcurisation de Mariadb

sudo mysql_secure_installation << EOF
${MP_ROOT_MDB}
Y
Y
${MP_ROOT_MDB}
${MP_ROOT_MDB}
Y
Y
Y
Y
EOF

### Crรฉation de la basse Mariadb

sudo mysql -u root --execute="CREATE DATABASE $MDB_Database;"
sudo mysql -u root --execute="CREATE USER '$MDB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$MP_MARIADB');"
sudo mysql -u root --execute="GRANT ALL ON bookstack.* TO '$MDB_USER'@'localhost';FLUSH PRIVILEGES;"

######################################### Config BookStack #########################################

### Installations BookStack

cd ~/
git clone https://github.com/BookStackApp/BookStack.git --branch release --single-branch bookstack
cd bookstack
composer install --no-dev
cp .env.example .env
sudo chown -Rv www-data:www-data storage bootstrap/cache public/uploads

### Edition fichier de conf Bootstack

sed -i -e "s;APP_URL=https://example.com;APP_URL=${urlbookstack};g" .env
sed -i -e "s;DB_DATABASE=database_database;DB_DATABASE=${MDB_Database};g" .env
sed -i -e "s;DB_USERNAME=database_username;DB_USERNAME=${MDB_USER};g" .env
sed -i -e "s;DB_PASSWORD=database_user_password;DB_PASSWORD=${MP_MARIADB};g" .env
cd ~/
sudo mv bookstack/ /var/www/bookstack

### Configuration clef PHP

cd /var/www/bookstack
php artisan key:generate << EOF
yes
EOF
php artisan migrate << EOF
yes
EOF

######################################### Config NGINX HTTPS #########################################

### Crรฉation du certificat et de la clef SSL autosigner

sudo openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=NA/ST=None/L=None/O=None/CN=${fqdn}" -keyout /etc/ssl/private/bookstack-selfsigned.key -out /etc/ssl/certs/bookstack-selfsigned.crt

### Delink le fichier default

sudo unlink /etc/nginx/sites-enabled/default

### Config Nginx pour BookStack

sudo cp ~/site-web/bookstack-nginx.conf /etc/nginx/sites-available/
sudo ln -s /etc/nginx/sites-available/bookstack-nginx.conf /etc/nginx/sites-enabled/bookstack-nginx.conf
sudo sed -i -e "s;ssl_certificate /etc/ssl/certs/self-sign-SSL-or-public-ssl.crt;ssl_certificate /etc/ssl/certs/bookstack-selfsigned.crt;g" /etc/nginx/sites-available/bookstack-nginx.conf
sudo sed -i -e "s;ssl_certificate_key /etc/ssl/private/self-sign-SSL-or-public-ssl.key;ssl_certificate_key /etc/ssl/private/bookstack-selfsigned.key;g" /etc/nginx/sites-available/bookstack-nginx.conf
sudo sed -i -e "s;server_name your_servers_name.domain.com;server_name $fqdn;g" /etc/nginx/sites-available/bookstack-nginx.conf

### Dรฉmarrage des services

sudo systemctl restart nginx
sudo systemctl restart mariadb
sudo systemctl restart php7.4-fpm

######################################### Documentation et lien utile #########################################
#Executer en utilisateur normal 
#Remplir les variables avant d'รฉxecuter
#placer le fichier site web ร  la racine de l'utilisateur /home/user/
#Penser ร  รฉditer le fichier /etc/hosts
#https://dchan.tech/books/bookstack/page/manual-installation-on-debian-11

Last updated