Save_domain.cgi for all domains

Installed:
Usermin 1.823
Webmin 1.974
Virtualmin 6.16

Instructions:

Configured, I get certificates from letsencrypt.
But: I modified the /usr/share/webmin/virtualmin-nginx-fpm/save_domain.cgi file to suit my needs (plugin: nginx + php-fpm), and I need to run save_domain.cgi for all domains so that it creates the “correct” config files of sites.
Actually, the question is: how can you execute the save_domain.cgi file for each domain? Those. do not go to the domain settings in Virtualmin and do not click “Save” for each site so that it resave the file /etc/nginx/sites-available/site.conf.*

  • means “save settings” with the “ssl” checkbox, which not all domains have.

If the answer has already been given, please bend me and show me where it is (English is not my first language).

Hi,

The question is – how can you execute the save_domain.cgi file for each domain … means “save settings” with the “ssl” checkbox, which not all domains have.

Yes, it is possible to enable Nginx SSL website feature for all domains using Virtualmin CLI, by running the following from a custom script:

#!/usr/bin/env bash
doms=`virtualmin list-domains --name-only --without-feature virtualmin-nginx-ssl`
for dom in $doms; do
   virtualmin enable-feature --domain $dom --virtualmin-nginx-ssl
done

Hello. By running the command:

sudo virtualmin list-domains --without-feature virtualmin-nginx-ssl

I am getting a bunch, list of domains. However: some (very many) are cropped. Example:

xn----7sbabecb1aslp6blcmwlcep5 XXX YYY

How to fix it?

Does the code exampled in my previous comment ran from a custom shell script works or fails? If fails what error does it return?

Apologizes, I forgot to include --name-only switch, so the command should be:

#!/usr/bin/env bash
doms=`virtualmin list-domains --name-only --without-feature virtualmin-nginx-ssl`
for dom in $doms; do
   virtualmin enable-feature --domain $dom --virtualmin-nginx-ssl
done

Hello. Sorry for the long absence. When trying to enter
sudo virtualmin enable-feature --domain site.ru --virtualmin-nginx-ssl
The console writes to me:

Unknown parameter --virtualmin-nginx-ssl
Enables features for one or more domains specified on the command line.
virtualmin enable-feature --domain name | --user name | --all-domains
[–associate]
[–unix]
[–dir]
[–dns]
[–mail]
[–webalizer]
[–logrotate]
[–mysql]
[–spam]
[–virus]
[–webmin]
[–virtualmin-awstats]
[–virtualmin-nginx-fpm]
[–virtualmin-nginx]
[–skip-warnings]

If I use --virtualmin-nginx-fpm then can I pass the ssl parameter? Or do I need to approach the question differently?

It means that this feature isn’t install and/or not enabled on System Settings ⇾ Features and Plugins page.

I found, after a search time (I have a Russian version, and for some reason I did not switch to English). Having solved several problems to enable the function you specified (@Ilia), when I try to execute sudo virtualmin enable-feature --domain site.ru --virtualmin-nginx-ssl, I write:

An SSL website cannot be enabled unless a regular website is

In the domain settings I have(Dot marked ‘what is included’ ):

  • Enable DNS Domain
    Nginx website enabled
    Nginx SSL website enabled
  • Enable MariaDB database
  • AWstats reporting
  • Enable Nginx PHP-FPM website

Those. “Enable Nginx PHP-FPM website” is enabled and not “Nginx website enabled”. Actually, what is the way out of the situation?

First of all user didn’t say what os is this for, it’s obvious to me not to others what os is he begged on…also who else need this option or who asked this in previous day’s, years months? Is this really useful waste of time @Ilia

This error is self-explanatory and requires regular (non-SSL) website to be enabled. Try the following command, which will also makes sure to enable regular website:

virtualmin enable-feature --domain site.ru --virtualmin-nginx --virtualmin-nginx-ssl

We need to make sure that we have all, even little features working correctly and as designed, while trying to help a user whenever possible.

sudo virtualmin enable-feature --domain site.ru --virtualmin-nginx --virtualmin-nginx-ssl

It answers me:
Nginx FPM cannot be enabled for a domian that has an Nginx website

Let me explain: included:
Enable MariaDB database
AWstats reporting
Enable Nginx PHP-FPM website
Enable DNS Domain

Off (no ticks)
Nginx website enabled
Nginx SSL website enabled

The plugins “Nginx website enabled” and “Enable Nginx PHP-FPM website” are mutually exclusive: you cannot enable both at the same time. Result: when “Enable Nginx PHP-FPM website” is enabled, when nginx + php-fpm is running → it is not possible to connect “Nginx SSL website enabled”. And with “Nginx website enabled” php does not work.

If important: the plugin “Enable Nginx PHP-FPM website” was downloaded from the Internet and installed manually (uploaded to the server - console - installation command for the “webmin-virtualmin-nginx-fpm_1.0.4_all.deb” package).

Any ideas / tips on “how to fix this problem”?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.