Intuitive bash/shell script to setup and harden/configure cPanel CentOS/RHEL server with ConfigServer Firewall, MailManage, MailQueue, Malware Detect, ClamAV, mod_cloudflare, CloudFlare RailGun, and many more applications and security tweaks
Shell 27.91%PHP 31.14%Perl 40.95%
cpsetup's Introduction
cpSetup
Author: Myles McNamara Version: 1.4.0 Last Update: February 1, 2017
cpsetup is a custom bash/shell script to setup and harden/configure cPanel CentOS/RHEL server with a wide range of applications, plugins, and modules. This script will also install cPanel if it's not already installed.
Each installation and configuration/hardening is organized into functions. By default running the script without any arguments will prompt for each install/configuration as well as prompt for any required configs (email, api key, etc).
You can also run any of the available functions individually ... to see a list of functions available, execute this command:
You tell me, open up an issue and suggest a new feature!
Depreciated Functions/Installs (*)
Name
Reason
Account DNS Check
Reported to no longer work on CentOS 7, or WHM > 11.52
PHP.INI Manager
WHM now has built in handling, and unsure of status of plugin
Clean Backups
No longer works or updated?
I decided to remove these from the auto install process because I either do not know the status of them (compatibility wise) with WHM,
they are not compatible with latest release, or because the developers either do not provide ANY changelog, or even if they do,
they don't even date the versions, which IMO is sloppy dev work, and as such, they do not belong in the auto install process.
Available Arguments
cpsetup - sMyles cPanel Setup Script
Usage example:
./cpsetup [(-h|--help)] [(-v|--verbose)] [(-V|--version)] [(-u|--unattended)] [(-m|--menu)] [(-r|--run) value] [(-R|--functions)]
Options:
-h or --help: Displays this information.
-v or --verbose: Verbose mode on.
-V or --version: Displays the current version number.
-u or --unattended: Unattended installation ( bypasses all prompts ).
-m or --menu: Show interactive UI menu (NOT yet implimented)
-r or --run: Run a specific function.
-R or --functions: Show available functions to use with -r or --run command.
Firewall Updates
Option
Original Value
New Value
RESTRICT_SYSLOG
0
3
SMTP_BLOCK
0
1
LF_SCRIPT_ALERT
0
1
SYSLOG_CHECK
0
1800
PT_ALL_USERS
0
1
SSH Updates
Any options that have (prompt) means you will be prompted to specify your own custom value if -u was not used as an argument.
Use at your own risk, if you don't know what you're doing you should probably not be using this script. Myself and any contributors to this project take absolutely no responsibility for anything you do with this script. I strongly recommend reading the script so you understand what it does before using.