Our documentation is getting an overhaul! We would like your input! Click here to take a look at the beta launch of our new documentation site! Only cPanel & WHM version 82 documentation exists on our beta at this time. 84 will be added to the new site soon! Leave your feedback here: https://go.cpanel.net/docsfeedback
WHM API 1 Functions - delete_ssl_vhost - Developer Documentation - cPanel Documentation
Child pages
  • WHM API 1 Functions - delete_ssl_vhost
Skip to end of metadata
Go to start of metadata

Description

This function deletes the SSL virtual host.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/delete_ssl_vhost?api.version=1&host=example.com
 Command Line
whmapi1 delete_ssl_vhost host=example.com


Notes:

  • Unless otherwise noted, you must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
   "data":{
      "removed_vhost_data":[
         {
            "ip_port":[
               "192.0.2.0",
               "443"
            ],
            "servername":"example.com",
            "is_ssl":"1",
            "primary_on_ip_port":"example.net",
            "vhost_entry":"\n<VirtualHost 192.0.2.0:443>\n ..."
         }
      ],
      "output":[
         "Deleting the SSL host for “example.com” …",
         "Done."
      ]
   },
   "metadata":{
      "result":1,
      "command":"delete_ssl_vhost",
      "reason":"OK",
      "version":1
   }
}


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
hoststring

Required

The hostname whose SSL virtual host you'd like to delete.

A valid URL.

example.com

Returns

ReturnTypeDescriptionPossible valuesExample
outputarray

Shows the status of the deletion.

An array of status messages.
"Deleting the SSL host for “example.com” …", "Done."
removed_vhost_dataarray of hashes

The virtual host data that the script removed.


This array of hashes includes the ip_port, is_ssl, primary_on_ip_port, servername, and vhost_entry returns.


ip_port

array

The IP address where the virtual host data resided and its port number.

The function returns this value in the removed_vhost_data array of hashes.

A valid IP address and port."192.0.2.0","443"

is_ssl

Boolean

Whether the virtual host was SSL.

The function returns this value in the removed_vhost_data array of hashes.

  • 1 — The host was SSL.
  • 0 — The host was not SSL.
1

primary_on_ip_port

string

The domain name that the removed virtual host used.

The function returns this value in the removed_vhost_data array of hashes.

A valid domain name.example.net

servername

string

The name of the deleted domain.

The function returns this value in the removed_vhost_data array of hashes.

A valid domain name.example.com

vhost_entry

string

The text of the deleted virtual host entry.

The function returns this value in the removed_vhost_data array of hashes.

The virtual host entry's output.\n<VirtualHost 192.0.2.0 :443>\n ServerName example.com\n ServerAlias [...]