Last active
October 5, 2023 15:54
-
-
Save jpswade/4e2826d5c88cee4eac72 to your computer and use it in GitHub Desktop.
Install cPanel for CentOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# setup_cpanel - Setup new cPanel Server. | |
# @see https://gist.github.com/jpswade/4e2826d5c88cee4eac72 | |
# @see https://docs.cpanel.net/installation-guide/cpanel-dnsonly-installation/ | |
set -e | |
### Settings | |
CPANEL_SCRIPT_URL=http://httpupdate.cpanel.net/ | |
CPANEL_SCRIPT=latest | |
[[ "$1" == dnsonly ]] && CPANEL_SCRIPT=latest-dnsonly | |
echo ${CPANEL_SCRIPT} | |
### Logic | |
yum -y groupremove "FTP Server" "GNOME Desktop Environment" "KDE (K Desktop Environment)" "Mono" "Mail Server" "E-mail Server" "Web Server" "X Window System" | |
echo SELINUX=disabled>/etc/selinux/config | |
echo SELINUXTYPE=targeted>>/etc/selinux/config | |
chkconfig iptables off | |
service iptables stop | |
yum -y update | |
yum -y install perl nano | |
wget -N ${CPANEL_SCRIPT_URL}/${CPANEL_SCRIPT} -O ~/${CPANEL_SCRIPT} | |
sh ~/${CPANEL_SCRIPT} --force | |
/scripts/configure_rh_firewall_for_cpanel | |
# Remove the Trial License banner | |
mv /usr/local/cpanel/cpanel.lisc /root/trashfiles/ | |
mv /root/.cpanel/datastore/_usr_local_cpanel_cpanel_-F /root/trashfiles/ | |
/usr/local/cpanel/scripts/restartsrv_cpsrvd | |
/usr/local/cpanel/cpkeyclt | |
echo Done! | |
#EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment