1
5
Fork
You've already forked devops
3

Missing .htaccess file in / #38

Closed
opened 2022年09月08日 20:52:31 +02:00 by siteleas · 5 comments
siteleas commented 2022年09月08日 20:52:31 +02:00 (Migrated from github.com)
Copy link

I cloned the repository and installed BookStack using the manual install method here https://www.bookstackapp.com/docs/admin/installation/.

After installing following the instructions given, I get a file listing when going to APP_URL I have updated all of the settings in the .env file including the site URL. I am running MySQL Ver 5.7.39 and PHP 8.4

I noticed that there is no .htaccess file in the root folder providing a rewrite to the public folder. Could you provide the .htaccess file or the proper rewrite for the /.htaccess file so this redirects properly?

Also, I attempted to direct the browser to APP_URL/index.php and receive a file not found error. Please help me with a prompt and brief resolution to this issue. Thank you.

By the way, I need to use the .htaccess method as the vhost file is managed by WHM/cPanel and is not to be manually edited.

I cloned the repository and installed BookStack using the manual install method here https://www.bookstackapp.com/docs/admin/installation/. After installing following the instructions given, I get a file listing when going to _APP_URL_ I have updated all of the settings in the .env file including the site URL. I am running MySQL Ver 5.7.39 and PHP 8.4 I noticed that there is no .htaccess file in the root folder providing a rewrite to the public folder. Could you provide the .htaccess file or the proper rewrite for the /.htaccess file so this redirects properly? Also, I attempted to direct the browser to _APP_URL/index.php_ and receive a file not found error. Please help me with a prompt and brief resolution to this issue. Thank you. By the way, I need to use the .htaccess method as the vhost file is managed by WHM/cPanel and is not to be manually edited.
ssddanbrown commented 2022年09月08日 22:57:34 +02:00 (Migrated from github.com)
Copy link

Hi @siteleas 👋 ,

I noticed that there is no .htaccess file in the root folder providing a rewrite to the public folder. Could you provide the .htaccess file or the proper rewrite for the /.htaccess file so this redirects properly?

Unfortunately not, BookStack does not support that style of setup.
As per step 7 of the manual install docs, The web root needs to point to the public folder.
The BookStack app files, outside of the public folder, should never be within served web space as this risks additional exposure.
It is possible to alter things to get it working in such a a setup, but it's not something I recommend or support due to the onset issues that can occur.

Also, I attempted to direct the browser to APP_URL/index.php and receive a file not found error.

You should never need to access the app at /index.php.

By the way, I need to use the .htaccess method as the vhost file is managed by WHM/cPanel and is not to be manually edited.

As above.
I'm pretty sure it is possible to do on WHM/cPanel setups but it might depend on access and privileges.
I also have it in mind that maybe you can only set a custom "Web root" when using a secondary/sub domain in cPanel. Not sure if that's still the case though.

Hi @siteleas 👋 , > I noticed that there is no .htaccess file in the root folder providing a rewrite to the public folder. Could you provide the .htaccess file or the proper rewrite for the /.htaccess file so this redirects properly? Unfortunately not, BookStack does not support that style of setup. As per step 7 of the manual install docs, The web root needs to point to the `public` folder. The BookStack app files, outside of the `public` folder, should never be within served web space as this risks additional exposure. It is possible to alter things to get it working in such a a setup, but it's not something I recommend or support due to the onset issues that can occur. > Also, I attempted to direct the browser to APP_URL/index.php and receive a file not found error. You should never need to access the app at `/index.php`. > By the way, I need to use the .htaccess method as the vhost file is managed by WHM/cPanel and is not to be manually edited. As above. I'm pretty sure it is possible to do on WHM/cPanel setups but it might depend on access and privileges. I also have it in mind that maybe you can only set a custom "Web root" when using a secondary/sub domain in cPanel. Not sure if that's still the case though.
siteleas commented 2022年09月09日 20:01:51 +02:00 (Migrated from github.com)
Copy link

Thank you @ssddanbrown for your prompt reply! Totally appreciate your work on, and dedication to, this open source project. Good job 👍

Okay, you were right. There was a way to edit the document root for the sub-domain in cPanel. Once I did that, pointing the document root to the public folder, I received the following error: No input file specified.

Thank you @ssddanbrown for your prompt reply! Totally appreciate your work on, and dedication to, this open source project. Good job :+1: Okay, you were right. There was a way to edit the document root for the sub-domain in cPanel. Once I did that, pointing the document root to the public folder, I received the following error: `No input file specified`.
ssddanbrown commented 2022年09月09日 23:11:14 +02:00 (Migrated from github.com)
Copy link

Hard to know based upon that error alone.
Might be an issue with PHP not active on the current site. I noticed you mentioned using PHP 8.4, but that's not something that currently exists. Might be worth PHP is active?
Alternatively, might be that the .htaccess is not being read, which is a common default as it's generally better to modify your webserver config instead. Or, could be that the rewrite apache server extension is not installed/active.

Hard to know based upon that error alone. Might be an issue with PHP not active on the current site. I noticed you mentioned using `PHP 8.4`, but that's not something that currently exists. Might be worth PHP is active? Alternatively, might be that the `.htaccess` is not being read, which is a common default as it's generally better to modify your webserver config instead. Or, could be that the `rewrite` apache server extension is not installed/active.
siteleas commented 2022年09月10日 00:49:29 +02:00 (Migrated from github.com)
Copy link

I was able to solve the problem by modifying the public/.htaccess file with the following change:
RewriteRule ^ index.php [L]
to
RewriteRule ^(.*)$ index.php?/1ドル [L]

I was able to solve the problem by modifying the public/.htaccess file with the following change: `RewriteRule ^ index.php [L]` to `RewriteRule ^(.*)$ index.php?/1ドル [L]`
ssddanbrown commented 2022年09月10日 13:46:04 +02:00 (Migrated from github.com)
Copy link

Alrighty, since you've got things working I'll close this off.
Note: Editing core app files may give you issues when it comes to running the update steps. You may need to revert/ignore your changes, upgrade, then re-apply them.

Alrighty, since you've got things working I'll close this off. Note: Editing core app files may give you issues when it comes to running the update steps. You may need to revert/ignore your changes, upgrade, then re-apply them.
Sign in to join this conversation.
No Branch/Tag specified
main
No results found.
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bookstack/devops#38
Reference in a new issue
bookstack/devops
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?