Welcome! Log In Create A New Profile

Advanced

Re: Executing iptables command from module

July 12, 2012 01:24AM
Well if you are running nginx as a non root user. Then you need to add the following lines to /etc/sudoers
Defaults:nginx !requiretty
nginx ALL=(root) NOPASSWD: /sbin/iptables

The above is necessary because iptables can only be modified as root.

I can't dump the code here for my module because it's irrelevant, but you can basically use the system() command at this point to add an entry from IP tables.
Subject Author Posted

Executing iptables command from module

arosolino July 08, 2012 10:56PM

Re: Executing iptables command from module

arosolino July 10, 2012 12:59AM

Re: Executing iptables command from module

arosolino July 10, 2012 02:48AM

Re: Executing iptables command from module

elico July 11, 2012 09:06PM

Re: Executing iptables command from module

arosolino July 12, 2012 01:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 86
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready