404 not found after installation #1214

Closed
opened 2026-02-05 00:16:24 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @schier1987 on GitHub (Jun 2, 2019).

Hi,

I just installed bookstack following the instructions @ https://www.bookstackapp.com/docs/admin/installation/ (Manual Installation)

Everything went fine, no errors or anything, but when I open the URL, I get instantly redirected to /login, throwing "404 Not found".

As it sounded similar, I already tried chaning database collation to utf8mb4_unicode_ci as described here https://github.com/BookStackApp/BookStack/issues/1050

I cloned the newest BookStack-Version from git, my server runs PHP 7.0.33-0ubuntu0.16.04.4

I couldn't find anything in the server logs...

Do you have any idea?

thanks and best regards

Originally created by @schier1987 on GitHub (Jun 2, 2019). Hi, I just installed bookstack following the instructions @ https://www.bookstackapp.com/docs/admin/installation/ (Manual Installation) Everything went fine, no errors or anything, but when I open the URL, I get instantly redirected to /login, throwing "404 Not found". As it sounded similar, I already tried chaning database collation to utf8mb4_unicode_ci as described here https://github.com/BookStackApp/BookStack/issues/1050 I cloned the newest BookStack-Version from git, my server runs PHP 7.0.33-0ubuntu0.16.04.4 I couldn't find anything in the server logs... Do you have any idea? thanks and best regards
OVERLORD added the 🐕 Support label 2026-02-05 00:16:24 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jun 4, 2019):

Hi @schier1987,
What kind of 404 page do you see? A fairly blank page or a BookStack (Blue-looking) page?

Additionally, what web server and operating system are you running?

@ssddanbrown commented on GitHub (Jun 4, 2019): Hi @schier1987, What kind of 404 page do you see? A fairly blank page or a BookStack (Blue-looking) page? Additionally, what web server and operating system are you running?
Author
Owner

@schier1987 commented on GitHub (Jun 6, 2019):

Hi @ssddanbrown

Thanks for your answer.

Fairly blank, not BookStack related.

I am running apache on Ubuntu 16.04, and I set the .htaccess as explained in the docs (respectively the installation did it by itself)

@schier1987 commented on GitHub (Jun 6, 2019): Hi @ssddanbrown Thanks for your answer. Fairly blank, not BookStack related. I am running apache on Ubuntu 16.04, and I set the .htaccess as explained in the docs (respectively the installation did it by itself)
Author
Owner

@chefarbeiter commented on GitHub (Sep 2, 2019):

HI @schier1987 ,

are you using nginx as web server?

I had the same issue after a fresh install of BookStack on Ubuntu. Error page 404 from nginx, no message in any log file. Access to static files in the public folder (e. g. user_avatar.png) via web server was successfull. Then I replaced the original index.php by a dummy one -> same error -> BookStack wasn't the problem here.

I checked my nginx-config for the site many times and ... finally found the problem 😃

I had the location-block for php-files outside of the root-location-block:

location / {
   root /var/www/docs/bookstack/public;
   try_files $uri $uri/ /index.php?$query_string;
}

location ~ [^/]\.php(/|$) {
  [...]
  fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  [...]
}

But the php-location must be placed inside the root-location:

location / {
   root /var/www/docs/bookstack/public;
   try_files $uri $uri/ /index.php?$query_string;

   location ~ [^/]\.php(/|$) {
      [...]
      fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
      [...]
   }
}

Reloaded nginx and BookStack is working! 😃

@chefarbeiter commented on GitHub (Sep 2, 2019): HI @schier1987 , are you using nginx as web server? I had the same issue after a fresh install of BookStack on Ubuntu. Error page 404 from nginx, no message in any log file. Access to static files in the public folder (e. g. user_avatar.png) via web server was successfull. Then I replaced the original index.php by a dummy one -> same error -> BookStack wasn't the problem here. I checked my nginx-config for the site many times and ... finally found the problem :smiley: I had the location-block for php-files outside of the root-location-block: ```nginx location / { root /var/www/docs/bookstack/public; try_files $uri $uri/ /index.php?$query_string; } location ~ [^/]\.php(/|$) { [...] fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; [...] } ``` But the php-location must be placed **inside** the root-location: ```nginx location / { root /var/www/docs/bookstack/public; try_files $uri $uri/ /index.php?$query_string; location ~ [^/]\.php(/|$) { [...] fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; [...] } } ``` Reloaded nginx and BookStack is working! :smiley:
Author
Owner

@ssddanbrown commented on GitHub (Dec 17, 2020):

Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.

@ssddanbrown commented on GitHub (Dec 17, 2020): Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1214