question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test/Solution: grocy 2.6.1 and subdirectory installation on Apache

See original GitHub issue

I’ve finally made some own test. It works, like this:

References #623, #619 and #661.

Debian 10.3 / Apache 2.4.38 / PHP 7.3

Base install

apt install apache2 php7.3 php7.3-sqlite3 unzip
a2enmod rewrite
cd /var/www/html
wget https://releases.grocy.info/v?2.6.1 -O grocy.zip
unzip grocy.zip -d grocy
chown -R www-data:www-data ./grocy/data

=> Webserver document root = /var/www/html => grocy directory = /var/www/html/grocy

Without URL rewriting

Changed config.php settings:

Setting('BASE_PATH', '/grocy/public/index.php');
Setting('BASE_URL', 'http://<HOST>/grocy/public');
Setting('DISABLE_URL_REWRITING', true);

(Nothing else was changed in the default webserver/PHP config files.)

=> http://<HOST>/grocy/public/index.php/ is working (note the trailing slash for the root/main route)

With URL rewriting

Changed config.php settings

Setting('BASE_PATH', '/grocy/public');
Setting('BASE_URL', 'http://<HOST>/grocy/public');

To allow .htaccess overrides, this was added to /etc/apache2/apache2.conf:

<Directory /var/www/html/grocy>
	AllowOverride All
</Directory>

=> http://<HOST>/grocy/public/ is working (note the trailing slash for the root/main route)

Additional notes

Add a .htaccess file in /var/www/html/grocy/data with the following content to disallow direct access to the data dirctory (e. g. that someone can download the grocy database file)

Deny from all

Conclusion

Basically, BASE_PATH needs to be set to the part (of the URL) after the document root, if URL rewriting is disabled, including index.php.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:21 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
emk2203commented, Apr 4, 2020

Not quite, I need to see what to adapt for nginx here. My first quick try was not successful. I edit this later when I find out something.

0reactions
berrndcommented, Apr 5, 2020

@dragoscazaceanu1313 please use the subbredit for custom setup questions, thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tweets with replies by Bernd Bestel (@BerndBestel) / Twitter
ERP beyond your fridge - grocy is a web-based self-hosted groceries ... Test/Solution: grocy 2.6.1 and subdirectory installation on Apache · Issue #694 ......
Read more >
Untitled
Batman arkham knight pc dlc, Madtracker 2.6.1 crack, Torniate verbo, ... Rocketfish wireless speaker setup, True geordie gaming the last of us, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found