Bring iT

Saturday, April 16, 2011

Mengizinkan user apache mengeksekusi iptables

Mengizinkan user apache mengeksekusi iptables

# chmod 0740 /etc/sudoers

# vi /etc/sudoers

  apache ALL=(root) NOPASSWD: /sbin/iptables

# chmod 0440 /etc/sudoers

# service httpd restart

# mkdir /var/www/html/firewall

# vi /var/www/html/firewall/index.php

  
  $cek=shell_exec('sudo iptables -L');
  echo $cek;
  ?>

Setelah itu buka browser dan ketikkan http://localhost/firewall

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]



<< Home