404 when trying to access BookStack - Windows 10 install #3805

Closed
opened 2026-02-05 07:31:30 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @phelgren on GitHub (May 18, 2023).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

I am running on Windows 10 to give BookStack a try before I install on my server. I followed the step by step manual installation, and even a YouTube video, about a year old, that seems to do exactly what I had done except it used XAMPP.

Running Windows NT 10.0 build 19045 (Windows 10) AMD64
Apache/2.4.57 (Win64) PHP/8.2.6 MariaDB 10.4

Install went smoothly. I am not using the .htaccess file and I AM using the httpd-vhosts.conf. The only significant entry from the .env file is

APP_URL=http://localhost/bookstack

The migration produced the correct tables.

vhosts has this:

Listen 80

<VirtualHost localhost:80>

	DocumentRoot "E:\www\BookStack\public"

	<Directory "E:\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>

    Define APACHE_LOG_DIR "E:\Apache Software Foundation\Apache24\logs"

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

</VirtualHost>

httpd.conf is pretty vanilla with these entries which were changed from the defaults:

DocumentRoot "E:\www\htdocs"
<Directory "E:\www\htdocs">

I am pretty sure the vhosts file is correctly directing and re-directing. If I type in http://localhost I am redirected to:

http://localhost/bookstack/login

But I get a 404 error. As a "smoke test" I renamed the index.php file in the public folder temporarily and then created an index.php with the classic:

<?php phpinfo(); ?>

When I go to http://localhost it displays the PHP Info page. So, AFAICT Apache and PHP are properly installed and the directory structure seems to be OK.

I found multiple online references to 404 errors with BookStack, only a few recent with Windows 10 and none that solved the issue...

Exact BookStack Version

v23.05.1

Log Content

No logs of any value either in error.log or access.log Nothing in laravel.log either. Nothing in Event Viewer for applications

PHP Version

8.6.2

Hosting Environment

Windows NT 10.0 build 19045 (Windows 10) AMD64

Originally created by @phelgren on GitHub (May 18, 2023). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario I am running on Windows 10 to give BookStack a try before I install on my server. I followed the step by step manual installation, and even a YouTube video, about a year old, that seems to do exactly what I had done except it used XAMPP. Running Windows NT 10.0 build 19045 (Windows 10) AMD64 Apache/2.4.57 (Win64) PHP/8.2.6 MariaDB 10.4 Install went smoothly. I am not using the .htaccess file and I AM using the httpd-vhosts.conf. The only significant entry from the .env file is APP_URL=http://localhost/bookstack The migration produced the correct tables. vhosts has this: ```apache Listen 80 <VirtualHost localhost:80> DocumentRoot "E:\www\BookStack\public" <Directory "E:\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> Define APACHE_LOG_DIR "E:\Apache Software Foundation\Apache24\logs" ErrorLog "${APACHE_LOG_DIR}/error.log" CustomLog "${APACHE_LOG_DIR}/access.log" combined </VirtualHost> ``` httpd.conf is pretty vanilla with these entries which were changed from the defaults: ``` DocumentRoot "E:\www\htdocs" <Directory "E:\www\htdocs"> ``` I am pretty sure the vhosts file is correctly directing and re-directing. If I type in http://localhost I am redirected to: http://localhost/bookstack/login But I get a 404 error. As a "smoke test" I renamed the index.php file in the public folder temporarily and then created an index.php with the classic: <?php phpinfo(); ?> When I go to http://localhost it displays the PHP Info page. So, AFAICT Apache and PHP are properly installed and the directory structure *seems* to be OK. I found multiple online references to 404 errors with BookStack, only a few recent with Windows 10 and none that solved the issue... ### Exact BookStack Version v23.05.1 ### Log Content No logs of any value either in error.log or access.log Nothing in laravel.log either. Nothing in Event Viewer for applications ### PHP Version 8.6.2 ### Hosting Environment Windows NT 10.0 build 19045 (Windows 10) AMD64
OVERLORD added the 🐕 Support label 2026-02-05 07:31:30 +03:00
Author
Owner

@ssddanbrown commented on GitHub (May 18, 2023):

Hi @phelgren,
Is there any reason for having /bookstack on the end of your APP_URL? Subdirectory usage is a bit more complex and, looking at your apache config, it is not set up for subdirectory usage.

If you update APP_URL to just APP_URL=http://localhostdoes that get things working as expected?

@ssddanbrown commented on GitHub (May 18, 2023): Hi @phelgren, Is there any reason for having `/bookstack` on the end of your `APP_URL`? Subdirectory usage is a bit more complex and, looking at your apache config, it is not set up for subdirectory usage. If you update `APP_URL` to just `APP_URL=http://localhost`does that get things working as expected?
Author
Owner

@phelgren commented on GitHub (May 18, 2023):

No reason really. So I have shortened it to just the APP_URL=http://localhost. I also moved the directives from the vhosts file in to the httpd.conf to simplify the configuration. So the document root and the entries in httpd.conf matched the vhosts file and then I commented out the vhost file reference.

http://localhost still redirects to http://localhost/login with a 404 access.log has this:

127.0.0.1 - - [18/May/2023:09:48:42 -0500] "GET / HTTP/1.1" 302 334
127.0.0.1 - - [18/May/2023:09:48:42 -0500] "GET /login HTTP/1.1" 404 196

@phelgren commented on GitHub (May 18, 2023): No reason really. So I have shortened it to just the APP_URL=http://localhost. I also moved the directives from the vhosts file in to the httpd.conf to simplify the configuration. So the document root and the <Directory> entries in httpd.conf matched the vhosts file and then I commented out the vhost file reference. http://localhost still redirects to http://localhost/login with a 404 access.log has this: 127.0.0.1 - - [18/May/2023:09:48:42 -0500] "GET / HTTP/1.1" 302 334 127.0.0.1 - - [18/May/2023:09:48:42 -0500] "GET /login HTTP/1.1" 404 196
Author
Owner

@ssddanbrown commented on GitHub (May 18, 2023):

I get the impression that maybe the mod_rewrite apache module is not active/enabled.
Not totally sure how to activate that in a windows-based apache environment though.

@ssddanbrown commented on GitHub (May 18, 2023): I get the impression that maybe the `mod_rewrite` apache module is not active/enabled. Not totally sure how to activate that in a windows-based apache environment though.
Author
Owner

@phelgren commented on GitHub (May 18, 2023):

WOW! Absolutely right (and the fix is the same as for any Apache installation - just uncomment the module reference). My installation was from Apache Lounge and although many "standard" modules were enabled, mod_rewrite wasn't one of them....

Thanks! Simple fix to a not so easy issue. REALLY appreciate it

@phelgren commented on GitHub (May 18, 2023): WOW! Absolutely right (and the fix is the same as for any Apache installation - just uncomment the module reference). My installation was from Apache Lounge and although many "standard" modules were enabled, mod_rewrite wasn't one of them.... Thanks! Simple fix to a not so easy issue. REALLY appreciate it
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3805