/login not found on a fresh install #222

Closed
opened 2026-02-04 17:46:44 +03:00 by OVERLORD · 8 comments
Owner

Originally created by @julienmmm on GitHub (Dec 20, 2016).

After a fresh installation where everything seemed to go fine, I got an "HTTP 404, url /login not found" error when trying to access the BookStack home page.

Bellow are the steps I've used to install BookStack.

cd /var/www/html
git clone https://github.com/BookStackApp/BookStack.git --branch release --single-branch
cd BookStack
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === 'c32408bcd017c577ce80605420e5987ce947a5609e8443dd72cd3867cc3a0cf442e5bf4edddbcbe72246a953a6c48e21') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
php composer.phar install
vi .env # add mysql credentials
php artisan key:generate
php artisan migrate
chcon -R system_u:object_r:httpd_sys_content_t:s0 /var/www/html/BookStack/ # SELinux is enabled on my system
setfacl -R -m u:apache:rwX .

Then I've added this file in the apache conf.d directory:
<VirtualHost *:80>
DocumentRoot "/var/www/html/BookStack/public"
ServerName bookstack.local

Alias /bookstack/ /var/www/html/BookStack/

<Directory /var/www/html/BookStack/>
AddDefaultCharset UTF-8

# Apache 2.4

Require ip 127.0.0.1
Require ip ::1
Require ip X.X.X.X/24


<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1

I've restarted apache and try to access bookstack.local.

Then I get the 404 http error: url /login not found.

REM: I use apache 2.4

Originally created by @julienmmm on GitHub (Dec 20, 2016). After a fresh installation where everything seemed to go fine, I got an "HTTP 404, url /login not found" error when trying to access the BookStack home page. Bellow are the steps I've used to install BookStack. >cd /var/www/html git clone https://github.com/BookStackApp/BookStack.git --branch release --single-branch cd BookStack php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('SHA384', 'composer-setup.php') === 'c32408bcd017c577ce80605420e5987ce947a5609e8443dd72cd3867cc3a0cf442e5bf4edddbcbe72246a953a6c48e21') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');" php composer.phar install vi .env # add mysql credentials php artisan key:generate php artisan migrate chcon -R system_u:object_r:httpd_sys_content_t:s0 /var/www/html/BookStack/ # SELinux is enabled on my system setfacl -R -m u:apache:rwX . Then I've added this file in the apache conf.d directory: <VirtualHost *:80> DocumentRoot "/var/www/html/BookStack/public" ServerName bookstack.local </VirtualHost> Alias /bookstack/ /var/www/html/BookStack/ <Directory /var/www/html/BookStack/> AddDefaultCharset UTF-8 <IfModule mod_authz_core.c> # Apache 2.4 <RequireAny> Require ip 127.0.0.1 Require ip ::1 Require ip X.X.X.X/24 </RequireAny> </IfModule> <IfModule !mod_authz_core.c> # Apache 2.2 Order Deny,Allow Deny from All Allow from 127.0.0.1 Allow from ::1 </IfModule> </Directory> I've restarted apache and try to access bookstack.local. Then I get the 404 http error: url /login not found. REM: I use apache 2.4
OVERLORD added the 🐕 Support label 2026-02-04 17:46:44 +03:00
Author
Owner

@lommes commented on GitHub (Dec 22, 2016):

Is mod_rewrite enabled in apache?

@lommes commented on GitHub (Dec 22, 2016): Is mod_rewrite enabled in apache?
Author
Owner

@julienmmm commented on GitHub (Dec 22, 2016):

Yes, the following line is my apache config:

LoadModule rewrite_module modules/mod_rewrite.so

Should I add some rewrite rule to make BookStack work?

@julienmmm commented on GitHub (Dec 22, 2016): Yes, the following line is my apache config: >LoadModule rewrite_module modules/mod_rewrite.so Should I add some rewrite rule to make BookStack work?
Author
Owner

@lommes commented on GitHub (Dec 22, 2016):

