i am currently trying to host a site on uberspace in a subfolder. Another cockpit project, that is lying in my root is working perfectly fine, but i somehow struggle to overcome problems with my project in the subfolder. This is the error i am getting:
My project is lying under /var/www/virtual/username/html/nino-dornemann.de/cms
but somehow it is trying to resolve the path to /var/www/virtual/username/nino-dornemann.de/cms
without the html-part.
Your primary docs root is in /var/www/virtual/$USER/html and all connected domains point to that root if there is no matching folder (secondary docs root) in /var/www/virtual/$USER/sub.domain.tld.
So /var/www/virtual/$USER/nino-dornemann.de/cms should be the right place.
If you use it that way, $_SERVER['DOCUMENT_ROOT'] still points to /var/www/virtual/$USER/html.
Without RewriteBase the somewhat same error occurs:
Not found
The requested URL /var/www/virtual/$USER/www.nino-dornemann.de/cms/index.php was not found on this server
As naive as i am i also renamed the folder to www.nino-dornemann.de, so that the path actually NEEDS to hit the index.php but unfortunately it does not.
@nino1337 I was able to reproduce your setup with the help of this thread (working example for Uberspace in a secondary docs root, but not in a subfolder):
This works, if your cockpit instance is in a subfolder /cms:
# connect domain
uberspace web domain add test.domain.tld
# set A and AAAA records at your domain provider...
# create docs root
cd /var/www/virtual/$USER
mkdir test.domain.tld
cd test.domain.tld
git clone https://github.com/agentejo/cockpit.git cms
cd cms
nano .htaccess
# set RewriteBase /cms
# Be aware, that .htaccess might be overridden with the next cockpit update
nano defines.php
# set constants (see below)