froxlor / Froxlor

The server administration software for your needs - The official Froxlor development Git repository
http://www.froxlor.org
GNU General Public License v2.0
1.63k stars 458 forks source link

Froxlor web interface not accessible after upgrade to 2.1: "Domain not configured" #1205

Closed chrschn closed 10 months ago

chrschn commented 10 months ago

Since Froxlor was upgraded on my Debian bullseye server from version 2.0.24-1 to 2.1.0-1 and meanwhile 2.1.1-1, the admin interface of Froxlor is not accessible anymore. I'm getting redirected to the Domain not configured page. The redirect happens when I open my-domain.de/froxlor/. I can access my-domain.de just fine.

My setup is as follows. my-domain.de is configured in Froxlor and assigned to a customer. For that domain, I configured an Alias for Apache in the Froxlor domain settings:

Alias /froxlor "/var/www/html/froxlor"

I verified that the domain has a proper customer ID set using the CLI:

$ /var/www/html/froxlor/bin/froxlor-cli froxlor:api-call admin Domains.get '{"domainname":"my-domain.de"}'
{
    "data": {
        "id": "3",
        "domain": "my-domain.de",
        "domain_ace": "my-domain.de",
        "adminid": "1",
        "customerid": "1",
        "aliasdomain": null,
        "documentroot": "/var/customers/webs/my-user/my-domain/",
        "wwwserveralias": "1",
        "parentdomainid": "0",
        "ssl_redirect": "1",
        "specialsettings": "Alias /froxlor \"/var/www/html/froxlor\"",
        "ssl_specialsettings": "php_admin_value open_basedir \"/var/www:/tmp:/var/lib/roundcube/:/var/log/roundcube/:/usr/share/roundcube/:/etc/roundcube/:/usr/share/php/\"\nAlias /roundcube /var/lib/roundcube/public_html",
        "include_specialsettings": "1",
        "deactivated": "0",
        ....
}  

I read the v2.1 release notes and migration guide, but they didn't cover the issue I'm seeing.

System information

Logfiles There is no additional information in the Apache logs.

Additional Context One thing thing I obsoerved, which may or may not be related to this issue: When Froxlor was initially upgraded from 2.0.24-1 to 2.1.0-1, the letsencrypt cron job failed once, see stack trace below. I don't know if that was just a transient error during the upgrade or if it points to different issue.

/usr/bin/php -q /var/www/html/froxlor/bin/froxlor-cli froxlor:cron 'letsencrypt' -q 1> /dev/null

froxlor[1222417]: SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP COLUMN `ismainbutsubto`; check that it exists
froxlor[1222417]: --- DEBUG: 
#0 [internal function]: PDO->query() 
#1 /var/www/html/froxlor/lib/Froxlor/Database/Database.php(597): call_user_func_array() 
#2 /var/www/html/froxlor/install/updates/froxlor/update_2.1.inc.php(41): Froxlor\Database\Database::__callStatic() 
#3 /var/www/html/froxlor/install/updatesql.php(57): include_once('/var/www/html/f...') 
#4 /var/www/html/froxlor/lib/Froxlor/Cli/CliCommand.php(129): include_once('/var/www/html/f...') 
#5 /var/www/html/froxlor/lib/Froxlor/Cli/CliCommand.php(55): Froxlor\Cli\CliCommand->runUpdate() 
#6 /var/www/html/froxlor/lib/Froxlor/Cli/MasterCron.php(66): Froxlor\Cli\CliCommand->validateRequirements() 
#7 /var/www/html/froxlor/vendor/symfony/console/Command/Command.php(298): Froxlor\Cli\MasterCron->execute() 
#8 /var/www/html/froxlor/vendor/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run() 
#9 /var/www/html/froxlor/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand() 
#10 /var/www/html/froxlor/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun() 
#11 /var/www/html/froxlor/bin/froxlor-cli(71): Symfony\Component\Console\Application->run() #12 {main}
d00p commented 10 months ago

1) Domain not configured:

Dont use a customer-domain for froxlor or use an alias, that's not how it is intended. It will use the wrong permissions. See also https://forum.froxlor.org/index.php?/topic/20176-froxlor-21-domain-not-configured/

2) letsencrypt and sql error

That most likey happened during the update, best way to avoid this would be to stop the cron temporarily during an update

chrschn commented 10 months ago

Thanks for the super fast response!

  1. Domain not configured:

Dont use a customer-domain for froxlor or use an alias, that's not how it is intended. It will use the wrong permissions. See also https://forum.froxlor.org/index.php?/topic/20176-froxlor-21-domain-not-configured/

Alright, here is how I recovered my system:

  1. Accessed the web interface through randomhostname.my-hoster.com
  2. Deleted my-domain.de from the customer domains
  3. Set my-domain.de in the Froxlor VirtualHost settings
  4. Added the vhost custom settings for Roundcube to the default web server config in Resources / IP and ports)

Now I can access Froxlor again at my-domain.de/froxlor/, but I lost the possibility to manage email addresses for that domain in Froxlor. Is there a way to do that?

BTW, step 4 took me a moment to figure out. I had expected an option to customize the vhost settings in the Froxlor VirtualHost settings panel, but there is none. Maybe just a hint in that panel where to find the vhost settings would be nice.

2. **letsencrypt and sql error**

That most likey happened during the update, best way to avoid this would be to stop the cron temporarily during an update

That's what I thought as well.

d00p commented 10 months ago

Now I can access Froxlor again at my-domain.de/froxlor/, but I lost the possibility to manage email addresses for that domain in Froxlor. Is there a way to do that?

Well you didnt have to remove "my-domain.de" from the customer. You could've just used "froxlor.my-domain.de" for froxlor itself...(or any other non-existing subdomain)

chrschn commented 10 months ago

Well you didnt have to remove "my-domain.de" from the customer. You could've just used "froxlor.my-domain.de" for froxlor itself...(or any other non-existing subdomain)

Oh, so you're suggesting to add the domain to a customer, create a subdomain, then using that for the Froxlor vhost? That kinda sounds pretty much like using a customer domain for Froxlor, but with extra steps. ;-)

d00p commented 10 months ago

eh no, i just said that it is possible to use a subdomain of a domain to have the possibility to use said domain as customer (and hence for emails, website. etc.). No one forces you to use a main-domain like "my-domain.tld" as froxlor systemhostname....you are free to use any valid fqdn

chrschn commented 10 months ago

Got it. Thank you for your help!