To my knowledge there is no interface in WHM for the my.cnf file so editing that file directly is the only way to do it. But if cPanel updates mysql you may very well need to edit the file again so keep an eye on that.
For the httpd.conf though there is an interface although it is a bit limited. In WHM if you go to Service Configuration | Apache Global Configuration there are a few options that you can change. There is also Service Configuration | Include Editor and this is where I think you will want to put your edits into the Pre Main Include. You can of course edit the httpd.conf directly but, again, cPanel updates will overwrite it whereas they will not overwrite the include files so hopefully that will work for you.