Skip to main content

installare BookStack step by step

Requisiti Base:

  • Debian Trixie 

  • Apache2

  • PHP

  • MariaDb

Aggiornare il server e installare le dipendenze:
sudo apt update && sudo apt upgrade -y
sudo apt install php-fpm php-mysql php-curl php-mbstring php-gd php-xml php-zip php-tidy php-intl php-bcmath git unzip -y

Configurare il Database (MariaDB):
sudo mysql -u root -p
CREATE DATABASE bookstack;
CREATE USER 'bookstack'@'localhost' IDENTIFIED BY 'password_sicura';
GRANT ALL PRIVILEGES ON bookstack.* TO 'bookstack'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Scaricare BookStack:
cd /var/www/html
sudo git clone https://github.com/BookStackApp/BookStack.git --branch release --single-branch bookstack
cd /var/www/html/bookstack
Installa le dipendenze PHP (Composer):
sudo apt install composer -y
sudo -u www-data composer install --no-dev --prefer-dist
Prepara l'Ambiente:
sudo cp .env.example .env
sudo nano .env # Modificare i dettagli DB e l'URL
sudo php artisan key:generate # rispondi YES selezionandolo con tasto tab della tastiera
sudo php artisan migrate # rispondi YES selezionandolo con tasto tab della tastiera
Imposta i permessi:
sudo chown -R www-data:www-data /var/www/html/bookstack
Imposta Apache2:
cd /etc/apache2/sites-available
sudo vi nome_che_scegli.conf  # usa il tuo editor preferito, io uso vi

all'interno ci scrivi:

<VirtualHost *:80>

	# This is a simple example of an Apache VirtualHost configuration
	# file that could be used with BookStack.
	# This assumes mod_php AND mod_rewrite have been installed and enabled.
	#
	# Change the "docs.example.com" usage in the "ServerName" directive
	# to be your web domain for BookStack.
	#
	# Change the "/var/www/bookstack/public/", used twice below, to the
	# location of the "public" folder within your BookStack installation.
	#
	# This configuration is only for HTTP, Not HTTPS.
	# For HTTPS we recommend using https://certbot.eff.org/

	ServerName docs.example.com  # SOSTITUIRE CON TUO DOMINO #
	DocumentRoot /var/www/html/bookstack/public/

	<Directory /var/www/html/bookstack/public/>
		Options Indexes FollowSymLinks
		AllowOverride None
		Require all granted
		<IfModule mod_rewrite.c>
			<IfModule mod_negotiation.c>
				Options -MultiViews -Indexes
			</IfModule>

			RewriteEngine On

			# Handle Authorization Header
			RewriteCond %{HTTP:Authorization} .
			RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

			# Redirect Trailing Slashes If Not A Folder...
			RewriteCond %{REQUEST_FILENAME} !-d
			RewriteCond %{REQUEST_URI} (.+)/$
			RewriteRule ^ %1 [L,R=301]

			# Handle Front Controller...
			RewriteCond %{REQUEST_FILENAME} !-d
			RewriteCond %{REQUEST_FILENAME} !-f
			RewriteRule ^ index.php [L]
		</IfModule>
	</Directory>

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

-------------------------------

UNA VOLTA SALVATO, DAI QUESTI COMANDI:

sudo a2ensite nome_che_scegli.conf
sudo sudo systemctl reload apache2

a questo punto, vai con il browser su: http://tuonomesito (quello che hai indicato nel virtualhost)

al primo login inserire come user: admin@admin.com e come password: password RICORDATI DI CAMBIARLE APPENA LOGGATO. 

una volta inserito i cambiamenti e le tue personalizzazione, fai il logout e vedrai il tuo Wiki pronto!