BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
14.3k stars 1.81k forks source link

Bookstack breaks when adding SSL #2428

Closed luizaq closed 3 years ago

luizaq commented 3 years ago

Description: Whenever adding ssl or tls bookstack would show either the giant icons (which there are old issues #996 and #879) Installation was made using apache and the default script on ubuntu 18.4 and 20.4 . Giant Icons- When this happened it the failed to load app.js in the public/dist folder. error continued after re-downloading all files in this folder. Blank page: When the blank page was present , it was an error 500. The http requests weren't being routed to https. Steps and verifications. The url was set correctly in the .env file. Apache settings:


`<VirtualHost *:80>
    ServerName mydomain.dev

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/bookstack/public/

    <Directory /var/www/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 /error.log
    CustomLog /access.log combined

</VirtualHost>`
whenever using just http it worked perfectly. But everytime after adding TLS it would present either the blank page or the giant icons.

Used certibot and lets encrypt .
ssddanbrown commented 3 years ago

Hi @luizaq,

Installation was made using apache and the default script on ubuntu 18.4 and 20.4 .

You've ran both scripts or have installed on one system then re-installed on another?

luizaq commented 3 years ago

2 separate installs, same error will try those steps , thank you for the reply @ssddanbrown

vmarlier commented 3 years ago

Hello,

Same here, http 500 when TLS is set. .env file is correctly set and permissions are okay on the mentioned folders/files.

I am running bookstack with a docker image (solidnerd) in kubernetes. Working well with http but not with https.

luizaq commented 3 years ago

I got it working! My best theory as to why it finally worked is that installed the script with the ip address as a server name and moved it to my domain after.

Heres more details in case it might help anyone.

In ubuntu 20 used the Appropriated script .no update. i set Bookstack server name to the server ip adress , because i was over it. Decided to try to move it to my domain.(i own a .dev domain so SSL is required)

All of these steps i took were based on this tutorial: https://nickolas.gupton.xyz/2020/05/21/ubuntu-20.04-bookstack.html 1-Generated the certificate 2-Changed the info on the .conf file and then the .env

Overall the same steps i took quite a few times before, but this time it worked, as if it was mocking me.

Few notes about probably irrelevant steps: I used VIM instead of nano. I didnt run apt upgrade . So the configuration is the stock ubuntu 20. Digital Ocean droplet

ssddanbrown commented 3 years ago

Good news @luizaq! Glad to hear you got things working. I'll therefore close this off.