"403 Forbidden" occurs only with "view profile" #4424

Closed
opened 2026-02-05 08:51:48 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @muratabitgroove on GitHub (Jan 23, 2024).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

BookStack installation was successful without any problems.Everything except "view profile" appears to be working well.
When I log in with the newly created user account and click "View Profile", the browser displays "403 Forbidden".
When I looked at the error log of Apache, the web server, it appeared that a user homepage was requested.

client denied by server configuration: /home/test-officer

The directory "/home" of course exists, but "/home/test-officer" does not exist.
When I tried creating "/home/test-officer", the Apache error changed to the following.

client denied by server configuration: /home/test-officer/public_html

This time I tried creating "/home/test-officer/public_html".
The error changed to:

Cannot serve directory /home/test-officer/public_html/: No matching DirectoryIndex (index.html,index.htm,index.php) found, and server-generated directory index forbidden by Options directive

Next, I created "index.html" in "/home/test-officer/public_html".
The contents of "index.html" are as follows.

<html><head></head>
<body>here is test_officer home.</body>
</html>

Now when I click on "view profile" it says "here is test_officer home." instead of "Forbidden".
The address bar of the browser is "https://www.example.com/user/test-officer/".

How can I click "View Profile" to correctly view the profile page generated by BookStack?

Note that "UserDir" is valid in the Apache settings, but the user "test-officer" does not exist.
Also, the "test-officer" email address (login ID) is similar to but different from the server name that hosting BookStack.

thank you.

Exact BookStack Version

v23.12.1

Log Content

No Error

Hosting Environment

Ubuntu 22.04.2
PHP 8.1.2-1ubuntu2.14
mysqld Ver 10.6.12-MariaDB-0ubuntu0.22.04.1 for debian-linux-gnu on x86_64 (Ubuntu 22.04)
apache2 2.4.52-1ubuntu4.7
Composer (version 2.6.6)

Originally created by @muratabitgroove on GitHub (Jan 23, 2024). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario BookStack installation was successful without any problems.Everything except "view profile" appears to be working well. When I log in with the newly created user account and click "View Profile", the browser displays "403 Forbidden". When I looked at the error log of Apache, the web server, it appeared that a user homepage was requested. ` client denied by server configuration: /home/test-officer` The directory "/home" of course exists, but "/home/test-officer" does not exist. When I tried creating "/home/test-officer", the Apache error changed to the following. `client denied by server configuration: /home/test-officer/public_html` This time I tried creating "/home/test-officer/public_html". The error changed to: `Cannot serve directory /home/test-officer/public_html/: No matching DirectoryIndex (index.html,index.htm,index.php) found, and server-generated directory index forbidden by Options directive` Next, I created "index.html" in "/home/test-officer/public_html". The contents of "index.html" are as follows. ``` <html><head></head> <body>here is test_officer home.</body> </html> ``` Now when I click on "view profile" it says "here is test_officer home." instead of "Forbidden". The address bar of the browser is "https://www.example.com/user/test-officer/". How can I click "View Profile" to correctly view the profile page generated by BookStack? Note that "UserDir" is valid in the Apache settings, but the user "test-officer" does not exist. Also, the "test-officer" email address (login ID) is similar to but different from the server name that hosting BookStack. thank you. ### Exact BookStack Version v23.12.1 ### Log Content No Error ### Hosting Environment Ubuntu 22.04.2 PHP 8.1.2-1ubuntu2.14 mysqld Ver 10.6.12-MariaDB-0ubuntu0.22.04.1 for debian-linux-gnu on x86_64 (Ubuntu 22.04) apache2 2.4.52-1ubuntu4.7 Composer (version 2.6.6)
OVERLORD added the 🐕 Support label 2026-02-05 08:51:48 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jan 23, 2024):

Hi @muratabitgroove,
Based upon what you've mentioned, it sounds like some other Apache config is interfering when user is part of the URL path.

If possible, it would be good to know where the BookStack install exists on the filesystem of this server, and ideally a view of the Apache config used here.

@ssddanbrown commented on GitHub (Jan 23, 2024): Hi @muratabitgroove, Based upon what you've mentioned, it sounds like some other Apache config is interfering when `user` is part of the URL path. If possible, it would be good to know where the BookStack install exists on the filesystem of this server, and ideally a view of the Apache config used here.
Author
Owner

@muratabitgroove commented on GitHub (Jan 23, 2024):

Hi @ssddanbrown
Thank you for your precise advice.

I have reviewed my apache configuration, I found that the UserDir settings were interfering.
When I previously configured UserDir, I had added "AliasMatch" so that it could be accessed by writing "user/" instead of the tilde in front of the user name.
AliasMatch ^/user/([^/]+)(. *) /home/$1/public_html/$2

I had completely forgotten about this.
Once I figured it out, it was easy.
After commenting out the "AliasMatch" directive, "View Profile" was displayed correctly.

Sorry for taking your time to do this.
I appreciate it very much.
Thank you.

@muratabitgroove commented on GitHub (Jan 23, 2024): Hi @ssddanbrown Thank you for your precise advice. I have reviewed my apache configuration, I found that the UserDir settings were interfering. When I previously configured UserDir, I had added "AliasMatch" so that it could be accessed by writing "user/" instead of the tilde in front of the user name. `AliasMatch ^/user/([^/]+)(. *) /home/$1/public_html/$2` I had completely forgotten about this. Once I figured it out, it was easy. After commenting out the "AliasMatch" directive, "View Profile" was displayed correctly. Sorry for taking your time to do this. I appreciate it very much. Thank you.
Author
Owner

@ssddanbrown commented on GitHub (Jan 23, 2024):

No worries, Good to hear you found the cause.
I'll therefore close this off.

@ssddanbrown commented on GitHub (Jan 23, 2024): No worries, Good to hear you found the cause. 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#4424