Configure proxy SSL using apache and cpanel

Versi Bahasa Indonesia

  1. Create an account for whitelabel domain in cpanel
  2. Create file template in “/var/cpanel/templates/[CPANEL_USER]”
  3. Fill file /var/cpanel/templates/[CPANEL_USER] with configuration below, make sure parameter [IP_PROXY], [CRT_PATH],[KEY_PATH],[RESELLER_ID],and [DOMAIN_PROXY] has been adjusted base on your configuration
    <VirtualHost [IP_PROXY]:443> 
        SSLEngine on 
        SSLProxyEngine On 
        SSLCertificateFile [CRT_PATH] 
        SSLCertificateKeyFile [KEY_PATH]
        RequestHeader set srsx-enable-ssl "TRUE" 
        ProxyPreserveHost On 
        ProxyPass / http://srb[RESELLER_ID] 
        ProxyPassReverse / http://srb[RESELLER_ID] 
        ServerName [DOMAIN_PROXY]
  4. Compile with command below, make sure CPANEL_USER and [DOMAIN_PROXY] has been adjusted:
    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/[CPANEL_USER]/[DOMAIN_PROXY] custom_vhost_template_ap2 /var/cpanel/templates/[CPANEL_USER]
  5. Rebuild httpd conf:
  6. Restart httpd
    /etc/init.d/httpd restart