{"id":644,"date":"2021-07-23T12:34:41","date_gmt":"2021-07-23T12:34:41","guid":{"rendered":"https:\/\/ssdsunucum.com\/blog\/best-practices-for-cpanel-virtualization-templates\/"},"modified":"2021-07-23T12:34:41","modified_gmt":"2021-07-23T12:34:41","slug":"best-practices-for-cpanel-virtualization-templates","status":"publish","type":"post","link":"https:\/\/ssdsunucum.com\/blog\/best-practices-for-cpanel-virtualization-templates\/","title":{"rendered":"Best Practices for cPanel Virtualization Templates"},"content":{"rendered":"<\/p>\n<div class=\"col-md-9\">\n<div class=\"flex-column flex-md-row article-header\"><\/div>\n<hr>\n<h2 id=\"overview\">Overview<\/h2>\n<div class=\"callout callout-danger\">\n<div class=\"callout-heading\">Warning:<\/div>\n<div class=\"callout-content\">\n<p>cPanel, L.L.C. no longer supports or recommends using the practices outlined in this document. <strong>Use this document at your own risk.<\/strong><\/p>\n<\/p><\/div>\n<\/div>\n<p>While we recommend and support the use of the usual cPanel &#038; WHM installation process, it may require more time than is necessary for Virtual Private Server (VPS) and Virtual Machine (VM) hosts. Instead, you can provision VPS or VM systems with a templated cPanel &#038; WHM environment.<\/p>\n<div class=\"callout callout-info\">\n<div class=\"callout-heading\">Note:<\/div>\n<div class=\"callout-content\">\n<p>If you offer template installations of cPanel &#038; WHM, we recommend that you become a cPanel Partner.<\/p>\n<ul>\n<li>\n<p>cPanel Partners can use our API to automatically provision their own cPanel &#038; WHM, CloudLinux\u2122, and KernelCare licenses through their billing system.<\/p>\n<\/li>\n<li>\n<p>cPanel Partners can also enable or disable some very specific options within WHM.<\/p>\n<\/li>\n<li>\n<p>For more information, see our Partner NOC requirements.<\/p>\n<\/li>\n<\/ul><\/div>\n<\/div>\n<h2 id=\"get-a-development-license\">Get a development license<\/h2>\n<p>Before you begin, apply for a free development license via our Developer License Application.<\/p>\n<ul>\n<li>\n<p>Apply for one license per template.<\/p>\n<\/li>\n<li>\n<p>IP addresses are specific to each template.<\/p>\n<\/li>\n<\/ul>\n<h2 id=\"create-a-minimal-installation-for-templating\">Create a minimal installation for templating<\/h2>\n<p>When you create <strong>templates<\/strong>, we recommend:<\/p>\n<ul>\n<li>\n<p>Creating only 64-bit templates. cPanel &#038; WHM does <strong>not<\/strong> support 32-bit systems.<\/p>\n<\/li>\n<li>\n<p>Keeping templates small (virtual disks of 10 GB or smaller). After you convert the template for a customer\u2019s VPS, use your virtualization software to automatically expand its virtual disk capacity to a 20 GB minimum.<\/p>\n<\/li>\n<\/ul>\n<h3 id=\"pre-installation-configuration-files\">Pre-installation configuration files<\/h3>\n<div class=\"callout callout-cpanel\">\n<div class=\"callout-heading\">More:<\/div>\n<div class=\"callout-content\">\n<ul>\n<li>\n<p>We provide extensive documentation on preconfiguring cPanel &#038; WHM. For more information, read our Installation Guide.<\/p>\n<\/li>\n<li>\n<p>In most cases, preconfiguring these files removes the need to log in to the VPS or VM before you grant access to your customer.<\/p>\n<\/li>\n<\/ul><\/div>\n<\/div>\n<p>We recommend that you customize the following files:<\/p>\n<div class=\"accordion-wrapper\">\n<div class=\"accordion-item\">\n<p>        Update configuration settings \u2014 \/etc\/cpupdate.conf<\/p>\n<div class=\"collapse show\" id=\"aupdate-configuration-settings--etc-cpupdate-conf1626990174582214497\">\n<div class=\"card card-body\">\n<p>This file allows you to configure cPanel &#038; WHM\u2019s release tier and other update settings.<\/p>\n<ul>\n<li>\n<p>Users can change these settings within WHM at any time. Most of these settings appear in WHM\u2019s <em>Update Preferences<\/em> interface (<em>WHM &gt;&gt; Home &gt;&gt; Server Configuration &gt;&gt; Update Preferences<\/em>)<\/p>\n<\/li>\n<li>\n<p>You <strong>cannot<\/strong> downgrade major versions, and you cannot change a server\u2019s release tier to circumvent this restriction.<\/p>\n<\/li>\n<li>\n<p>For more information, read our Product Versions and the Release Process and The cPanel &#038; WHM Update Configuration File \u2014 cpupdate.conf documentation.<\/p>\n<\/li>\n<\/ul><\/div>\n<p>\n    <\/div>\n<\/div>\n<div class=\"accordion-item\">\n<p>        Update download location settings \u2014 \/etc\/cpsources.conf<\/p>\n<div class=\"collapse show\" id=\"aupdate-download-location-settings--etc-cpsources-conf1626990174583964492\">\n<div class=\"card card-body\">\n<p>This file determines the locations that your server downloads updates from.<\/p>\n<ul>\n<li>\n<p>By default, cPanel &#038; WHM servers retrieve updates directly from cPanel, L.L.C. through our <code>httpupdate.cpanel.net<\/code> pool of update servers.<\/p>\n<\/li>\n<li>\n<p>If you are a cPanel Partner with your own FastUpdate server, you can edit the <code>HTTPDUPDATE<\/code> setting to only update from that FastUpdate server:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-perl\" data-lang=\"perl\">HTTPUPDATE<span style=\"color:#f92672\">=<\/span>fastupdate<span style=\"color:#f92672\">.<\/span>example<span style=\"color:#f92672\">.<\/span>com<\/code><\/pre>\n<\/div>\n<\/li>\n<li>\n<p>For more information, read our Customize Your Installation documentation.<\/p>\n<\/li>\n<\/ul><\/div>\n<p>\n    <\/div>\n<\/div>\n<div class=\"accordion-item\">\n<p>        Basic server settings \u2014 \/etc\/wwwacct.conf<\/p>\n<div class=\"collapse show\" id=\"abasic-server-settings--etc-wwwacct-conf1626990174584118113\">\n<div class=\"card card-body\">\n<p>This file contains basic server information for cPanel &#038; WHM, including the IP address, nameservers, and home directory.<\/p>\n<ul>\n<li>\n<p>This includes most of the settings that appear in WHM\u2019s <em>Basic WebHost Manager Setup<\/em> interface (<em>WHM &gt;&gt; Home &gt;&gt; Server Configuration &gt;&gt; Basic WebHost Manager\u00ae Setup<\/em>).<\/p>\n<\/li>\n<li>\n<p>For more information, read our Customize Your Installation documentation.<\/p>\n<\/li>\n<\/ul><\/div>\n<p>\n    <\/div>\n<\/div>\n<div class=\"accordion-item\">\n<p>        cPanel &#038; WHM configuration settings \u2014 \/var\/cpanel\/cpanel.config<\/p>\n<div class=\"collapse show\" id=\"acpanel-whm-configuration-settings--var-cpanel-cpanel-config1626990174584318715\">\n<div class=\"card card-body\">\n<p>This file contains extensive configuration options for cPanel &#038; WHM.<\/p>\n<ul>\n<li>\n<p>This includes most of the settings that appear in WHM\u2019s <em>Tweak Settings<\/em> interface (<em>WHM &gt;&gt; Home &gt;&gt; Server Configuration &gt;&gt; Tweak Settings<\/em>) as well as other settings throughout cPanel &#038; WHM.<\/p>\n<\/li>\n<li>\n<p>For more information, read our The cpanel.config File documentation.<\/p>\n<\/li>\n<\/ul><\/div>\n<p>\n    <\/div>\n<\/div>\n<\/div>\n<h3 id=\"cpanel-whm-installation\">cPanel &#038; WHM installation<\/h3>\n<p>After you finish preconfiguring your installation, you can install cPanel &#038; WHM. For more information, read our Installation Guide.<\/p>\n<h3 id=\"post-installation-tasks\">Post-installation tasks<\/h3>\n<p>After you have successfully installed cPanel &#038; WHM, you can set new defaults. You can also secure SSH or update your security configuration.<\/p>\n<div class=\"callout callout-danger\">\n<div class=\"callout-heading\">Warning:<\/div>\n<div class=\"callout-content\">\n<ul>\n<li>\n<p>We recommend that you do <strong>not<\/strong> log in to WHM while making the template. If you do, remove the <code>\/etc\/.whostmgrft<\/code> file before publishing the template.<\/p>\n<\/li>\n<li>\n<p>Do <strong>not<\/strong> shut down the VM to create the template until after you perform these steps.<\/p>\n<\/li>\n<\/ul><\/div>\n<\/div>\n<h4 id=\"prevent-locked-licenses\">Prevent locked licenses<\/h4>\n<p>To ensure that cPanel, L.L.C. <strong>doesn\u2019t<\/strong> lock your development license, we <strong>strongly<\/strong> recommend creating one VM per template and maintaining it. This will:<\/p>\n<ul>\n<li>\n<p>Require one license and one IP address per templating VM.<\/p>\n<\/li>\n<li>\n<p>Ensure that cPanel, L.L.C. doesn\u2019t lock your license or licenses.<\/p>\n<\/li>\n<li>\n<p>Allow you to start the VM again to perform updates.<\/p>\n<\/li>\n<\/ul>\n<p>Run the following commands to ensure that cPanel, L.L.C. does not lock your license:<\/p>\n<ul>\n<li><code>\/scripts\/restartsrv_chkservd --stop<\/code><\/li>\n<li><code>\/scripts\/restartsrv_cpsrvd --stop<\/code><\/li>\n<li><code>rm -f \/usr\/local\/cpanel\/cpanel.lisc<\/code><\/li>\n<\/ul>\n<p>The following BASH script runs these commands:<\/p>\n<div class=\"collapse-wrapper\">\n<p>        Click to view the post-template.sh script&#8230;<\/p>\n<div class=\"collapse\" id=\"click-to-view-the-post-template-sh-script---1626990174588729708\">\n<div class=\"card card-body\">\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 3\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 4\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 5\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 6\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 7\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 8\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 9\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">10\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">11\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">12\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">13\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">14\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">15\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">16\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">17\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">18\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">19\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">20\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">21\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">22\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">23\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">24\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">25\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">26\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">27\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">28\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"color:#75715e\">#!\/bin\/bash\n<\/span><span style=\"color:#75715e\"><\/span>\nreadonly PROGNAME<span style=\"color:#f92672\">=<\/span><span style=\"color:#66d9ef\">$(<\/span>basename $0<span style=\"color:#66d9ef\">)<\/span>\nreadonly PROGDIR<span style=\"color:#f92672\">=<\/span><span style=\"color:#66d9ef\">$(<\/span>readlink -m <span style=\"color:#66d9ef\">$(<\/span>dirname $0<span style=\"color:#66d9ef\">))<\/span>\nreadonly ARGS<span style=\"color:#f92672\">=<\/span><span style=\"color:#e6db74\">\"<\/span>$@<span style=\"color:#e6db74\">\"<\/span>\n\nis_file<span style=\"color:#f92672\">()<\/span> <span style=\"color:#f92672\">{<\/span>\n    local file<span style=\"color:#f92672\">=<\/span>$1\n    <span style=\"color:#f92672\">[[<\/span> -f $file  <span style=\"color:#f92672\">]]<\/span>\n<span style=\"color:#f92672\">}<\/span>\n\nis_dir<span style=\"color:#f92672\">()<\/span> <span style=\"color:#f92672\">{<\/span>\n    local dir<span style=\"color:#f92672\">=<\/span>$1\n    <span style=\"color:#f92672\">[[<\/span> -d $dir  <span style=\"color:#f92672\">]]<\/span>\n<span style=\"color:#f92672\">}<\/span>\n\nmain<span style=\"color:#f92672\">()<\/span> <span style=\"color:#f92672\">{<\/span>\n    is_dir \/usr\/local\/cpanel <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>    <span style=\"color:#f92672\">&&<\/span> \/scripts\/restartsrv_cpsrvd --stop <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>    <span style=\"color:#f92672\">&&<\/span> \/scripts\/restartsrv_chkservd --stop\n    is_file \/usr\/local\/cpanel\/cpanel.lisc <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> rm -f \/usr\/local\/cpanel\/cpanel.lisc\n    is_file \/etc\/.whostmgrft <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> rm -f \/etc\/.whostmgrft\n    echo <span style=\"color:#e6db74\">\"You should now shut down this instance and generate the template.\"<\/span>\n<span style=\"color:#f92672\">}<\/span>\n\nmain<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div><\/div>\n<\/p><\/div>\n<\/div>\n<h4 id=\"avoid-security-vulnerabilities\">Avoid security vulnerabilities<\/h4>\n<p>To avoid security issues before you finalize your template:<\/p>\n<ul>\n<li>\n<p>Remove the generated SSH host keys and temporary files.<\/p>\n<\/li>\n<li>\n<p>Clear the hostname from within the operating system and the <code>\/etc\/wwwacct.conf<\/code> file.<\/p>\n<\/li>\n<\/ul>\n<h2 id=\"finalize-your-template\">Finalize your template<\/h2>\n<p>Your templates <strong>must<\/strong> meet, and we recommend that they exceed, our system requirements. Most providers offer a few different templates.<\/p>\n<div class=\"callout callout-info\">\n<div class=\"callout-heading\">Note:<\/div>\n<div class=\"callout-content\">\n<p>Each VPS or VM needs a SWAP file or partition. Partitions must have <strong>at least<\/strong> 256 MB.<\/p>\n<\/p><\/div>\n<\/div>\n<h3 id=\"finalization-tasks\">Finalization tasks<\/h3>\n<p>After you finish the post-installation tasks, and before you deploy your VPS or VM, finalize your template. Make certain to perform each of the following actions:<\/p>\n<ul>\n<li>\n<p>Update the <code>ADDR<\/code> value in the <code>\/etc\/wwwacct.conf<\/code> file with the main IP address for the VPS or VM.<\/p>\n<\/li>\n<li>\n<p>Automatically run the <code>\/usr\/local\/cpanel\/bin\/set_hostname<\/code> script on the first boot of the image before any cPanel &#038; WHM services start. You can either randomize the hostname or set the hostname based on your customer\u2019s choice.<\/p>\n<\/li>\n<li>\n<p>If you run a 1:1 NAT environment, run the <code>\/scripts\/build_cpnat<\/code> script to build your NAT file.<\/p>\n<\/li>\n<li>\n<p>Run the <code>\/scripts\/rebuildhttpdconf<\/code> script to rebuild your Apache configuration with the correct addresses.<\/p>\n<\/li>\n<\/ul>\n<p>The following BASH script performs all of these tasks <strong>except<\/strong> for updating the <code>ADDR<\/code> value:<\/p>\n<div class=\"collapse-wrapper\">\n<p>        Click to view the cust-deploy.sh script&#8230;<\/p>\n<div class=\"collapse\" id=\"click-to-view-the-cust-deploy-sh-script---1626990174601285349\">\n<div class=\"card card-body\">\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 3\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 4\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 5\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 6\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 7\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 8\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 9\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">10\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">11\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">12\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">13\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">14\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">15\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">16\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">17\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">18\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">19\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">20\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">21\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">22\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">23\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">24\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">25\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">26\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">27\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">28\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">29\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">30\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">31\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">32\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">33\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">34\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">35\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">36\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">37\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">38\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">39\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">40\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">41\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">42\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">43\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">44\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">45\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">46\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">47\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">48\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">49\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">50\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"color:#75715e\">#!\/bin\/bash\n<\/span><span style=\"color:#75715e\"><\/span>\nreadonly PROGNAME<span style=\"color:#f92672\">=<\/span><span style=\"color:#66d9ef\">$(<\/span>basename $0<span style=\"color:#66d9ef\">)<\/span>\nreadonly PROGDIR<span style=\"color:#f92672\">=<\/span><span style=\"color:#66d9ef\">$(<\/span>readlink -m <span style=\"color:#66d9ef\">$(<\/span>dirname $0<span style=\"color:#66d9ef\">))<\/span>\nreadonly ARGS<span style=\"color:#f92672\">=<\/span><span style=\"color:#e6db74\">\"<\/span>$@<span style=\"color:#e6db74\">\"<\/span>\nreadonly HOSTNAME<span style=\"color:#f92672\">=<\/span><span style=\"color:#66d9ef\">$(<\/span>hostname --fqdn<span style=\"color:#66d9ef\">)<\/span>\nreadonly CPHULKPASS<span style=\"color:#f92672\">=<\/span><span style=\"color:#66d9ef\">$(<\/span>\/usr\/local\/cpanel\/3rdparty\/bin\/perl -MCpanel::PasswdStrength::Generate -e <span style=\"color:#e6db74\">'print Cpanel::PasswdStrength::Generate::generate_password(14)'<\/span><span style=\"color:#66d9ef\">)<\/span>\nreadonly MSECPASS<span style=\"color:#f92672\">=<\/span><span style=\"color:#66d9ef\">$(<\/span>\/usr\/local\/cpanel\/3rdparty\/bin\/perl -MCpanel::PasswdStrength::Generate -e <span style=\"color:#e6db74\">'print Cpanel::PasswdStrength::Generate::generate_password(14)'<\/span><span style=\"color:#66d9ef\">)<\/span>\nreadonly ESTATSPASS<span style=\"color:#f92672\">=<\/span><span style=\"color:#66d9ef\">$(<\/span>\/usr\/local\/cpanel\/3rdparty\/bin\/perl -MCpanel::PasswdStrength::Generate -e <span style=\"color:#e6db74\">'print Cpanel::PasswdStrength::Generate::generate_password(14)'<\/span><span style=\"color:#66d9ef\">)<\/span>\nreadonly LPROTPASS<span style=\"color:#f92672\">=<\/span><span style=\"color:#66d9ef\">$(<\/span>\/usr\/local\/cpanel\/3rdparty\/bin\/perl -MCpanel::PasswdStrength::Generate -e <span style=\"color:#e6db74\">'print Cpanel::PasswdStrength::Generate::generate_password(14)'<\/span><span style=\"color:#66d9ef\">)<\/span>\nreadonly RCUBEPASS<span style=\"color:#f92672\">=<\/span><span style=\"color:#66d9ef\">$(<\/span>\/usr\/local\/cpanel\/3rdparty\/bin\/perl -MCpanel::PasswdStrength::Generate -e <span style=\"color:#e6db74\">'print Cpanel::PasswdStrength::Generate::generate_password(14)'<\/span><span style=\"color:#66d9ef\">)<\/span>\nreadonly MYSQLPASS<span style=\"color:#f92672\">=<\/span><span style=\"color:#66d9ef\">$(<\/span>\/usr\/local\/cpanel\/3rdparty\/bin\/perl -MCpanel::PasswdStrength::Generate -e <span style=\"color:#e6db74\">'print Cpanel::PasswdStrength::Generate::generate_password(14)'<\/span><span style=\"color:#66d9ef\">)<\/span>\n\nis_file<span style=\"color:#f92672\">()<\/span> <span style=\"color:#f92672\">{<\/span>\n    local file<span style=\"color:#f92672\">=<\/span>$1\n    <span style=\"color:#f92672\">[[<\/span> -f $file  <span style=\"color:#f92672\">]]<\/span>\n<span style=\"color:#f92672\">}<\/span>\n\nis_dir<span style=\"color:#f92672\">()<\/span> <span style=\"color:#f92672\">{<\/span>\n    local dir<span style=\"color:#f92672\">=<\/span>$1\n    <span style=\"color:#f92672\">[[<\/span> -d $dir  <span style=\"color:#f92672\">]]<\/span>\n<span style=\"color:#f92672\">}<\/span>\n\nmain<span style=\"color:#f92672\">()<\/span> <span style=\"color:#f92672\">{<\/span>\n    is_dir \/usr\/local\/cpanel <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> \/usr\/local\/cpanel\/bin\/set_hostname <span style=\"color:#e6db74\">${<\/span>HOSTNAME<span style=\"color:#e6db74\">}<\/span> <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> \/usr\/local\/cpanel\/bin\/checkallsslcerts --allow-retry <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> \/scripts\/build_cpnat <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> \/scripts\/rebuildhttpdconf <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> \/scripts\/mysqlpasswd root <span style=\"color:#e6db74\">${<\/span>MYSQLPASS<span style=\"color:#e6db74\">}<\/span> <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>    is_file \/var\/cpanel\/hulkd\/password <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> \/scripts\/mysqlpasswd cphulkd <span style=\"color:#e6db74\">${<\/span>CPHULKPASS<span style=\"color:#e6db74\">}<\/span> <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> echo -e <span style=\"color:#e6db74\">\"user=\"cphulkd\"npass=\"<\/span><span style=\"color:#e6db74\">${<\/span>CPHULKPASS<span style=\"color:#e6db74\">}<\/span><span style=\"color:#e6db74\">\"\"<\/span>&gt;\/var\/cpanel\/hulkd\/password <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> \/scripts\/restartsrv_cphulkd\n    is_file \/var\/cpanel\/modsec_db_pass <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> \/scripts\/mysqlpasswd modsec <span style=\"color:#e6db74\">${<\/span>MSECPASS<span style=\"color:#e6db74\">}<\/span> <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> echo <span style=\"color:#e6db74\">${<\/span>MSECPASS<span style=\"color:#e6db74\">}<\/span> &gt;\/var\/cpanel\/modsec_db_pass\n    is_file \/var\/cpanel\/roundcubepass <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> \/scripts\/mysqlpasswd roundcube <span style=\"color:#e6db74\">${<\/span>RCUBEPASS<span style=\"color:#e6db74\">}<\/span> <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> echo <span style=\"color:#e6db74\">${<\/span>RCUBEPASS<span style=\"color:#e6db74\">}<\/span> &gt;\/var\/cpanel\/roundcubepass\n    is_file \/var\/cpanel\/eximstatspass <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> \/scripts\/mysqlpasswd eximstats <span style=\"color:#e6db74\">${<\/span>ESTATSPASS<span style=\"color:#e6db74\">}<\/span> <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> echo <span style=\"color:#e6db74\">${<\/span>ESTATSPASS<span style=\"color:#e6db74\">}<\/span> &gt;\/var\/cpanel\/eximstatspass <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> \/scripts\/restartsrv_eximstats\n    is_file \/var\/cpanel\/leechprotectpass <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> \/scripts\/mysqlpasswd leechprotect <span style=\"color:#e6db74\">${<\/span>LPROTPASS<span style=\"color:#e6db74\">}<\/span> <span style=\"color:#ae81ff\">\n<\/span><span style=\"color:#ae81ff\"><\/span>        <span style=\"color:#f92672\">&&<\/span> echo <span style=\"color:#e6db74\">${<\/span>LPROTPASS<span style=\"color:#e6db74\">}<\/span> &gt;\/var\/cpanel\/leechprotectpass\n<span style=\"color:#f92672\">}<\/span>\n\nmain<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div><\/div>\n<\/p><\/div>\n<\/div>\n<h3 id=\"deployment-tasks\">Deployment tasks<\/h3>\n<p>When you deploy the customer\u2019s VPS, you <strong>must<\/strong> automatically update some files.<\/p>\n<ul>\n<li>\n<p>If you use the <code>libguestfs virt-sysprep<\/code> command, you can do this via the <code>--firstboot<\/code> or <code>--firstboot-command<\/code> options.<\/p>\n<div class=\"callout callout-danger\">\n<div class=\"callout-heading\">Warning:<\/div>\n<div class=\"callout-content\">\n<p>If you use a tool such as <code>libguestfs virt-sysprep<\/code> to help finalize your template, ensure that you do not accidentally remove any user accounts or cron jobs.<\/p>\n<\/p><\/div>\n<\/div>\n<\/li>\n<li>\n<p>If you do <strong>not<\/strong> use the <code>libguestfs<\/code> command, consult your hypervisor\u2019s documentation for an alternative option to run scripts or commands upon first boot.<\/p>\n<\/li>\n<\/ul>\n<h2 id=\"updating-your-templates-over-time\">Updating your templates over time<\/h2>\n<p>As cPanel, L.L.C. releases updates, you will need to update your templates.<\/p>\n<ul>\n<li>\n<p>To avoid this situation, plan regular updates on all of your templates.<\/p>\n<\/li>\n<li>\n<p>To run a cPanel &#038; WHM update for your template, run the following commands:\n<\/p>\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\"><span style=\"color:#a6e22e\">yum<\/span> <span style=\"color:#a6e22e\">update<\/span> <span style=\"color:#f92672\">-<\/span><span style=\"color:#a6e22e\">y<\/span>\n<span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">scripts<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">upcp<\/span><\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<\/li>\n<\/ul>\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n<p>Before you shut down the VM or VPS to recreate the template, run the same commands from the Prevent locked licenses section above. If you don\u2019t, your license may become locked.<\/p>\n<\/p><\/div>\n<\/div>\n<h2 id=\"common-openvz-and-virtuozzo-issues\">Common OpenVZ and Virtuozzo issues<\/h2>\n<p>You may experience some common issues when you use OpenVZ or Virtuozzo.<\/p>\n<h3 id=\"hostnames\">Hostnames<\/h3>\n<p>On CentOS 7 or 8, CloudLinux 7 or 8, AlmaLinux 8, or Red Hat\u00ae Enterprise Linux\u00ae 7, your hostname may not meet the requirement for a Fully Qualified Domain Name (FQDN).<\/p>\n<ul>\n<li>\n<p>Virtuozzo controls the hostname via the VPS configuration (the <code>--hostname<\/code> option for the <code>vzctl<\/code> or <code>prlctl<\/code> commands).<\/p>\n<\/li>\n<li>\n<p>If you set the hostname manually, Virtuozzo will reset the hostname on the next reboot. Make sure to set up the full hostname correctly after you provision the VM. cPanel &#038; WHM <strong>requires<\/strong> an FQDN.<\/p>\n<\/li>\n<\/ul>\n<h3 id=\"quotas\">Quotas<\/h3>\n<p>OpenVZ and Virtuozzo <strong>require<\/strong> you to enable second-level quotas, which can cause quota-initiation issues. For more information, read:<\/p>\n<ul>\n<li>\n<p>Our Initial Quota Setup documentation.<\/p>\n<\/li>\n<li>\n<p>Virtuozzo\u2019s cPanel Quotas documentation.<\/p>\n<\/li>\n<\/ul>\n<h3 id=\"jailshell\">Jailshell<\/h3>\n<p>Jailshell requires specific steps to enable a full <code>proc<\/code> mount. For more information, read our How to Troubleshoot Jailshell Problems on a Virtuozzo or OpenVZ VPS documentation.<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Overview Warning: cPanel, L.L.C. no longer supports or recommends using the practices outlined in this document. Use this document at your own risk. While we recommend and support the use of the usual cPanel &#038; WHM installation process, it may require more time than is necessary for Virtual Private Server (VPS) and Virtual Machine (VM) &hellip;<\/p>\n","protected":false},"author":1,"featured_media":645,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/644"}],"collection":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/comments?post=644"}],"version-history":[{"count":0,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/644\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media\/645"}],"wp:attachment":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media?parent=644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/categories?post=644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/tags?post=644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}