INSTALLATIONS Plesk

Install APF on Plesk or CentOS

install apf
install apf

How to install APF on Plesk or CentOS

This post explains how to install APF on Plesk or CentOS. Advanced Policy Firewall (APF) is iptables based firewall system. It is commonly used in Plesk servers.

 
cd /usr/local/src/
wget http://www.rfxn.com/downloads/apf-current.tar.gz
tar xvzf apf-current.tar.gz
cd apf-*
./install.sh

You may receive the following error while installing APF. You can safely disregard this message.

 
Installing APF 9.7-2: eth0: error fetching interface information: Device not found
Completed.

Configuration

You need to edit the APF configuration file to make the basic configuration.

 
vim /etc/apf/conf.apf

First of all, you need to correct the interface section on the apf configuration file.

 
IFACE_IN="venet0"
IFACE_OUT="venet0"

If you are using eth0, you need to add eth0 here.

Then, you need to ensure the following line and configuration value is changed as following.

 
SET_MONOKERN="1"

This is because iptables is installed into the kernel. APF will not function properly if you haven’t set this.

Please add the custom SSH port (if you have configured) on the following setting.

 
HELPER_SSH_PORT="2200"

You can open desired TCP port using the following field.

 
IG_TCP_CPORTS="80,2200,8090"

Then you can save the configuration and start APF.

 
apf -s

You will be notified that the development mode is enabled. It is a safety feature added on APF. It will flush the firewall rule every 5 minutes. i.e., if you have misconfigured the firewall and blocked from accessing your server, this feature will help you to gain access to your server after 5 minutes.

Now you have to verify the connections are working properly. Once you have checked all the connections, you need to disable the development mode.

 
DEVEL_MODE="0"

Save the changes and restart APF.

 
apf -r

That’s it!

If you like this post and wish to receive more articles from us, please like our FB page: Grepitout

Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.

For more details on our services, please drop us an E-mail at info@grepitout.com

Add Comment

Click here to post a comment

Topics