From: Dan Brown Date: Sat, 27 Jul 2024 10:27:37 +0000 (+0100) Subject: Tweaked added subdirectory note X-Git-Url: http://source.bookstackapp.com/website/commitdiff_plain/8b9ff170ff8e6afedb469c11ab3c4115e6b5cc30 Tweaked added subdirectory note --- diff --git a/content/docs/admin/subdirectory-setup.md b/content/docs/admin/subdirectory-setup.md index 2ee08f4..0725efa 100644 --- a/content/docs/admin/subdirectory-setup.md +++ b/content/docs/admin/subdirectory-setup.md @@ -33,7 +33,7 @@ Before following this, ensure you have apache installed along with PHP & ensure sudo a2enmod rewrite ``` -First, You will need to choose a folder to install BookStack into. This should be a separate directory from where your main website is being served from since you don't want to risk exposing any of the private BookStack files. +First, You will need to choose a folder to install BookStack into. This must be a separate directory from where your main website is being served from since you don't want to risk exposing any of the private BookStack files. By default Apache on Ubuntu serves from the `/var/www/html` directory. In this example, we'll use `/var/www/bookstack` to store our BookStack install. If you use a different path ensure you change that path in the below steps. Create this directory and follow the standard [BookStack install steps](/docs/admin/installation) to install BookStack into this folder. Once complete, following our example directory above, you should end up with a `.env` file in the `/var/www/bookstack` folder. @@ -41,11 +41,6 @@ The next step is to alter your Apache configuration to serve any requests to you Within the `` tags of this file you'll need to add the below additional configuration. Note, the `` tags should already exist and the `...` parts represent existing rules. You should only need to copy the middle section: -> [!TIP] -> Make sure that DocumentRoot does not point to the path where you installed BookStack in. -> This is the case, if you used the install script. -> You may comment out DocumentRoot, create a new folder and define a path like /var/www/other-site - ```apache @@ -82,6 +77,8 @@ Within the `` tags of this file you'll need to add the below additi ``` +***Note:** Your BookStack installation must be in a directory **not** served by the web server via any other means. If the "DocumentRoot" of any configured host/site on the server points to, or includes, your BookStack installation folder (or a folder within it) then this will not work as expected and may introduce security issues.* + On line 6 in the above, beginning with `Alias`, You'll need to change `"/bookstack"` path to be the web 'subdirectory' you want to serve BookStack on. For example, If you wanted to serve BookStack on `https://example.com/docs` this would be `"/docs"`. Any instances of `/var/www/bookstack` in the above will need to be changed to the folder you installed BookStack in. The `/public` part of these paths should remain. Once the configuration has been updated, you'll need to restart apache. On Ubuntu you can do this with the following command: