• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

pfSense apache

Scheduled Pinned Locked Moved Development
5 Posts 3 Posters 929 Views 3 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    tobijuan
    last edited by Oct 16, 2019, 5:38 AM

    Is there a way for me to execute easyrule in apache? i tried using php shell_exec to run the easyrule code but it only returns "Host Added Successfully" but it does not reflect on the firewall rules in pfSense. Thank you

    1 Reply Last reply Reply Quote 0
    • S Offline
      stephenw10 Netgate Administrator
      last edited by Oct 16, 2019, 4:38 PM

      Probably going to need more detail here.

      Where exactly are you executing this code? In what circumstances? What is your objective here?

      Steve

      T 1 Reply Last reply Oct 17, 2019, 5:25 AM Reply Quote 0
      • T Offline
        tobijuan
        last edited by Oct 17, 2019, 5:22 AM

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • T Offline
          tobijuan @stephenw10
          last edited by Oct 17, 2019, 5:25 AM

          @stephenw10

          Thank you for replying

          im running the php script in an apache hosted web server after they submitted a form. My objective here is to run the easyrule with the user inputs. Im trying to make a separate UI for non-admins to be able to edit the firewall rules without accessing the pfsense main webgui. Thank you

          My index.html has the sample form then when the user submits the form it runs try.php which contains

          <?php
          shell.exec('<easyrule command>');
          ?>

          1 Reply Last reply Reply Quote 0
          • J Offline
            jimp Rebel Alliance Developer Netgate
            last edited by Oct 21, 2019, 7:46 PM

            There is no apache on pfSense. Perhaps you meant nginx?

            You shouldn't call the shell exec programs indirectly like that. It isn't going to work. You're telling PHP to spawn a subshell and then run more PHP code from there.

            If you are looking to make your own page, just copy the contents of the easyrule script and adjust it to suit your needs. Though odds are, whatever you end up making will be less secure than granting users rights to edit firewall rules in the GUI directly.

            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            1 Reply Last reply Reply Quote 0
            1 out of 5
            • First post
              1/5
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
              This community forum collects and processes your personal information.
              consent.not_received