Skip to main content


@utopiArte The last command looks correct, although this kind of low-level config value should be set in the config file, not with the console that only interacts with the database config.

Friendica Support reshared this.

@Hypolite Petovan

Trying to document changes and results in kind a step by step answers.
The following setting leaves the site with a blank page and results in bin/console config printing the error message:
[Error] Missing database structure config file static/dbstructure.config.php

local.config.php

'config' => [
                'system.basepath' => '/',
        ],

'system' => [
                'basepath' => '/',
                'urlpath' => '/var/www/inversioncom/',
        ],

@Hypolite Petovan

local.config.php

'config' => [
                'system.basepath' => '/',
        ],

        'system' => [
                'basepath' => '/var/www/inversioncom/',
                'urlpath' => '/var/www/inversioncom/',
        ],

bin/console config print:

config.system.basepath => /

system.basepath => /var/www/inversioncom/
system.urlpath => /var/www/inversioncom/

Site doesn't work, resulting in the screen as shown in the inicial post.
Setting the URL as described:
/var/www/inversioncom/bin/console config system url https://inversion.tupambae.com
.. the site works for a few minutes.

@Hypolite Petovan

local.config.php

'config' => [
        ],

        'system' => [
                'basepath' => '/var/www/inversioncom/',
                'urlpath' => '/var/www/inversioncom/',
        ],

bin/console config print:

config.system.basepath => /

system.basepath => /var/www/inversioncom/
system.urlpath => /var/www/inversioncom/

Site doesn't work, resulting in the screen as shown in the inicial post.
Setting the URL as described:
/var/www/inversioncom/bin/console config system url https://inversion.tupambae.com
.. the site works for a few minutes.

@Hypolite Petovan

local.config.php

'config' => [
                  ],

        'system' => [ 
                'urlpath' => '/var/www/inversioncom/',
        ],

bin/console config print:

Site doesn't work, resulting in the screen as shown in the inicial post.

Setting the URL as described:
/var/www/inversioncom/bin/console config system url https://inversion.tupambae.com
.. the site doesn't work either!

@Hypolite Petovan

local.config.php

'config' => [
        ],

        'system' => [
        ],

bin/console config print, this time one of the references doesn't show up anymore:

system.theme => frio
system.url => https://sub.domain.com
system.php_path => /usr/bin/php7.4-fpm
system.ssl_policy => 1
system.basepath => /var/www/subdomain

Site doesn't work, resulting in the screen as shown in the inicial post.
Setting the URL as described:
/var/www/inversioncom/bin/console config system url https://inversion.tupambae.com
.. the site works for a few minutes.
@utopiArte Please check the meaning of the relevant config keys in the static/defaults.config.php file.

Friendica Support reshared this.

@Hypolite Petovan

On a first glimps, I haven't found any mention of the path terms.
In any case I will wonder about the meaning of: "the meaning of the relevant config keys".
Like to say, if I can find "relevant config keys" ..

@Hypolite Petovan

Couldn't find any relevant setting or hint in static/defaults.config.php searching for the term path.

I did (again) a diff check of the print of bin/console config of the two subdomains.

The domain that doesn't work still displays the setting;
config.system.basepath => /
.. and I have no idea how to delete/ erase the /

The subdomain that works has the following line that doesn't show up in the one that doesn't work:
system.urlpath => /var/www/sudbomain2/

@utopiArte Sorry, I was on mobile and couldn’t check but these keys should have been mentioned in this file, along their purpose.

system.basepath is the absolute file path where Friendica is installed, e.g. /var/www/subdomaincom in your case.

system.urlpath should only be used if Friendica is installed in a subfolder of the domain you’re using, and is relative to that domain. It doesn't seem to be relevant to you, so it should be blank.

system.url is the absolute URL where your Friendica node is accessible. It should consist in the protocol, the domain and the urlpath together. In your case it should be https://sub.domain.com/

system.php_path should be the absolue path to the PHP CLI executable. It should not point to PHP-FPM, which is used to process web requests.

This entry was edited (1 week ago)

Friendica Support reshared this.

@utopiArte So, forget about system.urlpath, it isn't used in any way by Friendica anymore, so value or not will not change your predicament.

However, the system.url should include the scheme. It is the most important config values to determine the base URL of your Friendica install.

What do you mean by "works for a few minutes"? How many pages correctly show in the mean time? What happens when the few minutes have elapsed?

Friendica Support reshared this.

@Hypolite Petovan

What do you mean by "works for a few minutes"? How many pages correctly show in the mean time? What happens when the few minutes have elapsed?


