NextCloud remove VirtualHost

Customize virtual host

Set custom virtual host and add it to trusted domains as follow:

config setprop nextcloud VirtualHost <VHOST>.<DOMAIN_NAME> config setprop nextcloud TrustedDomains <VHOST>.<DOMAIN_NAME> signal-event nethserver-nextcloud-update

How can I properly remove the virtualhost as added as above?

Please post the output of command config getprop nextcloud VirtualHost and config getprop nextcloud TrustedDomains.
If there is only one entry for each command you can use (you can use this also if you have more than one entry, but remember that these commands delete all configuration for VirtualHost and TrustedDomains)

  • config delprop nextcloud VirtualHost
  • config delprop nextcloud TrustedDomains
  • signal-event nethserver-nextlcoud-update

It just listed my single domain, so delprop worked, thanks. I still wanted the TrustedDomains so I did not delete that.

Hi there,

i also tried to remove an older virtual host. If I “reset” within servermanager:

it works fine.

Checking vhosts or letsencrypt config on commandline does not show any entries as well.

BUT … every night /etc/httpd/conf.d/zz_nextcloud.conf resets to the old settings, which used the cert of the subdomain “… oldsub.myserver.org” . This hinders httpd service from start, because the cert does not exist any more. So, every night, all servers which use httpd go down.

Any idea? As far as I can say, there is nothing in any config pointing to this setting (usage of the a virtual host for nextcloud)…

[root@nethserver ~]# config show nextcloud 
nextcloud=configuration
    HonorAdStartTls=disabled
    TrustedDomains=myserver.org
    VirtualHost=
    Wellknown=disabled

[root@nethserver ~]#  egrep -r "mysub.myserver.org" /etc/e-smith/
nothing

Cheers Axel

Problem solved: due to my problems in the past with nextcloud and letsencrypt for my subdomain (see https://community.nethserver.org/t/nextcloud-not-accessible-in-virtual-host/13038 , I made a custom script. The script uses a custom nextcloud config:

if cat /etc/httpd/conf.d/zz_nextcloud.conf | grep SSLCertificate
then
        echo OK
else

        sed -e '/Alias/{h;r /root/bin/zz_nextcloud_letsencrypt.txt' -e 'g;N}' /etc/httpd/conf.d/zz_nextcloud.conf > /etc/httpd/conf.d/zz_nextcloud.conf.new
        mv /etc/httpd/conf.d/zz_nextcloud.conf.new /etc/httpd/conf.d/zz_nextcloud.conf
        service httpd restart

fi

Removed the cronjob, problem solved.

Lesson learned: use e-smith and templates.
Cheers Axel