Problems, hosting cockpit in a subfolder on uberspace

@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)

defines.php:

<?php
define('COCKPIT_BASE_URL', '/cms');
define('COCKPIT_BASE_ROUTE', '/cms');
define('COCKPIT_DOCS_ROOT', dirname(__DIR__));
define('COCKPIT_SITE_DIR',  dirname(dirname(__DIR__)));
1 Like