The site works correctly for several minutes.
I can log in.
All pages show correctly, including admin pages.
Once it falls back to redirecting to:
sub.domain.com/var/www/subdomain/
.. I have to execute again:
/var/www/subdomaincom/bin/console config system url https://sub.domain.com
.. the console prints (as always):
system.url <= https://inversion.tupambae.com
and I can use the site again for several minutes before it falls back to the wrong behavior.

@utopiArte Once you set a config value using the console, changing the value in the config file won't help as the console stores the value in the DB and it has precedence over the files.

No matter how you did it, the important part is that system.basepath must be set to the install folder, and system.url must be set to the full URL. You can verify what the current value used by Friendica for either config keys is using the console.

I've browsed https://sub.domain.com and when the style is missing, the first line shows inversion.tupambae.com/var/www/subdomaincom even though it should show https://sub.domain.com. This is governed by the system.url config key.

This entry was edited (1 week ago)

Friendica Support reshared this.

@Hypolite Petovan

To me it "feels" that /var/www/subdomaincom is added by some mecanism to sub.domain.com. In particular because when setting specifically with the console command /var/www/subdomaincom/bin/console config system url -> https://sub.domain.com it works for some minutes.

@Hypolite Petovan

As last intent I tried to use the following commands to reset the two mentioned settings but the behaviour ist still the same:
/var/www/subdomaincom/bin/console config system url https://sub.domaincom
/var/www/subdomaincom/bin/console config system basepath /var/www/subdomaincom/

Can't see a solution for this.

@utopiArte When the display breaks, can you confirm the system.url config value changed?

Friendica Support reshared this.

@Hypolite Petovan

No I can't.
There is no change at all in the results of the bin/console config output (print).
Actually even the settings send and "officially" accepted by the system do not show up in the print.

Latest thing I tried, totally feed up, was to send the commands several times and also making sure they end with a slash.

So I send:
/var/www/subdomaincom/bin/console config system url https://sub.domain.com/
system.url <= https://inversion.tupambae.com/
/var/www/subdomaincom/bin/console config system basepath /var/www/subdomaincom/
system.basepath <= /var/www/inversioncom/
/var/www/subdomaincom/bin/console config system url https://sub.domain.com/
system.url <= https://inversion.tupambae.com/
/var/www/subdomaincom/bin/console config system basepath /var/www/subdomaincom/
system.basepath <= /var/www/inversioncom/

And right now it looks like it sticked, for now the site remains operative!
🙄


(please have in mind that this is 2021.04, if it weren't so outdated I'd say we need to figure out the problem because this feels like a real problem under the hood)

@utopiArte Oh I forgot this was such an old version. There still is an issue with the pictures because /var/www/subdomain/ gets prepended in the URL. Do you mind running bin/console config system and send the output to hypolite@mrpetovan.com ?

Friendica Support reshared this.

@Hypolite Petovan

Well now strangely on both sites bin/console config doesn't work anymore.
Both throw the following error message:

rootName@VPShosting:# /../doamincom/bin/console config
PHP Fatal error: Uncaught Error: Undefined constant "CURLE_OPERATION_TIMEOUTED" in /../domaincom/boot.php:229
Stack trace:
#0 /../doamincom//vendor/composer/autoload_real.php(69): require()
#1 /../doamincom//vendor/composer/autoload_real.php(59): composerRequireFriendica()
#2 /../doamincom/vendor/autoload.php(7): ComposerAutoloaderInitFriendica::getLoader()
#3 /../doamincom/bin/console.php(31): require('...')
#4 {main}
thrown in /../doamincom/boot.php on line 229

Can't recall doing anything at all, accept trying to get the php imap module to work.

@utopiArte There's no file named boot.php at the root of the Friendica install, not sure where it's coming from.

The CURLE_OPERATION_TIMEOUTED constant is defined by the PHP curl extension, please verify it is enabled in the CLI version of php with php -i | grep curl.

Friendica Support reshared this.

For what it's worth, I found friendica to be unfriendly to non-root URLs, that is to say URLs that aren't at /, so I setup a subdomain specifically for friendica, https://friendica.eskimo.com/. You may wish to give that a try. The machine domain does not need to be this, you can do it by configuring DNS to point to the base IP of the machine and then configuring a subdomain in Apache or Nginx as a virtual host.

Not sure if I get what you mean with none-root @Nanook.

Like instead of:
/var/www/html/subdomain
or
/var/www/subdomain
just
/subdomain
?

Also, this is a btop from an 18 core machine with 256GB of RAM with the major load being friendica, a secondary load is hubzilla, mastodon, and miskey, but friendica represents more load than the latter three combined, but it also gets more traffic than the latter three combined. But what I am getting at here, you may want to consider dedicating a physical server. I'll grant you it's busier than usual as we've just returned the server to service after three months of downtime, 7 motherbords, three power supplies, and two CPU's later.

[