In my personal experience, CentOS is the absolute worst choice of Server OS for compiling altcoins. I have yet to compile and run a single daemon on this Operating System. Cent OS is dead. Instead, use Ubuntu or any other Debian based OS and enjoy the benefits of painless compiling.
If you're in a situation where your main application resides on a centos server, and you don't want to change up your whole operation my suggestion would be:
buy a small vps and put ubuntu on it(install fail2ban and clamav, in addition to dependencies.
then download and configure yaproxy to safely tunnel into the vps(you can make rpc calls from the subnet without outside exposure). now make a database on the main server to store your wallet credentials.
now you need to setup ufw at this point.
you should allow with UFW the following:
connection to the default port of the wallet from any ip or a list of trusted nodes
connection for yaproxy confined to the ip of your main server.
connection to the rpcport from localhost to the subnet address of the main server
anyway, probably went way into left field on this one, but it should be enough to get your headed in the right direction when you inevitably realize why you can't compile correctly on cent os. it's because no body updates the yum package repositories, because cent os is just waning in popularity for various reasons.