Apace2 Cannot load auth/login 404

Checklist
[ x ] I have read intro post:
[ x ] I have read the tutorials, help and searched for similar issues

  • I followed the install from source (would link it but new user can only link 2 links)
  • I also read this similar forum post, but could not find what I might need to change
  • I also used to have this post problem However after some .htaccessedit forth and back, I now got this issue.

[ x ] I provide relevant information about my server (component names and versions, etc.)
Server: Ubuntu 22.04
Passbolt: 3.8.1
[ x ] I provide a copy of my logs and healthcheck
[ x ] I describe the steps I have taken to trouble shoot the problem
[ ? ] I describe the steps on how to reproduce the issue

So my vhost configs looks like this

<VirtualHost *:80>
        ServerAdmin togtja@gmail.com
        ServerName passbolt.domain.com
        DocumentRoot /var/www/passbolt/webroot
        #DirectoryIndex index.php

        #Redirect "/" "https://passbolt.domain.com"

        ErrorLog ${APACHE_LOG_DIR}/passbolt_error.log
        CustomLog ${APACHE_LOG_DIR}/passbolt_access.log combined


        <Directory /var/www/passbolt/webroot>
                Options FollowSymLinks MultiViews
                AllowOverride All
                Require all granted
        </Directory>

        RewriteEngine on
        RewriteCond %{SERVER_NAME} =passbolt.domain.com
        RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

443/SSL

<IfModule mod_ssl.c>
<VirtualHost _default_:443>
        ServerAdmin togtja@gmail.com
        ServerName passbolt.domain.com
        DocumentRoot /var/www/passbolt/webroot
        #DirectoryIndex index.php

        LogLevel debug
        ErrorLog ${APACHE_LOG_DIR}/passbolt_error.log
        CustomLog ${APACHE_LOG_DIR}/passbolt_access.log combined

        SSLEngine on

        <Directory /var/www/passbolt/webroot>
                Options FollowSymLinks MultiViews
                AllowOverride All
                Require all granted
        </Directory>
        <FilesMatch "\.(cgi|shtml|phtml|php)$">
                SSLOptions +StdEnvVars
        </FilesMatch>

        #<Directory /usr/lib/cgi-bin>
        #        SSLOptions +StdEnvVars
        #</Directory>

        SSLCertificateFile /etc/letsencrypt/live/passbolt.domain.com/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/passbolt.domain.com/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf

</VirtualHost>
</IfModule>

.htaccess:

# Uncomment the following to prevent the httpoxy vulnerability
# See: https://httpoxy.org/
#<IfModule mod_headers.c>
#    RequestHeader unset Proxy
#</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^(\.well-known/.*)$ $1 [L]
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
</IfModule>

rewrite is enabled

Healthchek log:


     ____                  __          ____
    / __ \____  _____ ____/ /_  ____  / / /_
   / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/
  / ____/ /_/ (__  |__  ) /_/ / /_/ / / /
 /_/    \__,_/____/____/_.___/\____/_/\__/

 Open source password manager for teams
-------------------------------------------------------------------------------
 Healthcheck shell
-------------------------------------------------------------------------------

 Environment

 [PASS] PHP version 8.1.2-1ubuntu2.8.
 [PASS] PCRE compiled with unicode support.
 [PASS] The temporary directory and its content are writable and not executable.
 [PASS] The logs directory and its content are writable.
 [PASS] GD or Imagick extension is installed.
 [PASS] Intl extension is installed.
 [PASS] Mbstring extension is installed.

 Config files

 [PASS] The application config file is present
 [PASS] The passbolt config file is present

 Core config

 [PASS] Debug mode is off.
 [PASS] Cache is working.
 [PASS] Unique value set for security.salt
 [PASS] Full base url is set to https://www.passbolt.domain.com
 [PASS] App.fullBaseUrl validation OK.
 [FAIL] Could not reach the /healthcheck/status with the url specified in App.fullBaseUrl
 [HELP] Check that the domain name is correct in config/passbolt.php
 [HELP] Check the network settings

 SSL Certificate

 [FAIL] SSL peer certificate does not validate
 [FAIL] Hostname does not match when validating certificates.
 [WARN] Using a self-signed certificate
 [HELP] Check https://help.passbolt.com/faq/hosting/troubleshoot-ssl
 [HELP] fopen(): Unable to locate peer certificate CN
