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.

Problem with custom templates for SSL host

Discussion in 'General Discussion' started by thobarn, Jul 29, 2010.

  1. thobarn

    thobarn Well-Known Member

    Joined:
    Apr 25, 2008
    Messages:
    153
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    sanctum sanctorum
    I am having a problem while customizing the template for httpd.conf generation for an SSL domain. Below are steps I am taking and the error message I am receiving.

    1-[OK] - Create a new account in WHM for subdomain.domain.com with dedicated IP, visit the default page at http://subdomain.domain.com and http://IP.

    2-[OK] - Customise a directive following instructions (say change the ServerAdmin email address).

    Code:
    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/subdomain.domain.com custom_vhost_template_ap2 /path/to/custom_templates/username/vhost.local
    After this step /var/cpanel/userdata/username/subdomain.domain.com is created and includes as its first line custom_vhost_template_ap2: /path/to/custom_templates/username/vhost.local

    3-[OK] - Rebuild and check httpd.conf, the customization is applied correctly.

    4-[OK] - Create an SSL certificate for subdomain.domain.com and install it. Check SSL installation by visiting https://subdomain.domain.com and https://IP:443/

    5-[OK] - Make the same change as in step 2 but this time by copying ssl_vhost.default

    Code:
    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/subdomain.domain.com custom_vhost_template_ap2 /path/to/custom_templates/username/ssl_vhost.local
    After this step /var/cpanel/userdata/username/subdomain.domain.com_SSL is created and the first line of /var/cpanel/userdata/username/subdomain.domain.com is changed to custom_vhost_template_ap2: /path/to/custom_templates/username/ssl_vhost.local

    6-[FAIL] - Rebuild httpd.conf

    Rebuild fails with the error

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

    because tested httpd.conf does not have paths to .crt and .key files, though these appear correctly in /var/cpanel/userdata/username/subdomain.domain.com_SSL.

    Can you help? Thanks
     
  2. thobarn

    thobarn Well-Known Member

    Joined:
    Apr 25, 2008
    Messages:
    153
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    sanctum sanctorum
    After spending a couple of hours I am thinking, if one makes any customization to ssl_vhost.default, then paths for SSLCertificateFile and SSLCertificateKeyFile must be specified too in the customized ssl_vhost.local, or they are not found by build process, Can someone confirm if this is correct or not please? Thanks
     
  3. vexil

    vexil Member

    Joined:
    Apr 16, 2006
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    I had the same problem, and yes it appears that way.
     
Loading...

Share This Page