The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to undo customized template

Discussion in 'EasyApache' started by clusters, Nov 20, 2015.

  1. clusters

    clusters Registered

    Joined:
    Nov 20, 2015
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Los Angeles
    cPanel Access Level:
    Root Administrator
    I followed the instructions here to create a custom template for a virtual host. It failed because of the missing SSLCertificateFile argument error.

    "SSLCertificateFile takes one argument, SSL Server Certificate file (`/path/to/file' - PEM or DER encoded)"

    Ok, so the question i have is how do I undo the last step "custom_vhost_template" and remove the "necessary information from the data structure?"

    "perl -MYAML::Syck -e \
    'my $hr = YAML::Syck::LoadFile($ARGV[0]);$hr->{$ARGV[1]} = $ARGV[2];YAML::Syck::DumpFile($ARGV[0],$hr);' \
    /var/cpanel/userdata/$username/$domainname custom_vhost_template_ap2 $path/to/template"

    Thanks for your help!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. clusters

    clusters Registered

    Joined:
    Nov 20, 2015
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Los Angeles
    cPanel Access Level:
    Root Administrator
    At first I modified the first line to:

    <VirtualHost[% FOREACH ipblock IN vhost.ips %] [% ipblock.ip %]:442[% END %]>

    It didn't work...so changed it back to the original template file...

    <VirtualHost[% FOREACH ipblock IN vhost.ips %] [% ipblock.ip %]:[% ipblock.port %][% END %]>

    Still didn't work...

    Now, I have used this command to "set up the necessary data structure..."

    "perl -MYAML::Syck -e \
    'my $hr = YAML::Syck::LoadFile($ARGV[0]);$hr->{$ARGV[1]} = $ARGV[2];YAML::Syck::DumpFile($ARGV[0],$hr);' \
    /var/cpanel/userdata/$username/$domainname custom_vhost_template_ap2 $path/to/template"

    But I have no way to undo it...except for using vi to remove the first line in /var/cpanel/userdata/username/subdomain.domain.com

    custom_vhost_template_ap2: /path/to/custom_templates/username/ssl_vhost.local <--- man handle deleted...

    Automation...

    Was that a correct way to deal with that added line?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator

Share This Page