Brugerværktøjer

Webstedsværktøjer


cpanel_server_setup

Forskelle

Dette viser forskellene mellem den valgte og den nuværende udgave af dokumentet. Gul er linjer der findes i den gamle udgave, og grøn er linjer der findes i den nuværende.

Link til denne sammenlinings vising

Begge sider forrige revision Forrige revision
cpanel_server_setup [2017/09/01 23:14]
noer
cpanel_server_setup [2021/01/26 19:43] (nuværende)
noer
Linje 113: Linje 113:
  
 == DNS == == DNS ==
 +Add hook to unset NSEC3 when DNSSEC is enabled, because otherwise it cannot be transferred to the DNS slave server.
 +
 +Put script in ''/opt/hostinggl/unset_nsec3.php''
 +<code>
 +#!/usr/local/cpanel/3rdparty/bin/php -q
 +<?php
 +
 +// Get decoded input.
 +$input = get_passed_data();
 +
 +// Declare return variables and set their values.
 +list($result_result, $result_message) = unset_nsec3($input);
 +
 +// Return the return variables.
 +echo "$result_result $result_message";
 +
 +// Perform the hooks action, using the decoded input.
 +function unset_nsec3($input = array()) {
 +    // Insert your actions here.
 +    $domain = $input['data']['args']['domain'];
 +    system("whmapi1 unset_nsec3_for_domains domain=$domain");
 +
 +    // Set success and failure messages.
 +    $result = "1";                            // This Boolean value is set to fail.    
 +    $message = "This is an error message.";   // This string is a reason for $result.
 +
 +    // Return the hook result and message.
 +    return array($result, $message);
 +}
 +
 +// Process data from STDIN.
 +function get_passed_data() {
 +
 +    // Get input from STDIN.
 +    $raw_data;
 +    $stdin_fh = fopen('php://stdin', 'r');
 +    if ( is_resource($stdin_fh) ) {
 +        stream_set_blocking($stdin_fh, 0);
 +        while ( ($line = fgets( $stdin_fh, 1024 )) !== false ) {
 +            $raw_data .= trim($line);
 +        }
 +        fclose($stdin_fh);
 +    }
 +
 +    // Process and JSON-decode the raw output.
 +    if ($raw_data) {
 +        $input_data = json_decode($raw_data, true);
 +    } else {
 +        $input_data = array('context'=>array(),'data'=>array(), 'hook'=>array());
 +    }
 +
 +    // Return the output.
 +    return $input_data;
 +}
 +</code>
 +
 +Run command to add the hook
 +<code>
 +/usr/local/cpanel/bin/manage_hooks add script /opt/hostinggl/unset_nsec3.php --stage post --category Cpanel --event UAPI::DNSSEC::enable_dnssec --manual
 +</code>
 +
 Create new user on ''master.ns.gl'' for the new host. Create new user on ''master.ns.gl'' for the new host.
  
cpanel_server_setup.txt · Sidst ændret: 2021/01/26 19:43 af noer