Apache & PHP Customization
← Go BackCreating Automated Post Production Tests
- Q: How can I add my own tests to the ones that are run after everything is successfully built and Apache is restarted?
- A: Simply create an "opt mod" that does so.
Doing tests in the user's directory as root is extremely insecure unless you setuid to the user in question before doing anything. If you do not know what that means or how to do it then you should hire someone that does. NO SUPPORT will be given to servers that were hacked due to poorly thought out tests.
For example, say we wanted to test Apache's "XYZ" functionality.
A test for Apache would be this name space: Cpanel::Easy::Apache::MyTestXYZ
(similarly a test for PHP 4 would be Cpanel::Easy::PHP4::MyTestXYZ ) You'd
create the file /var/cpanel/easy/apache/custom_opt_mods/Cpanel/
Easy/Apache/MyTestXYZ.pm with these contents ( see "/scripts/easyapache
--perldoc" for more details):
Click Here To Display The Code In A New Window
TIP: If you are writing tests for a custom opt mod you could use the "implies" key ( see "/scripts/easyapache --perldoc" for more details) or better yet, add the tests in the final steps of the opt mod itself.
