You must have root access to the server to do the following procedures.
Installing Advanced Policy Firewall
To install Advanced Policy Firewall on your system, follow these steps:- Log in to your system using SSH.
-
Type the following command to download the application files to your server:
-
To extract the application files, type the following command:
-
Type the following command:
๐ Note The extracted directory name may vary based on the version number you download.
-
Type the following command:
๐ Note When you run install.sh, you may receive the following error message:
This is expected behavior. You can safely disregard this message.
Configuring Advanced Policy Firewall
After Advanced Policy Firewall is installed, you must configure it for your system.Basic configuration
The following procedure describes the minimum steps to get APF working correctly:- At the command prompt, open the /etc/apf/conf.apf file in your preferred text editor.
-
Locate each of the following settings in the /etc/apf/conf.apf file:
-
Modify the settings listed in step 2 as follows:
๐ Note You can add to the IG_TCP_CPORTS setting any other port numbers that you want to allow. To view a list of assigned port numbers, please visit http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers.
- Save the changes to the /etc/apf/conf.apf file, and then exit the text editor.
-
Type the following command to start APF in development mode:
๐ Note In development mode, APF drops all firewall rules five minutes after you start it. This is a safety feature: if the firewall is misconfigured, you could be blocked from accessing your own system. Development mode saves you from this unpleasant scenario. (If this happens, though, you can still log in using the console feature in the SolusVM control panel.)
- Test the connections that you want to allow (for example, SSH and HTTP) to make sure they work correctly. For example, make sure your web site loads in a browser, and make sure you can connect to the system using SSH.
-
After you verify that the connections are working correctly, modify the /etc/apf/conf.apf file to disable development mode. To do this, edit the following line as shown:
- Save the changes to the /etc/apf/conf.apf file, and then restart the system. The firewall is now active.