Uberspace / lab

The Uberlab provides various tutorials - written by you! - on how to run software and tools on Uberspace 7.
https://lab.uberspace.de
Other
314 stars 414 forks source link

guide for Grocy does not work in subfolder #789

Closed lewumpy closed 3 years ago

lewumpy commented 3 years ago

The installation guide did not work for me for an installation in a subfolder. I had to make the following changes to get it working:

Step 3: [isabell@stardust isabell]$ ln -s public html/grocy leads to a non-functional symlink. I had to change it in [isabell@stardust isabell]$ ln -s /var/www/virtal/$USER/grocy/public html/grocy

Step 4: BASE_URL must also contain the subfolder: instead of http://isabell.uber.space/ it must be https://isabell.uber.space/grocy/ In addition to BASE_URL, BASE_PATH also had to be adapted with /grocy

Tested with Grocy 2.7.1 and Uberspace 7.7.8.0

lewumpy commented 3 years ago

@luto Why did you close this issue? A comment would have been nice if I was wrong or something else was wrong. For me the manual only worked with the changes mentioned above.

luto commented 3 years ago

woops, sorry!

lewumpy commented 3 years ago

@luto um, probably you should still reopen the issue ;)

hasmaneuroda commented 3 years ago

For me it wasn't even possible to make the whole thing run. Strictly following the guide including the corrections mentioned by @lewumpy throw me a 403 error (ForbiddenYou don't have permission to access / on this server.) Also tried it on a brandnew uberspace.

lewumpy commented 3 years ago

@hasmaneuroda Make sure that for BASE_URL in config.php not only the domain but also the subfolder is specified. So instead of https://isabell.uber.space/ it must be https://isabell.uber.space/grocy/

hasmaneuroda commented 3 years ago

@lewumpy Did that but still no chance. Just getting the 403 :(

edit: oops- I had to enter https://isabell.uber.space/grocy/in my browser to get there. I tried with https://isabell.uber.space/

sorry for the noise!

EV21 commented 3 years ago

The STYLE.md says

Don't mention additional document roots. Keep it simple. Don't use subfolders. Always use the standard document root ~/html.

I think this issue could be fixed by removing the section with the subfolder or we just move the command ln -s grocy/public html/grocy to the note section so nobody uses it by mistake by copy-and-pasting everything. I'm not sure.

@luto What do you think? - Keep it, note it or kick it? :smile:

FYI this would be the fix (keep-version):

Step 3
------

If you want to only host grocy on your Uberspace (best practice since Uberspace 7) you should link your DocumentRoot to grocy's public folder:

::

 [isabell@stardust isabell]$ rmdir html
 [isabell@stardust isabell]$ ln -s grocy/public html
 [isabell@stardust isabell]$

If you instead want to host grocy alongside other applications, just leave the html folder and create the link inside of it, like this:

::

 [isabell@stardust isabell]$ ln -s grocy/public html/grocy
 [isabell@stardust isabell]$

Please note that this will require further tweaking in the config file.

Step 4
------

Copy the default config file to ``data/config.php`` and edit it to your liking

::

 [isabell@stardust isabell]$ cd grocy
 [isabell@stardust grocy]$ cp config-dist.php data/config.php
 [isabell@stardust grocy]$ nano data/config.php
 [isabell@stardust grocy]$

You will probably want to change the ``CURRENCY`` to ``EUR`` , ``CULTURE`` to ``de``.

.. note:: If in Step 3 you decided to host your grocy installation in a subfolder, 
  also change ``BASE_PATH`` to ``/grocy``and the ``BASE_URL`` to your full url, 
  e.g. ``https://isabell.uber.space/grocy/``. 
  The config file provides more help about this in its comments, so make sure to read them.

note-version

diff --git a/source/guide_grocy.rst b/source/guide_grocy.rst
index b21c4c6..27a95cd 100644
--- a/source/guide_grocy.rst
+++ b/source/guide_grocy.rst
@@ -79,14 +79,10 @@ DocumentRoot to grocy's public folder:
  [isabell@stardust isabell]$ ln -s grocy/public html
  [isabell@stardust isabell]$

-If you instead want to host grocy alongside other applications, just leave the html folder and create the link inside of it, like this:
-
-::
-
- [isabell@stardust isabell]$ ln -s public html/grocy
- [isabell@stardust isabell]$
-
-Please note that this will require further tweaking in the config file.
+.. note:: If you instead want to host grocy alongside other applications, 
+  do not remove the html folder and create the link inside of it, like this:
+  ``ln -s grocy/public html/grocy``.  
+  Please note that this will require further tweaking in the config file.

 Step 4
 ------
@@ -103,8 +99,10 @@ Copy the default config file to ``data/config.php`` and edit it to your liking

 You will probably want to change the ``CURRENCY`` to ``EUR`` and ``CULTURE`` to ``de``.

-If you decided to host your grocy installation in a sub folder, also change the ``BASE_URL`` to your full url, e.g. ``http://isabell.uber.space/``.
-The config file provide's more help about this in it's comments, so make sure to read them.
+.. note:: If in Step 3 you decided to host your grocy installation in a subfolder, 
+  also change ``BASE_PATH`` to ``/grocy``and the ``BASE_URL`` to your full url, 
+  e.g. ``https://isabell.uber.space/grocy/``. 
+  The config file provides more help about this in its comments, so make sure to read them.
luto commented 3 years ago

To keep things simple, guides assume an empty uberspace, one application per uberspace, and installation at domain root. Sub domains are free, use them :)