A few things I want to mention before you consider automating Apache and PHP updates:
- You shouldn’t do this unless you have cPanel updates running automatically as well, for stable and release builds only. This reduces the chance of something going wrong and leaving you with broken builds across a ton of servers
- Always test your build first on one server before deploying
You have a large number of servers that are set up almost identically, and you want to schedule monthly updates to make sure PHP and Apache are always up to date, but still similar to provide consistency.
The easiest way to set this up is as follows:
1) Run EasyApache on one of the servers, configure your build as you wish, then save the profile. I would also recommend running the build to make sure that it works properly before you deploy it.
2) Go into /var/cpanel/easy/apache/profile and look for a file called _last_success.yaml. This will be the one you just saved, unless you updated a template that was already named, or you know for a fact that it’s named something else. Rename this template to something you would recognize, like latest.yaml. Edit the yaml file and change these fields:
name: Shared server buildThe name and note will identify the build in your EasyApache interface.
note: “Default build for all shared servers”
3) Move this script to the ‘custom’ folder (/var/cpanel/easy/apache/profile/custom)
From here, what I recommend doing is uploading the build template to a repository so it can be easily “grabbed”. That way each time you update the build, you would update the template in the repository and automate the command that downloads it and builds Apache. Since I named my yaml file latest.yaml, this is the command I’d run via cron on all my servers:
wget -O /var/cpanel/easy/apache/custom/latest.yaml http://repo.mydomain.com/ea/latest.yaml && /scripts/easyapache –profile=latest.yaml –buildThe following command builds the profile automtically:
/scripts/easyapache –profile=latest.yaml –buildThe latest.yaml file is the file name of the template I’m using, and –build indicates that the build should be started immediately instead of loading the EA configuration screen.
Here are a couple other options you might want to pass to /scripts/easyapache:
- –do_not_revert_on_conf_failure : Use if you want to fix httpd.conf problems manually after the build. NOT recommended for automated EA updates
- –skip-cpanel-version-check: Use if you don’t run automated cPanel updates and don’t want EasyApache to prompt for an update
- –always_do_the_latest_phps : Always use the latest PHP version, keeping in mind that “latest version” refers to the latest version available in EA
- –always_do_the_oldest_phps : Always use the oldest PHP version available in EA
http://etwiki.cpanel.net/twiki/bin/view/EasyApache3/EasyApacheHooks
No comments:
Post a Comment