Can't load login page on Ubuntu 18.04 #1194

Closed
opened 2026-02-05 00:13:06 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @marcolivier on GitHub (May 22, 2019).

I can't seem to get it to work when using subfolder with Apache. It seems like the application won't load so I must be doing something wrong but I can't figure out what it is.

This is what I get when I go to domain.com/bookstack:

*/ define('LARAVEL_START', microtime(true)); /* |-------------------------------------------------------------------------- | Initialize The App |-------------------------------------------------------------------------- | | We need to get things going before we start up the app. | The init file loads everything in, in the correct order. | */ require __DIR__.'/../bootstrap/init.php'; /* |-------------------------------------------------------------------------- | Turn On The Lights |-------------------------------------------------------------------------- | | We need to illuminate PHP development, so let us turn on the lights. | This bootstraps the framework and gets it ready for use, then it | will load up this application so that we can run it and send | the responses back to the browser and delight our users. | */ $app = require_once __DIR__.'/../bootstrap/app.php'; /* |-------------------------------------------------------------------------- | Run The Application |-------------------------------------------------------------------------- | | Once we have the application, we can handle the incoming request | through the kernel, and send the associated response back to | the client's browser allowing them to enjoy the creative | and wonderful application we have prepared for them. | */ $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); $response = $kernel->handle( $request = Illuminate\Http\Request::capture() ); $response->send(); $kernel->terminate($request, $response);

Here's my apache conf:

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName domain.com
    ServerAlias www.domain.com
    ServerAdmin email@domain.com
    DocumentRoot /var/www/domain.com/html

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

    # BookStack Configuration
    Alias "/bookstack" "/var/www/BookStack/public"

    <Directory "/var/www/BookStack/public">
        Options FollowSymlinks
        AllowOverride none
        Require all granted

        RewriteEngine On
        # Redirect Trailing Slashes If Not A Folder...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)/$ /$1 [L,R=301]

        # Handle Front Controller...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^ index.php [L]
    </Directory>


    <Directory "/var/www/BookStack">
        AllowOverride None
        Require all denied
    </Directory>
    # End BookStack Configuration

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

<VirtualHost *:80>
    ServerName domain.com
    ServerAlias www.domain.com
    ServerAdmin email@domain.com
    DocumentRoot /var/www/domain.com/html

    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{HTTPS} off
        RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,QSA]
    </IfModule>
</VirtualHost>

The APP_URL is set correctly in .env (https://domain.com/bookstack).

Thanks for your help!

Originally created by @marcolivier on GitHub (May 22, 2019). I can't seem to get it to work when using subfolder with Apache. It seems like the application won't load so I must be doing something wrong but I can't figure out what it is. This is what I get when I go to domain.com/bookstack: ``` */ define('LARAVEL_START', microtime(true)); /* |-------------------------------------------------------------------------- | Initialize The App |-------------------------------------------------------------------------- | | We need to get things going before we start up the app. | The init file loads everything in, in the correct order. | */ require __DIR__.'/../bootstrap/init.php'; /* |-------------------------------------------------------------------------- | Turn On The Lights |-------------------------------------------------------------------------- | | We need to illuminate PHP development, so let us turn on the lights. | This bootstraps the framework and gets it ready for use, then it | will load up this application so that we can run it and send | the responses back to the browser and delight our users. | */ $app = require_once __DIR__.'/../bootstrap/app.php'; /* |-------------------------------------------------------------------------- | Run The Application |-------------------------------------------------------------------------- | | Once we have the application, we can handle the incoming request | through the kernel, and send the associated response back to | the client's browser allowing them to enjoy the creative | and wonderful application we have prepared for them. | */ $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); $response = $kernel->handle( $request = Illuminate\Http\Request::capture() ); $response->send(); $kernel->terminate($request, $response); ``` Here's my apache conf: ``` <IfModule mod_ssl.c> <VirtualHost *:443> ServerName domain.com ServerAlias www.domain.com ServerAdmin email@domain.com DocumentRoot /var/www/domain.com/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # BookStack Configuration Alias "/bookstack" "/var/www/BookStack/public" <Directory "/var/www/BookStack/public"> Options FollowSymlinks AllowOverride none Require all granted RewriteEngine On # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </Directory> <Directory "/var/www/BookStack"> AllowOverride None Require all denied </Directory> # End BookStack Configuration SSLEngine on SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf </VirtualHost> </IfModule> <VirtualHost *:80> ServerName domain.com ServerAlias www.domain.com ServerAdmin email@domain.com DocumentRoot /var/www/domain.com/html <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,QSA] </IfModule> </VirtualHost> ``` The `APP_URL` is set correctly in `.env` (`https://domain.com/bookstack`). Thanks for your help!
Author
Owner

@marcolivier commented on GitHub (May 22, 2019):

It was an issue with my php. Case closed, I was too tired to notice.

@marcolivier commented on GitHub (May 22, 2019): It was an issue with my php. Case closed, I was too tired to notice.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1194