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).
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
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?
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:
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).