cat <<EOM >> \/home\/cpinst\/CDinstaller.sh \n#!\/bin\/bash \nfunction messenger { \necho $1 >> \/dev\/console \nwall $1 \necho $1 >> \/var\/log\/cpanel-install-autoinstaller.log \n} \nif ! nc -z httpupdate.cpanel.net 80 -w 10 > \/dev\/null; then \nmessenger \"Could not reach httpupdate.cpanel.net, aborting installation. Please resolve this issue and reboot to proceed with installation.\" \nexit \nfi \ntouch \/var\/log\/cpanel-install-thread0.log \ntouch \/var\/log\/cpanel-install-thread1.log \nmessenger \"Starting CentOS system update\" \nyum update -y \nmessenger \"Finished CentOS system update, starting cPanel installation\" \ncd \/home\/cpinst \n## PRE INSTALLATION SECTION \nwget http:\/\/httpupdate.cpanel.net\/latest \nmkdir -p \/usr\/local\/cpanel\/logs \nCPANEL_LOGGER_FILE:\/usr\/local\/cpanel\/logs\/cpanel-install-autoinstaller.log \nsh latest \nif [ -d \"\/var\/cpanel\" ]; then \nmv \/etc\/motd.orig \/etc\/motd \nmessenger \"cPanel installation Complete\" \nfi \n## POST INSTALLATION SECTION \nEOM<\/code><\/p>\nWithin the CDinstaller.sh file, we have an additional function that we should note:\u00a0 \u201cmessenger\u201d. This function is used for providing status updates to the shell and logs. Anytime an action is added, the messenger function should be used to send a status update.<\/p>\n
Setting your branch<\/strong> \nThe most basic of tasks would be to add a branch. You can easily accomplish this by echoing the string \u201cCPANEL=$branch\u201d to \/etc\/cpupdate.conf. For example, in the pre-installation section of cpanel-ks.cfg you would add: \nmessenger \u201cSetting cPanel branch to stable\u201d \necho \u201cCPANEL=stable\u201d > \/etc\/cpupdate.conf<\/code><\/p>\nThis will make the installer automatically install cPanel\u2019s stable branch.\u00a0 Valid strings for this parameter are: edge, current, release (The default cPanel installation branch) and stable.\u00a0 You can also disable automatic updates by adding \u201c-manual\u201d to the end of this string\u00a0 (e.g. \u201cCPANEL=stable-manual\u201d).<\/p>\n
Configuring cPanel<\/strong> \ncPanel\u2019s Tweak Settings configuration is handled by \/var\/cpanel\/cpanel.config. This controls options such as which webmail clients are installed, which nameserver and SMTP dameons to use, and memory limits (see: http:\/\/docs.cpanel.net\/twiki\/bin\/view\/AllDocumentation\/InstallationGuide\/AdvancedOptions for more information).\u00a0 To control these settings before installing cPanel, you will need to create the \/root\/cpanel_profile\/cpanel.config file.\u00a0 To view available options, you can look at \/var\/cpanel\/cpanel.config on an existing system.<\/p>\nThere are two logical ways to populate the cpanel.config file:<\/p>\n
One method of setting options within cpanel.config would be to simply echo values into the file: \nmkdir -p \/root\/cpanel_profile\/ \nmessenger \u201cSetting cPanel to use Courier\u201d \necho \u201cmailserver=courier\u201d >> \/root\/cpanel_profile\/cpanel.config<\/code><\/p>\ncpanel.config is portable from system to system as it contains no-system specific information.\u00a0 This means that you can generate cpanel.config on anexisting cPanel server, host it on an accessible web server, and use it with CDinstaller.sh: \nmessenger \u201cDownloading cPanel Profile\u201d \nmkdir -p \/root\/cpanel_profile\/ \nwget -O \/root\/cpanel_profile\/cpanel.config http:\/\/somehost\/cpanel.config<\/code><\/p>\nWarning<\/strong>:\u00a0 It is important to note that the installer is not normally tested with all possible permutations of cpanel.config.\u00a0 Please be aware of this fact and test your configuration before production deployment.<\/p>\nEasyApache Profiles<\/strong> \nOne thing that I find annoying about provisioning a cPanel server is having to recompile Apache\/PHP after cPanel has been installed.\u00a0 Luckily, the installer can provide an EasyApache profile so that Apache\/PHP\/etc are built with your desired settings when cPanel is installed.\u00a0 The first step to doing this is that you need to generate an EA3 profile on an existing cPanel server:<\/p>\n\nLog in to WHM.<\/li>\n Click on EasyApache (Apache Update).<\/li>\n Click Start Customizing Based on Profile.<\/li>\n Go through the steps until you reach step 5, and click on Exhaustive options list (at the bottom).<\/li>\n At the very bottom of the exhaustive options list, you will see Save Selections as Custom Profile. Fill out this information, then click on Save Only (DO NOT BUILD).<\/li>\n Click on Go back to profile screen.<\/li>\n Click on More Info next to the profile you created.<\/li>\n Click on Download profile.<\/li>\n<\/ol>\nThis will provide you with an EasyApache profile you can use during the installation of your system.\u00a0 At this point in the pre-installation section of CDinstaller.sh, you can use wget to download the \/etc\/cp_easyapache_profile.yaml to your system.<\/p>\n
messenger \u201cDownloading EA3 Profile\u201d \nwget -O \/etc\/cp_easyapache_profile.yaml http:\/\/somehost\/someprofile.yaml \n<\/code><\/p>\nInstallation of Third-Party Software<\/strong> \nI know that a lot of our customers use third-party software (this blog *is* about product integration, isn\u2019t it?).\u00a0 When setting up a server, it would be handy to have some software automatically installed.\u00a0 For example, you can automatically have CSF (ConfigServer\u2019s excellent free firewall for cPanel\/WHM) installed by specifying a few extra steps in the %post-installation section: \nmessenger \u201cInstalling CSF\u201d \nwget http:\/\/www.configserver.com\/free\/csf.tgz \ntar vzxf csf.tgz \ncd csf \n.\/install.cpanel.sh \nperl -i -pe 's\/T \nESTING = \"1\"\/TESTING = \"0\"\/' \/etc\/csf\/csf.conf \ncsf -r \ncd -<\/code><\/p>\nThis will install CSF and disable testing mode automatically (which should be fine on a fresh server).<\/p>\n
That covers all of the points we will discuss regarding kickstart provisioning in this blog post.\u00a0 In the next post of this series, I will discuss how to automate the Getting Started Wizard in WHM.<\/p>\n","protected":false},"excerpt":{"rendered":"
In my last post I talked about how to create the CentOS\/cPanel installer ISO.\u00a0 This information is good, but what if you want to do something more?\u00a0 What if you wanted to pre-configure cPanel? What if you wanted cPanel to automatically use a certain EasyApache profile? You can easily accomplish this in a way that […]<\/p>\n","protected":false},"author":77,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[49],"tags":[385],"class_list":["post-63173","post","type-post","status-publish","format-standard","hentry","category-products","tag-provisioning"],"acf":[],"yoast_head":"\n
cPanel Auto Provisioning through Kickstart | cPanel<\/title>\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n