to use mod_rewrite via htaccess-file there should be a AllowOverride All (or at least AllowOverride FileInfo, but I'm not sure here) in your Directory directive. The required rewrite rules are in public/.htaccess

@lommes commented on GitHub (Dec 22, 2016): to use mod_rewrite via htaccess-file there should be a `AllowOverride All` (or at least `AllowOverride FileInfo`, but I'm not sure here) in your Directory directive. The required rewrite rules are in public/.htaccess
Author
Owner

@julienmmm commented on GitHub (Dec 22, 2016):

You're right. In my config the AllowOverride property is set to Y. So to not chnage this global directive and as encouraged by the Apache documentation, I've put the rewrite rules under a Directory directive.
But then I got another error related to the rewrite engine rule: "AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace"

I keep on searching.

@julienmmm commented on GitHub (Dec 22, 2016): You're right. In my config the AllowOverride property is set to Y. So to not chnage this global directive and as encouraged by the Apache documentation, I've put the rewrite rules under a Directory directive. But then I got another error related to the rewrite engine rule: "AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace" I keep on searching.
Author
Owner

@lommes commented on GitHub (Dec 22, 2016):

If you are using the above config this is the expected behaviour because the rewrite will run into errors since there is no index.php in laravels root-directory. Maybe the only thing to change is to add the public-folder to your directory directive:

<Directory /var/www/html/BookStack/public/>

@lommes commented on GitHub (Dec 22, 2016): If you are using the above config this is the expected behaviour because the rewrite will run into errors since there is no index.php in laravels root-directory. Maybe the only thing to change is to add the public-folder to your directory directive: <Directory /var/www/html/BookStack/public/>
Author
Owner

@nholben commented on GitHub (Dec 23, 2016):

I was having similar issues. The problem boiled down to not having www-data ownership in the right places. I'm not sure how SELinux factors into that for you.

@nholben commented on GitHub (Dec 23, 2016): I was having similar issues. The problem boiled down to not having www-data ownership in the right places. I'm not sure how SELinux factors into that for you.
Author
Owner

@julienmmm commented on GitHub (Jan 1, 2017):

Problem solved. It was related to the rewrite rules and the use of a a virtual host to access bookstack.
I had to add a "RewriteBase /" stanza to the apache rewrite rukles.

Here is the apache configuration file which is working for me:

<VirtualHost *:80>
DocumentRoot "/var/www/html/BookStack/public"
ServerName <MyBookstack.com>

# Autres directives ici

<Directory /var/www/html/BookStack/>
AddDefaultCharset UTF-8

# Apache 2.4

Require ip 127.0.0.1
Require ip ::1
Require ip 10.0.0.0/24
Require ip 10.8.0.0/24


<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1


Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

@julienmmm commented on GitHub (Jan 1, 2017): Problem solved. It was related to the rewrite rules and the use of a a virtual host to access bookstack. I had to add a "RewriteBase /" stanza to the apache rewrite rukles. Here is the apache configuration file which is working for me: <VirtualHost *:80> DocumentRoot "/var/www/html/BookStack/public" ServerName <MyBookstack.com> # Autres directives ici </VirtualHost> <Directory /var/www/html/BookStack/> AddDefaultCharset UTF-8 <IfModule mod_authz_core.c> # Apache 2.4 <RequireAny> Require ip 127.0.0.1 Require ip ::1 Require ip 10.0.0.0/24 Require ip 10.8.0.0/24 </RequireAny> </IfModule> <IfModule !mod_authz_core.c> # Apache 2.2 Order Deny,Allow Deny from All Allow from 127.0.0.1 Allow from ::1 </IfModule> <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On **RewriteBase /** RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule> </Directory>
Author
Owner

@ssddanbrown commented on GitHub (Jan 2, 2017):

@julienmmm Awesome 🎆

Happy to hear you found the issue. Sorry I didn't provide much support on this but I wasn't really sure of the issue myself. Thanks @lommes for looking into this.

I will go ahead and close this issue.

@ssddanbrown commented on GitHub (Jan 2, 2017): @julienmmm Awesome 🎆 Happy to hear you found the issue. Sorry I didn't provide much support on this but I wasn't really sure of the issue myself. Thanks @lommes for looking into this. I will go ahead and close this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#222