EasyApache3 Saving Custom Options
Every time Apache is rebuilt, its current configuration is stored as Previously Saved Config, in both the command line and WHM EasyApache interfaces. However, you may still want to store your custom configuration for later use.
To store custom options, you should save the configuration with a file name, display name, and description. You can accomplish this under step 6 in EasyApache, by filling in the required information and clicking Save and build or Save only (Do NOT build). Using the Save only (Do NOT build) button can be useful if you would like to create a profile for a different server.
The custom profile is saved to the
/var/cpanel/easy/apache/profile/custom/
directory on your server, and automatically given the filename extension .yaml.
Saving and Restoring iptables Rules
The iptables package comes with two more tools that are very useful, specially if you are dealing with larger rule-sets.
These two tools are called iptables-save and iptables-restore
Firewall rules are only valid for the time the computer is on; so, if the system is rebooted, the rules are automatically flushed and reset.
To save the rules so that they are loaded later, use the following command:
/sbin/service iptables save
The rules are stored in the file /etc/sysconfig/iptables and are applied whenever the service is started or restarted, including when the machine is rebooted.
#iptables-save -c > /etc/iptables-save
The above command will in other words save the whole rule-set to a file called /etc/iptables-save with byte and packet counters still intact.
Example
Save current iptables firewall rules:
# iptables-save > /root/iptables-save
To restore iptables rules:
# iptables-restore < /root/iptables-save