# Run copy\_cert\_all.cgi from CLI

**URL:** <https://forum.virtualmin.com/t/run-copy-cert-all-cgi-from-cli/129620>\
**Category:** Virtualmin\
**Created:** [October 5, 2024, 5:43pm UTC](https://forum.virtualmin.com/t/run-copy-cert-all-cgi-from-cli/129620 "2024-10-05T17:43:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![quaternion7](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/q/d78d45/32.png) [@quaternion7](https://forum.virtualmin.com/u/quaternion7)\
**Post date:** [October 5, 2024, 5:43pm UTC](https://forum.virtualmin.com/t/run-copy-cert-all-cgi-from-cli/129620/1 "2024-10-05T17:43:29Z")

</div>

| SYSTEM INFORMATION | |
| --- | --- |
| OS type and version | Rocky Linux 8.10 |
| Webmin version | 2.202 |
| Virtualmin version | 7.20.2 |
| Webserver version | Apache version 2.4.37 |
| Related packages | — |

Hey folks,  
I’m automating the provisioning of my infrastructure using Terraform and Ansible, and based on other posts I was able to get almost everything working. There is only one thing left, which is copying the SSL ceritificate issued on a virtualhost domain, to all the other services in webmin.  
The script is `copy_cert_all.cgi`, which is the one that runs when we click the button “Set as Default Services Certificate”.  
I looked at the docs for both CLI and virtualmin APIs and could not find an endpoint for it.  
So I tried to run that script directly from the CLI but there must be some environment dependencies missing.  
I tried to run:

```auto
WEBMIN_CONFIG=/etc/webmin REMOTE_USER=root QUERY_STRING="dom=17281367742002117" /usr/libexec/webmin/virtual-server/copy_cert_all.cgi

```

But got as a result:

```auto
Strict-Transport-Security: max-age=0;
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval'; frame-src 'self'; child-src 'self'
X-Content-Type-Options: nosniff
X-no-links: 1
Content-type: text/html; Charset=UTF-8

Undefined subroutine &WebminCore::fetch_content called at /usr/libexec/webmin/authentic-theme/authentic.pl line 48.

```

What would be a proper way to do this?

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [December 4, 2024, 5:43pm UTC](https://forum.virtualmin.com/t/run-copy-cert-all-cgi-from-cli/129620/2 "2024-12-04T17:43:51Z")

</div>

Closed on December 4, 2024, 5:43pm UTC

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