fopen(): Failed to enable crypto
fopen(https://www.passbolt.domain.com/healthcheck/status.json): Failed to open stream: operation failed

 Database

 [PASS] The application is able to connect to the database
 [PASS] 26 tables found
 [PASS] Some default content is present
 [PASS] The database schema up to date.

 GPG Configuration

 [PASS] PHP GPG Module is installed and loaded.
 [PASS] The environment variable GNUPGHOME is set to /var/www/.gnupg.
 [PASS] The directory /var/www/.gnupg containing the keyring is writable by the webserver user.
 [PASS] The server OpenPGP key is not the default one
 [PASS] The public key file is defined in config/passbolt.php and readable.
 [PASS] The private key file is defined in config/passbolt.php and readable.
 [PASS] The server key fingerprint matches the one defined in config/passbolt.php.
 [PASS] The server public key defined in the config/passbolt.php (or environment variables) is in the keyring.
 [PASS] There is a valid email id defined for the server key.
 [PASS] The public key can be used to encrypt a message.
 [PASS] The private key can be used to sign a message.
 [PASS] The public and private keys can be used to encrypt and sign a message.
 [PASS] The private key can be used to decrypt a message.
 [PASS] The private key can be used to decrypt and verify a message.
 [PASS] The public key can be used to verify a signature.
 [PASS] The server public key format is Gopengpg compatible.
 [PASS] The server private key format is Gopengpg compatible.

 Application configuration

 [PASS] Using latest passbolt version (3.8.1).
 [PASS] Passbolt is configured to force SSL use.
 [PASS] App.fullBaseUrl is set to HTTPS.
 [PASS] Selenium API endpoints are disabled.
 [PASS] Search engine robots are told not to index content.
 [PASS] Registration is closed, only administrators can add users.
 [PASS] Serving the compiled version of the javascript app
 [PASS] All email notifications will be sent.

 JWT Authentication

 [PASS] The JWT Authentication plugin is enabled
 [PASS] The /var/www/passbolt/config/jwt/ directory is not writable.
 [PASS] A valid JWT key pair was found

 SMTP Settings

 [PASS] The SMTP Settings plugin is enabled.
 [PASS] SMTP Settings coherent. You may send a test email to validate them.
 [WARN] The SMTP Settings source is: /var/www/passbolt/config/passbolt.php.
 [HELP] It is recommended to set the SMTP Settings in the database through the administration section.

 [FAIL] 3 error(s) found. Hang in there!

And finally my /var/log/apache2/passbolt_error.log (Only the relevant part, i belive)

[Mon Nov 21 12:22:55.589571 2022] [core:info] [pid 81157:tid 139781843899968] [client 84.48.95.77:51127] AH00128: File does not exist: /var/www/passbolt/webroot/auth/login

So I been trying to get passbolt up and running starting 2 days ago.
I first tried the ngnix solution, but that seem to not like my other apache webservice running there from before. So i tried doing to from source (Meaning I at somepoint had both source and the package version). At somepoint I managed to to the auth/login however non of the JS worked. I at somepoint uninstalled the package passbolt with sudo apt remove passbolt-ce-server (still have the var/www/passbolt source) and then I tried fixing the JS things by adding:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

to my .htaccess that seems to cause a 500 error where it redirected infinitly to /webroot/webrrot/webroot… after that I removed it I got the where I am now. I have aslo done alot of small edits to the vhostover time in hopes of fixing various problems.
image

Thanks for reading and help and guidance in advanced

Can you try to remove webroot from <Directory /var/www/passbolt/webroot>?

Thanks for the reply.
Doing that I get a 500 Internal error, with the error output being:

[Wed Nov 23 10:08:05.977135 2022] [core:error] [pid 105207:tid 140313209329216] [client 84.48.95.77:53367] 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.
[Wed Nov 23 10:08:05.977147 2022] [core:debug] [pid 105207:tid 140313209329216] core.c(3956): [client 84.48.95.77:53367] AH00121: r->uri = /webroot/webroot/webroot/webroot/webroot/webroot/webroot/webroot/webroot/webroot/
[Wed Nov 23 10:08:05.977154 2022] [core:debug] [pid 105207:tid 140313209329216] core.c(3962): [client 84.48.95.77:53367] AH00122: redirected from r->uri = /webroot/webroot/webroot/webroot/webroot/webroot/webroot/webroot/webroot/
[Wed Nov 23 10:08:05.977161 2022] [core:debug] [pid 105207:tid 140313209329216] core.c(3962): [client 84.48.95.77:53367] AH00122: redirected from r->uri = /webroot/webroot/webroot/webroot/webroot/webroot/webroot/webroot/
[Wed Nov 23 10:08:05.977167 2022] [core:debug] [pid 105207:tid 140313209329216] core.c(3962): [client 84.48.95.77:53367] AH00122: redirected from r->uri = /webroot/webroot/webroot/webroot/webroot/webroot/webroot/
[Wed Nov 23 10:08:05.977173 2022] [core:debug] [pid 105207:tid 140313209329216] core.c(3962): [client 84.48.95.77:53367] AH00122: redirected from r->uri = /webroot/webroot/webroot/webroot/webroot/webroot/
[Wed Nov 23 10:08:05.977180 2022] [core:debug] [pid 105207:tid 140313209329216] core.c(3962): [client 84.48.95.77:53367] AH00122: redirected from r->uri = /webroot/webroot/webroot/webroot/webroot/
[Wed Nov 23 10:08:05.977186 2022] [core:debug] [pid 105207:tid 140313209329216] core.c(3962): [client 84.48.95.77:53367] AH00122: redirected from r->uri = /webroot/webroot/webroot/webroot/
[Wed Nov 23 10:08:05.977192 2022] [core:debug] [pid 105207:tid 140313209329216] core.c(3962): [client 84.48.95.77:53367] AH00122: redirected from r->uri = /webroot/webroot/webroot/
[Wed Nov 23 10:08:05.977198 2022] [core:debug] [pid 105207:tid 140313209329216] core.c(3962): [client 84.48.95.77:53367] AH00122: redirected from r->uri = /webroot/webroot/
[Wed Nov 23 10:08:05.977204 2022] [core:debug] [pid 105207:tid 140313209329216] core.c(3962): [client 84.48.95.77:53367] AH00122: redirected from r->uri = /webroot/

Ok, so maybe retry with fresh setup:

  • Using the same configuration from the other thread 404 not found error with apache fresh install - #5 by remy (for example there is “Multiviews” in your config)
  • Without modifying any .htaccess files / revert them from original if modified
  • Restart apache after changing the configuration

Doing that, now my vhost ssl config looks like this

<IfModule mod_ssl.c>
<VirtualHost _default_:443>
        ServerAdmin togtja@gmail.com
        ServerName passbolt.domain.com
        DocumentRoot /var/www/passbolt/webroot

        ErrorLog ${APACHE_LOG_DIR}/passbolt_error.log
        CustomLog ${APACHE_LOG_DIR}/passbolt_access.log combined

        <FilesMatch "\.(php)$">
                SSLOptions +StdEnvVars
        </FilesMatch>

        <Directory /var/www/passbolt/webroot>
            Options FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

        SSLEngine on
        SSLCertificateFile /etc/letsencrypt/live/passbolt.domain.com/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/passbolt.domain.com/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf

</VirtualHost>
</IfModule>

And I belive I reverte the .htaccess in the /var/www/passbolt folder (idk if here are more .htaccess files?) already, but I will show how it looked like This is how the master brach 's file also looks like):

# Uncomment the following to prevent the httpoxy vulnerability
# See: https://httpoxy.org/
#<IfModule mod_headers.c>
#    RequestHeader unset Proxy
#</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^(\.well-known/.*)$ $1 [L]
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
</IfModule>

I am back to the 404 error

Okay I was just being a big dumb dumb.

I found out that while there was a .htaccess in the root folder. there was also one in the webroot/.htaccess. Once that one was restored, i finally got it back to the same error as in this post:
https://community.passbolt.com/t/js-libraries-not-loading-with-apache/

I get a white /auth/login page with nothing
My web console looks like this (Lot’s of content security policy error)


And the source code for the page is this:

<!doctype html>
<html class="passbolt no-js version launching no-passboltplugin" lang="en">
<head>
    <meta charset="utf-8"/>
    <title>Passbolt | Open source password manager for teams</title>
    <!--

        ____                  __          ____
       / __ \____  _____ ____/ /_  ____  / / /_
      / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/
     / ____/ /_/ (__  )__  ) /_/ / /_/ / / /_
    /_/    \__,_/____/____/_.___/\____/_/\__/

    Open source password manager for teams
    Copyright (c) Passbolt SA (https://www.passbolt.com)


    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation, either version 3 of the
    License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program. If not, see http://www.gnu.org/licenses/.


    -->
    <meta name="description" content="Open source password manager for teams">
    <meta name="keywords" content="Passbolt, password manager, online password manager, open source password manager">
    <meta name="robots" content="noindex, nofollow">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" type="image/x-icon" href="https://www.passbolt.domain.com/favicon.ico" />
    <link rel="icon" href="https://www.passbolt.domain.com/favicon_32.png" sizes="32x32" />
    <link rel="icon" href="https://www.passbolt.domain.com/favicon_57.png" sizes="57x57" />
    <link rel="icon" href="https://www.passbolt.domain.com/favicon_76.png" sizes="76x76" />
    <link rel="icon" href="https://www.passbolt.domain.com/favicon_96.png" sizes="96x96" />
    <link rel="icon" href="https://www.passbolt.domain.com/favicon_128.png" sizes="128x128" />
    <link rel="icon" href="https://www.passbolt.domain.com/favicon_192.png" sizes="192x192" />
    <link rel="icon" href="https://www.passbolt.domain.com/favicon_228.png" sizes="228x228" />
    <base href="https://www.passbolt.domain.com/">
        <script src="https://www.passbolt.domain.com/js/app/stylesheet.js?v=3.8.1" id="stylesheet-manager" data-file="api_authentication.min.css" cache-version="3.8.1"></script></head>
<body spellcheck="false">
<!-- main -->
<div id="container" class="page ">
</div>
<script src="https://www.passbolt.domain.com/js/app/api-vendors.js?v=3.8.1" cache-version="3.8.1"></script><script src="https://www.passbolt.domain.com/js/app/api-triage.js?v=3.8.1" cache-version="3.8.1"></script></body>
</html>

Any tips to solve this? (or/and should I make a new post? this is very related, and my title stands semi true)