Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Found error on /login URL #5001

Closed
2 tasks done
RickFr410 opened this issue May 12, 2024 · 9 comments
Closed
2 tasks done

Not Found error on /login URL #5001

RickFr410 opened this issue May 12, 2024 · 9 comments

Comments

@RickFr410
Copy link

RickFr410 commented May 12, 2024

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

Hello
When I go to the BookStack URL, I have a not Found error when redirects to /login page. I made many searches, no actions made solve the problem. I tried some php artisan commands to clear cache and regenerate permissions

php artisan config:clear
php artisan cache:clear (don't work : Failed to clear cache. Make sure you have the appropriate permissions. - an issue is already open for that)
php artisan view:clear
php artisan config:cache
php artisan bookstack:regenerate-comment-content (don't work : Command "bookstack:regenerate-comment-content" is not defined. Did you mean one of these?)
php artisan bookstack:regenerate-search
php artisan bookstack:regenerate-permissions
php artisan cache:clear
php artisan config:cache
php artisan view:cache

I tried too to replace none by All on the AllowOverride directive.

Exact BookStack Version

v24.05

Log Content

Details

laravel.log file :

[2024-05-12 16:58:11] production.ERROR: Command "bookstack:regenerate-comment-content" is not defined.

Did you mean one of these?
    bookstack:cleanup-images
    bookstack:clear-activity
    bookstack:clear-revisions
    bookstack:clear-views
    bookstack:copy-shelf-permissions
    bookstack:create-admin
    bookstack:db-utf8mb4
    bookstack:delete-users
    bookstack:refresh-avatar
    bookstack:regenerate-permissions
    bookstack:regenerate-references
    bookstack:regenerate-search
    bookstack:reset-mfa
    bookstack:update-url {"exception":"[object] (Symfony\\Component\\Console\\Exception\\CommandNotFoundException(code: 0): Command \"bookstack:regenerate-comment-content\" is not defined.

Did you mean one of these?
    bookstack:cleanup-images
    bookstack:clear-activity
    bookstack:clear-revisions
    bookstack:clear-views
    bookstack:copy-shelf-permissions
    bookstack:create-admin
    bookstack:db-utf8mb4
    bookstack:delete-users
    bookstack:refresh-avatar
    bookstack:regenerate-permissions
    bookstack:regenerate-references
    bookstack:regenerate-search
    bookstack:reset-mfa
    bookstack:update-url at /var/www/html/BookStack/vendor/symfony/console/Application.php:737)
[stacktrace]
#0 /var/www/html/BookStack/vendor/symfony/console/Application.php(266): Symfony\\Component\\Console\\Application->find()
#1 /var/www/html/BookStack/vendor/symfony/console/Application.php(175): Symfony\\Component\\Console\\Application->doRun()
#2 /var/www/html/BookStack/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\\Component\\Console\\Application->run()
#3 /var/www/html/BookStack/artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle()
#4 {main}
"}

Apache access.log file :

192.168.0.131 - - [12/May/2024:19:53:26 +0200] "GET /login HTTP/1.1" 404 498 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0"
192.168.0.131 - - [12/May/2024:21:50:52 +0200] "GET /login HTTP/1.1" 404 498 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0"
192.168.0.131 - - [12/May/2024:21:50:53 +0200] "GET /login HTTP/1.1" 404 497 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0"
192.168.0.131 - - [12/May/2024:21:53:14 +0200] "GET / HTTP/1.1" 302 1926 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0"
192.168.0.131 - - [12/May/2024:21:53:14 +0200] "GET /login HTTP/1.1" 404 497 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0"
192.168.0.131 - - [12/May/2024:21:53:16 +0200] "GET /login HTTP/1.1" 404 497 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0"

Hosting Environment

PHP 8.2.18 - phpinfo.pdf

Debian 12.5
Apache/2.4.59
PHP 8.2.18

@ssddanbrown
Copy link
Member

Hi @RickFr410,
Within your .env file, do you have an APP_URL set that exactly matches the base URL you're using for accessing BookStack in the browser?

I tried too to replace none by All on the AllowOverride directive.

It's probably best to revert that change if it's made no difference since it's better to configure at the web-server level, can add confusion and security considerations.

@RickFr410
Copy link
Author

Within your .env file, do you have an APP_URL set that exactly matches the base URL you're using for accessing BookStack in the browser?

Yes, I checked the URL in this variable, it's okay.

It's probably best to revert that change if it's made no difference since it's better to configure at the web-server level, can add confusion and security considerations.

It's a test VM, no security risk. I prefer to wait a solution as the public folder contain a .htaccess file. I think the Options directive is concerned by the AllowOverride directive.

@ssddanbrown
Copy link
Member

What about Apache mod_rewrite, is that enabled?

sudo a2enmod rewrite
sudo systemctl restart apache2.service

@RickFr410
Copy link
Author

RickFr410 commented May 14, 2024

What about Apache mod_rewrite, is that enabled?

sudo a2enmod rewrite
sudo systemctl restart apache2.service

Yes, the mod_rewrite is enabled. I put the phpinfo() result in my first post, below the Apache loaded modules from it :

core mod_so mod_watchdog http_core mod_log_config mod_logio mod_version mod_unixd mod_access_compat
mod_alias mod_auth_basic mod_authn_core mod_authn_file mod_authz_core mod_authz_host mod_authz_user
mod_autoindex mod_deflate mod_dir mod_env mod_filter mod_mime prefork mod_negotiation mod_php
mod_proxy mod_reqtimeout mod_rewrite mod_setenvif mod_status

@ssddanbrown
Copy link
Member

@RickFr410 Okay, can you share the full apache virtualhost config used?

@RickFr410
Copy link
Author

RickFr410 commented May 14, 2024

@ssddanbrown I used the proposed one on the doc (except the AllowOverride I modified). I put it here in few minutes.

@RickFr410
Copy link
Author

RickFr410 commented May 14, 2024

@ssddanbrown

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/BookStack/public
        ServerName www.bookstack.local
        ServerAlias bookstack.local

        <Directory /var/www/html/bookstack/public/>
                Options Indexes FollowSymLinks
                AllowOverride All
                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>

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

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

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

@ssddanbrown
Copy link
Member

@RickFr410 In the <Directory definition of the apache config shared above, Update the path to be fully matching and correct (Within /var/www/html/bookstack/public/ update bookstack to BookStack to match the actual path used).
Then restart apache and confirm if that changes anything.

@RickFr410
Copy link
Author

@ssddanbrown Yes, it's Okay. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants