Download as pdf
Download as pdf
You are on page 1of 6
BookStack Installation Server Setup * 16GB VPS * Server will only host 1 application (this) * Debian 9 - Stretch * 4.9.0.8 kernel * bare Linux install Requirements There's a guide for requirements and installation here apt install nginx systenctl enable nginx apt install mariadb-server php7.-mysql systenctl start mariadb systenctl enable mariadb mysql_secure_installation apt install php7.0-fpmsudo sed -i 's/;cgi.fix_pathinfo=1/cgi. fix pathinfo=0/a' /etc/php/7.0/fpn/php.iniapt install php-mbstring php-tokenizer php-nysqlnd php-gd php- simplexml php-dom php-tidy php-zip unzip Then because this is the only site being served; rm -rf /var/wi/htm rm /etc/nginx/sites-available/default rm /etc/nginx/sites-enabled/default Installing the BookStack Application Very simple, go to folder, clone git repo, be OCD about lower case and then enter the application directory cd /var/wim/git clone https://githud.con/BookStackApp/BookStack.git --branch release -- single-branch rv BookStack bookstack ed bookstack Install composer by copying the script here The SHA hash changes each time the installer is updated, so copying my commands won't help. if php -r "copy(‘https://getcomposer.org/installer’, ‘composer-setup.php');"php ~ (hash_file("SHA384", ‘composer-setup.php') " 93b54496392c062774676ac18b134c3b3a95e5a5e5c8f1a91115f203b75bf9al29dSdaasbabal3e2ccBadaes06388a8' ) {echo ‘Installer verified’; } else { echo ‘Installer corrupt’; unlink( ‘composer. setup.php'); } echo PHP_EOL; php composer-setup. php php -r “unLink(*composer-setup.php') ;" I didn't want to install it globally, so, just ran this; php composer phar ‘Once this runs successfully, do the following to get the permissions in order; cp -env.exanple .env cd .. && chown -R www-data.waw-data bookstack cd bookstack Configuring the Webserver Start by configuring mysql / mariadb (within mysql); CREATE USER ‘bookstack’@'localhost* IDENTIFIED BY ‘password’ ; CREATE DATABASE bookstack;GRANT ALL PRIVILEGES ON bookstack.* TO "bookstack'@! localhost’; FLUSH PRIVILEGES; Basic configuration to test if everything is working first; nano /etc/nginx/sites-available/docs.grchap.com. conf server ( Listen 80 default_server Listen [::]:80 default server; root /var/wwu/bookstack/public: index index.php index.html index.htm; server_name docs.grchap.com; location / { try files Suri $uri/ /index.php?squery string: > location ~ \.php$ ¢ include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.6- fpn.sockfastcgi_param SCRIPT_FILENAME Sdocument_root$fastegi_script_nane; » i In -s /ete/nginx/sites-available/docs .grchap.con.cont /etc/nginx/sites: enabled/docs..grchap.com. cont nginx -t systenctl reload nginx Finish up the installation of bookstack; php artisan key:generate php artisan migrate IMPORTANT: Login using default user and password and change the password (at least); USER: admingadmin.com PASSWORD: password Settings > Users > Admin; * change name * change password * change e-mail Save. Forcing the application over HTTPS: apt install certbot certbot certonly Run through the options that are asked, filling in required details. ep /etc/nginx/sites -available/docs.grchap.com.conf /etc/nginx/sites- available/docs.grchap.com.conf-sst nano /etc/nginx/sites-available/docs.grchap.com.conf Replace the whole configuration with this redirect; server { listen 89 default server; Listen [+:]:86 default_server; server_nane docs.grchap.com; return 361 https://shostsrequest_uri; } nano etc/nginx/sites-availabLe/docs.grchap. com.conf-ssl And replace the whole of the ss! comnfiguration with; server { Listen 443 ssl; Listen (::1:443 ssi ssl_certificate /etc/letsencrypt/live/docs grchap. com/cert.pen;ssl_certificate key /etc/Letsencrypt/Live/docs .grchap. con/privkey. pem; root /var/www/bookstack/ public; index index.php index.html index.htm; server_name docs. grchap.com; location / { try files Suri $uri/ /index.php?squery string; > location ~ \.phps { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.0-fpn.sockfastcgi_param SCRIPT_FILENAME $docunent_root$fastegi_script_name; + } nginx -t systenctl reload nginx configure auto-renewal of the certificate; crontab -e insert the following; © */12 + * + root certbot -q renew Et voila, bookstack over HTTPS, with auto-renewing free SSL certificate. Configuring Bookstack In Settings; * Change "Application Name" * Change the color (using; #2C3E50 currently) * Page editor - Markdown (from HTML) * Check registration is off * Check public viewing is off can configure new users if required. Revision #9 Created 7 months ago by Glenn Up ‘7 months ago by Glenn

You might also like