fresh installation - 404 error on /login redirect #4868

Closed
opened 2026-02-05 09:22:23 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @Zummi-Sinclair on GitHub (Jul 10, 2024).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

Bookstack was recently installed on a raspberry pi following the manual instructions. I use mariaDB and apache2 as the web server. Unfortunately, even after searching for a long time, I cannot find the error. I had already temporarily installed bookstack in my company under an earlier version and everything works fine.

.env file:

APP_KEY=base64:OJvr8wpihzxe4Q4vtk04jvYhPOZkaDJ6AfO2Q0I5zy8=

APP_URL=http://bookstack.local
DB_HOST=localhost
DB_DATABASE=bookstack
DB_USERNAME=string
DB_PASSWORD=string
MAIL_DRIVER=smtp
MAIL_FROM_NAME="BookStack"
MAIL_FROM=bookstack@example.com
MAIL_HOST=localhost
MAIL_PORT=587
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

apach2 virtual host block

<VirtualHost *:80>
        #ServerName bookstack.local
        #ServerAdmin webmaster@localhost
        #DocumentRoot /var/www/html
        DocumentRoot /var/www/html/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 ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Exact BookStack Version

v24.05.2

Log Content

The only error message I get from time to time is this. I have reinstalled MariaDB several times and deleted dependencies, but the error still persists. Unfortunately, the help described on Stack Overflow doesn't work either.

PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /usr/lib/php/20220829/pdo_mysql (/usr/lib/php/20220829/pdo_mysql: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/pdo_mysql.so (/usr/lib/php/20220829/pdo_mysql.so: undefined symbol: pdo_parse_params)) in Unknown on line 0

Hosting Environment

PHP 8.2.20 (cli) (built: Jun 17 2024 13:33:14) (NTS)
Server version: Apache/2.4.59 (Debian)
Server version: 10.11.6-MariaDB-0+deb12u1 Debian 12
Composer version 2.7.7 2024-06-10 22:11:12
OS: NAME="Debian GNU/Linux" VERSION="12 (bookworm)"

Network Traffic

image

Originally created by @Zummi-Sinclair on GitHub (Jul 10, 2024). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario Bookstack was recently installed on a raspberry pi following the manual instructions. I use mariaDB and apache2 as the web server. Unfortunately, even after searching for a long time, I cannot find the error. I had already temporarily installed bookstack in my company under an earlier version and everything works fine. .env file: ```bash APP_KEY=base64:OJvr8wpihzxe4Q4vtk04jvYhPOZkaDJ6AfO2Q0I5zy8= APP_URL=http://bookstack.local DB_HOST=localhost DB_DATABASE=bookstack DB_USERNAME=string DB_PASSWORD=string MAIL_DRIVER=smtp MAIL_FROM_NAME="BookStack" MAIL_FROM=bookstack@example.com MAIL_HOST=localhost MAIL_PORT=587 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null ``` apach2 virtual host block ```apache <VirtualHost *:80> #ServerName bookstack.local #ServerAdmin webmaster@localhost #DocumentRoot /var/www/html DocumentRoot /var/www/html/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 ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> ``` ### Exact BookStack Version v24.05.2 ### Log Content The only error message I get from time to time is this. I have reinstalled MariaDB several times and deleted dependencies, but the error still persists. Unfortunately, the help described on Stack Overflow doesn't work either. PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /usr/lib/php/20220829/pdo_mysql (/usr/lib/php/20220829/pdo_mysql: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/pdo_mysql.so (/usr/lib/php/20220829/pdo_mysql.so: undefined symbol: pdo_parse_params)) in Unknown on line 0 ### Hosting Environment PHP 8.2.20 (cli) (built: Jun 17 2024 13:33:14) (NTS) Server version: Apache/2.4.59 (Debian) Server version: 10.11.6-MariaDB-0+deb12u1 Debian 12 Composer version 2.7.7 2024-06-10 22:11:12 OS: NAME="Debian GNU/Linux" VERSION="12 (bookworm)" ### Network Traffic ![image](https://github.com/BookStackApp/BookStack/assets/51134288/7ef9c5ab-e741-48cc-91c4-376eccbe38b7)
OVERLORD added the 🐕 Support label 2026-02-05 09:22:23 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jul 12, 2024):

Hi @Zummi-Sinclair,

  • Does http://bookstack.local for sure lead to the BookStack host machine when accessed in the browser?
  • Can you check mod_rewrite is enabled:
    • sudo a2enmod rewrite then sudo systemctl restart apache2.service
@ssddanbrown commented on GitHub (Jul 12, 2024): Hi @Zummi-Sinclair, - Does `http://bookstack.local` for sure lead to the BookStack host machine when accessed in the browser? - Can you check mod_rewrite is enabled: - `sudo a2enmod rewrite` then `sudo systemctl restart apache2.service`
Author
Owner

@Zummi-Sinclair commented on GitHub (Jul 13, 2024):

Hello @ssddanbrown,

  • Yes, I host a down DNS server and it works fine :)
  • Yes, mod_rewrite is also enabled
  • And I fixed the php error for pdo_mysql. The problem was I enabled the extension in both php.ini files (apache2, cli). But bookstack is not running, he can load two js files but not the login file.

2024-07-13 12_20_55-Mail

2024-07-13 12_24_40-PHP 8 2 20 - phpinfo()

@Zummi-Sinclair commented on GitHub (Jul 13, 2024): Hello @ssddanbrown, - Yes, I host a down DNS server and it works fine :) - Yes, mod_rewrite is also enabled - And I fixed the php error for pdo_mysql. The problem was I enabled the extension in both php.ini files (apache2, cli). But bookstack is not running, he can load two js files but not the login file. ![2024-07-13 12_20_55-Mail](https://github.com/user-attachments/assets/fefa67a1-3bfa-4c38-8d7b-d5c4cec6747a) ![2024-07-13 12_24_40-PHP 8 2 20 - phpinfo()](https://github.com/user-attachments/assets/20232bd5-3a31-400f-8bc1-fd286a823309)
Author
Owner

@ssddanbrown commented on GitHub (Jul 13, 2024):

Thanks for confirming @Zummi-Sinclair.

Looking over your config again, I can see an issue with the paths in the apache config for BookStack.
The paths for the DocumentRoot and <Directory definition are out of alignment.
Update both of these to point to the actual public folder of the BookStack install (then save and restart apache).

@ssddanbrown commented on GitHub (Jul 13, 2024): Thanks for confirming @Zummi-Sinclair. Looking over your config again, I can see an issue with the paths in the apache config for BookStack. The paths for the `DocumentRoot` and `<Directory` definition are out of alignment. Update both of these to point to the actual `public` folder of the BookStack install (then save and restart apache).
Author
Owner

@Zummi-Sinclair commented on GitHub (Jul 14, 2024):

@ssddanbrown That's it thanks, I overlooked the error.

@Zummi-Sinclair commented on GitHub (Jul 14, 2024): @ssddanbrown That's it thanks, I overlooked the error.
Author
Owner

@Zummi-Sinclair commented on GitHub (Jul 14, 2024):

.

@Zummi-Sinclair commented on GitHub (Jul 14, 2024): .
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4868