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

    pfSense apache

    Scheduled Pinned Locked Moved Development
    5 Posts 3 Posters 633 Views
    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
      tobijuan
      last edited by

      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
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        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 Reply Quote 0
        • T
          tobijuan
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • T
            tobijuan @stephenw10
            last edited by

            @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
            • jimpJ
              jimp Rebel Alliance Developer Netgate
              last edited by

              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
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.