Brugerværktøjer

Webstedsværktøjer


cpanel_on_cl8

Dette er en gammel revision af dokumentet!


Install cPanel and CloudLinux

Install CentOS 8 on the server

Create /home partition

Install extra packages

yum install wget mosh

Open firewall ports for mosh

firewall-cmd --add-service=mosh --permanent

Disable SELinux: Edit the /etc/selinux/config file to set the SELINUX parameter to disabled.

Install cPanel

https://docs.cpanel.net/installation-guide/install/

Setup services according to the guide

systemctl stop firewalld.service
Install cPanel
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest

Install CloudLinux

wget http://repo.cloudlinux.com/cloudlinux/sources/cln/cldeploy
sh cldeploy -k yourkey

Now reboot the server

Setup cPanel

In „Manage Plugins“ install ClamAV, Calendar and Contacts Server, Solr

Copy configuration from existing cPanel server using „Transfer Tool“

Update setting „Host to publish in the SRV records for Outlook autodiscover support“ to the current hostname.

Setup CloudLinux Features

Go to „CloudLinux LVE Manager“ and install the features you want.

Change the group of admin users to wheel

System Setup

Change /etc/ssh/sshd_config

Port 223

Add firewall rule

firewall-cmd --permanent --zone=public --add-port=223/tcp
firewall-cmd --reload

Add group groupadd hostinggl Create file /etc/sudoers.d/hostinggl containing this snippet

# Allow members of group hostinggl to execute any command
%hostinggl   ALL=(ALL:ALL) ALL

Setup for Hosting.gl

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

#!/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;
}

Run command to add the hook

/usr/local/cpanel/bin/manage_hooks add script /opt/hostinggl/unset_nsec3.php --stage post --category Cpanel --event UAPI::DNSSEC::enable_dnssec --manual

Add cronjob

# Sync DNS to master.ns.gl
* * * * *       sh /opt/hostinggl/copy_zones_to_ns.sh
cpanel_on_cl8.1612899295.txt.gz · Sidst ændret: 2021/02/09 19:34 af noer