If you've set up the Moodle site in a <VirtualHost> section then the lines go in there.
What I do is place a .conf file per site in /etc/httpd/conf.d with all the settings for that site.
I've attached an example .conf file for the site. I would then place this in /etc/httpd/conf.d/moodle.example.com.conf and run systemctl reload httpd to apply the new settings.
One thing I encountered recently: it looks like the checks in the Security Check require the Moodle web server to access the Moodle site it is hosting. So the web server has to be able to connect to itself by the URL in $CFG->wwwroot. You may need to add an entry to /etc/hosts so the server can resolve the name of the Moodle site.