@Friendica Support
Hi there,
working on moving old friendica sites from a shared hosting to a VPS, I ran into the following problem I can't find a solution for. This actually happens with one 2021.04 instance but not with another (anymore), so I'm crosschecking all the settings but can't find how to solve this. Both sites were installed as 2012.04 from the start:
As visible in the screen, the site also displays the following path on top of the page, and of course calls that URL:
Different intents to fix this by changing or deleting the following settings from the console didn't work out:
Even more astonishing, sending the following setting with the console:
.. the site is displayed and works as it should be for a few minutes, and than falls back into the wrong behavior, like if the worker changes something when ever the cron kicks in. In that time span I can log in and even go thru the admin settings but this setting is not available.
Intents to modify the following specifications in local.config.php didn't work out either:
At least I figured out/ realized that
.. are actually "in charge" of defining that. So now I'm not sure either if those wrong lines somehow made it from local.config.php into the DB and are now part of the problem.
I found this conversation by @Hypolite Petovan on github:
and it actually looks like this is exactly te problem but I have no experience at all with mysql over CLI SSH and don't know what commands to use to delete the apparently wrong setting in the DB.

Is there a way to delete entries with
I did manage to change some settings from there but couldn't find any hint how to "delete" an entry entirely from there:
console config - Manage site configuration
Synopsis
bin/console config <category> <key> <value> [-h|--help|-?] [-v]
system.basepath <= /
Hi there,
working on moving old friendica sites from a shared hosting to a VPS, I ran into the following problem I can't find a solution for. This actually happens with one 2021.04 instance but not with another (anymore), so I'm crosschecking all the settings but can't find how to solve this. Both sites were installed as 2012.04 from the start:
not working version wrote:
This is Friendica, version 2021.04 that is running at the web location https://sub.domain.com/var/www/subdomaincom. The database version is 1413/1413, the post update version is 1400/1400.
working version wrote:
This is Friendica, version 2021.04 that is running at the web location https://sub.domain.com. The database version is 1413/1413, the post update version is 1400/1400.
As visible in the screen, the site also displays the following path on top of the page, and of course calls that URL:
sub.domain.com/var/www/subdomaincom
Different intents to fix this by changing or deleting the following settings from the console didn't work out:
system.basepath => /var/www/domaincom
system.urlpath => /var/www/domaincom/
Even more astonishing, sending the following setting with the console:
/bin/console config system url https://sub.domain.com
.. the site is displayed and works as it should be for a few minutes, and than falls back into the wrong behavior, like if the worker changes something when ever the cron kicks in. In that time span I can log in and even go thru the admin settings but this setting is not available.
Intents to modify the following specifications in local.config.php didn't work out either:
'system.basepath' => '',
'url.basepath' => '',
'system.urlpath'=> '',
At least I figured out/ realized that
url.
and system.
actually shouldn't be used at all as:'config' => [
],
'system' => [
],
.. are actually "in charge" of defining that. So now I'm not sure either if those wrong lines somehow made it from local.config.php into the DB and are now part of the problem.
I found this conversation by @Hypolite Petovan on github:
Table config, cat = "system" AND key = "basepath"
and it actually looks like this is exactly te problem but I have no experience at all with mysql over CLI SSH and don't know what commands to use to delete the apparently wrong setting in the DB.
Is there a way to delete entries with
bin/console
?I did manage to change some settings from there but couldn't find any hint how to "delete" an entry entirely from there:
/var/www/inversioncom/bin/console config -h
console config - Manage site configuration
Synopsis
bin/console config <category> <key> <value> [-h|--help|-?] [-v]
bin/console config system basepath /
system.basepath <= /
Hypolite Petovan
•utopiArte
•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
utopiArte
•local.config.php
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 works for a few minutes.
utopiArte
•local.config.php
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 works for a few minutes.
utopiArte
•local.config.php
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!
utopiArte
•local.config.php
bin/console config
print, this time one of the references doesn't show up anymore: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
•static/defaults.config.php
file.utopiArte
•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" ..
utopiArte
•Couldn't find any relevant setting or hint in
static/defaults.config.php
searching for the termpath
.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/
Hypolite Petovan
•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 theurlpath
together. In your case it should behttps://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.utopiArte
•Changed this setting in the
local.config.php
to phpX.y. The sites are working like before.I decided to copy/paste identically
local.config.php
of the site that does work to the one that doesn't, only changing the specific detail of DB and folder structure, and also made sure that the .conf files are alike.Still having the same problem.
Compared the print of:
/var/www/subdomaincom/bin/console config
in the few minutes it is working correctly after sending:
/var/www/subdomaincom/bin/console config system url https://sub.domain.com
and when it doesn't work but the prints are identically.
The print right now for both sites show the following quite at the bottom of the print:
The only difference between the two sites in the print is the following line quite at the top:
config.system.basepath => /
This line doesn't exist in the site that is working and I can't find a way to skip it or delete the
/
.Meld (the diff program) shows a dot in front of the the slash
./
, the simple text editor Kate doesn't.Meld actually also shows the [enter] signs in the same way, a little bit less colored, in lines that have them, like it shows the dot.
🤷♂️
(notes (to myself))
hypolite wrote:
As of now
local.config.php
does definesystem.urlpath
, but as the site that works uses the line I left it for now.hypolite wrote:
system.url
is actually not set ashttps://sub.domain.com/
but assub.domain.com
utopiArte
•After a break I started to check out everything again and did several tests.
I changed the order of the lines in local.config.php and managed to get the exact same lines and order in the bin/console prints of both sites.
The problem stayed.
Than I checked example_local.config.php to compare and found that actually any of the lines figure there, so I deleted them all together.
Right now local.config.php looks like this:
The site still behaves the same way. At first it loads correctly, and quite fast, after some minutes it starts taking lot's of time and ends up like in the screen of the initial post.
Now the bin/console config print shows only the following two specific lines related to the whole path issue, all the other references mentioned above are gone.
I have no idea how to delete the remaining references. Those lines have to figure somewhere in the DB I guess, but again, no idea what lines to execute to display them or delete them:
config.system.basepath => /
system.basepath => /var/www/subdomain
Hypolite Petovan
•No matter how you did it, the important part is that
system.basepath
must be set to the install folder, andsystem.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 showsinversion.tupambae.com/var/www/subdomaincom
even though it should showhttps://sub.domain.com
. This is governed by thesystem.url
config key.utopiArte
•To me it "feels" that
/var/www/subdomaincom
is added by some mecanism tosub.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
•system.url
config value changed?utopiArte
•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://sub.domain.com/
/var/www/subdomaincom/bin/console config system basepath /var/www/subdomaincom/
system.basepath <= /var/www/subdomaincom/
/var/www/subdomaincom/bin/console config system url https://sub.domain.com/
system.url <= https://sub.domain.com/
/var/www/subdomaincom/bin/console config system basepath /var/www/subdomaincom/
system.basepath <= /var/www/subdomaincom/
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
•Well now strangely on both sites
bin/console config
doesn't work anymore.Both throw the following error message:
Can't recall doing anything at all, accept trying to get the php imap module to work.
Hypolite Petovan
•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 withphp -i | grep curl
.Nanook
•utopiArte
•Like instead of:
/var/www/html/subdomain
or
/var/www/subdomain
just
/subdomain
?
Nanook
•[
utopiArte
•Not mentioned in the inicial post or answers as of now is the setting of
/sites-available/sub.domain.com-le-ssl.conf
sub.domain.com-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin admin@domain.com
ServerName sub.domain.com
DocumentRoot /var/www/subdomaincom
<Directory /var/www/subdomaincom>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<FilesMatch \.php$>
# 2.4.10+ can proxy to unix socket
SetHandler "proxy:unix:/run/php/phpXy4-fpm.sock|fcgi://localhost"
</FilesMatch>
# DirectoryIndex index.php
ErrorLog ${APACHE_LOG_DIR}/subdomaincom_error.log
CustomLog ${APACHE_LOG_DIR}/subdomaincom_access.log combined
# RewriteEngine on
# Some rewrite rules in this file were disabled on your HTTPS site,
# because they have the potential to create redirection loops.
# RewriteCond %{SERVER_NAME} =sub.domain.com
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/subX.domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/subX.domain.com/privkey.pem
</VirtualHost>
</IfModule>