New Installation's Links Cannot Be Resolved #5166

Closed
opened 2026-02-05 09:45:36 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @Aozora-the-Dev on GitHub (Feb 2, 2025).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

I have performed the steps for a fresh manual installation on a Raspberry Pi using Apache and MariaDB.
The landing page is served correctly with no missing styles or scripts.
The problem I have is that any of the hyperlinks in the page return a 404 Error.
I have the site running in a separate virtual host and already have another site on a different subdomain running Laravel.
I've confirmed that I'm running on the release branch and php artisan routes:list shows 307 total routes.
The APP_URL in .env is identical to the full page URL.
I tried running in development and debug mode to see if I could learn anything but neither worked.

As far as I can tell, I've only done two things that are not explicitly specified in the installation instructions.

  1. I've modified to Apache virtual host conf file to include rewrite rules that were listed in the devops repo instead of using .htaccess in the public directory.
  2. I've used Let'sEncrypt so I could use https.

Page requests are logged in Apache's access log but there is nothing in the Laravel log.
I presume the issue is with some combination of my wiki.conf or the .htaccess that I disabled.

/etc/apache2/sites-enabled/wiki.conf

<VirtualHost *:80>
	ServerName wiki.domain.com
	DocumentRoot /var/www/wiki/public

	<Directory "/var/www/wiki/public">
		Options Indexes FollowSymLinks
		AllowOverride None
		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]
		</IfModule>
	</Directory>
	CustomLog ${APACHE_LOG_DIR}/wiki-access.log combined
	ErrorLog ${APACHE_LOG_DIR}/wiki-error.log
	RewriteEngine on
	RewriteCond %{SERVER_NAME} =wiki.domain.com
	RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

/var/www/wiki/public/.htaccess

<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]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    RewriteBase /
</IfModule>

Since this is a fresh install, I don't have much of an aversion to reinstalling again but this is the third attempt I've made today with little to no changes so I doubt me doing the same thing would help.
Since I can't get to the settings view for the installation, I'm presuming that my version is the latest from the release page (24.12.1 as of this point).

Exact BookStack Version

v24.12.1

Log Content

No response

Hosting Environment

PHP 8.2
Apache2
Raspberry Pi OS

Originally created by @Aozora-the-Dev on GitHub (Feb 2, 2025). ### Attempted Debugging - [x] I have read the debugging page ### Searched GitHub Issues - [x] I have searched GitHub for the issue. ### Describe the Scenario I have performed the steps for a fresh manual installation on a Raspberry Pi using Apache and MariaDB. The landing page is served correctly with no missing styles or scripts. The problem I have is that any of the hyperlinks in the page return a 404 Error. I have the site running in a separate virtual host and already have another site on a different subdomain running Laravel. I've confirmed that I'm running on the release branch and `php artisan routes:list` shows 307 total routes. The APP_URL in .env is identical to the full page URL. I tried running in development and debug mode to see if I could learn anything but neither worked. As far as I can tell, I've only done two things that are not explicitly specified in the installation instructions. 1. I've modified to Apache virtual host conf file to include rewrite rules that were listed in the devops repo instead of using .htaccess in the public directory. 2. I've used Let'sEncrypt so I could use https. Page requests are logged in Apache's access log but there is nothing in the Laravel log. I presume the issue is with some combination of my wiki.conf or the .htaccess that I disabled. `/etc/apache2/sites-enabled/wiki.conf` ```conf <VirtualHost *:80> ServerName wiki.domain.com DocumentRoot /var/www/wiki/public <Directory "/var/www/wiki/public"> Options Indexes FollowSymLinks AllowOverride None 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] </IfModule> </Directory> CustomLog ${APACHE_LOG_DIR}/wiki-access.log combined ErrorLog ${APACHE_LOG_DIR}/wiki-error.log RewriteEngine on RewriteCond %{SERVER_NAME} =wiki.domain.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] </VirtualHost> ``` `/var/www/wiki/public/.htaccess` ```.htaccess <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] # Send Requests To Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] RewriteBase / </IfModule> ``` Since this is a fresh install, I don't have much of an aversion to reinstalling again but this is the third attempt I've made today with little to no changes so I doubt me doing the same thing would help. Since I can't get to the settings view for the installation, I'm presuming that my version is the latest from the release page (24.12.1 as of this point). ### Exact BookStack Version v24.12.1 ### Log Content _No response_ ### Hosting Environment PHP 8.2 Apache2 Raspberry Pi OS
OVERLORD added the 🐕 Support label 2026-02-05 09:45:36 +03:00
Author
Owner

@Aozora-the-Dev commented on GitHub (Feb 2, 2025):

New day, new attempt.
I've found that if I change the AllowOverride to All in wiki.conf that the Laravel routing works but now the static files in the public directory cannot be found.

@Aozora-the-Dev commented on GitHub (Feb 2, 2025): New day, new attempt. I've found that if I change the AllowOverride to All in wiki.conf that the Laravel routing works but now the static files in the public directory cannot be found.
Author
Owner

@ssddanbrown commented on GitHub (Feb 3, 2025):

Hi @Aozora-the-Dev ,
Disable AllowOverride again, let's keep it all in the apache conf to avoid confusion.

Your original wiki.conf was missing the rewrite to send requests to the app.
You'd need to add the extra rewrites as shown here:
487a7141c3/config/apache/bookstack.conf (L39-L42)

@ssddanbrown commented on GitHub (Feb 3, 2025): Hi @Aozora-the-Dev , Disable `AllowOverride` again, let's keep it all in the apache conf to avoid confusion. Your original `wiki.conf` was missing the rewrite to send requests to the app. You'd need to add the extra rewrites as shown here: https://codeberg.org/bookstack/devops/src/commit/487a7141c385375b2ae98723464cd2246b9b9901/config/apache/bookstack.conf#L39-L42
Author
Owner

@Aozora-the-Dev commented on GitHub (Feb 3, 2025):

Thank you very much. That did the trick.

@Aozora-the-Dev commented on GitHub (Feb 3, 2025): Thank you very much. That did the trick.
Author
Owner

@ssddanbrown commented on GitHub (Feb 3, 2025):

Good to hear! I'll therefore close this off.

@ssddanbrown commented on GitHub (Feb 3, 2025): Good to hear! I'll therefore close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5166