Apache and the macOS Firewall (was Re: MacPorts question)

mf2k at macports.org mf2k at macports.org
Wed Oct 5 16:24:21 CEST 2016


> On Sep 29, 2016, at 2:05 PM, Ryan Schmidt <ryandesign at macports.org> wrote:
> 
> 
>> On Sep 29, 2016, at 10:30 AM, Zachary Waibel <zjwaibel at gmail.com> wrote:
>> 
>> Here’s my question: 
>> 
>> I've installed the latest MacPorts and my issue is that if I start apache2 using the command "sudo port load apache2” I can then find my website from outside my network.  However, after restarting my Mac and I cannot find my website anymore.  It turns out if I turn off macOS’s Firewall I can then find the website from the outside again.  The other way I can solve it is by doing "sudo port unload apache2” and then "sudo port load apache2”, which seems to open port 80.  However, after a restart the port is not opened, but apache2 is running.  So is MacPorts not compatible with El Capitan’s Firewall?
>> 
>> Thank you for any help!
> 
> Writing to the macports-users mailing list is probably the right thing to do. I'm Cc'ing the list now. To reply, please make sure you're subscribed to the list first.
> 
> I've also been frustrated with the new macOS firewall for some years. I don't understand it. Maybe someone else on the list does and can give us both some advice.

OK, the solution was actually very simple. I added the httpd application to the Firewall. It is located here:

/opt/local/apache2/bin/httpd

This survived a reboot for me. 

Steps to add it (sorry if this is obvious):
 1. Starting from the Terminal type:
    - cd /opt/local/apache2/bin/
    - open .
 2. Open System Preferences->Security & Privacy->Firewall tab.
 3. Click the lock to unlock it.
 4. Click Firewall Options…
 5. Click +
 6. In Finder, drag “httpd” (now visible in Finder from Step 1) to the dialog. 



Please let me know if this works for you too and I will add these steps to the wiki. 


Cheers!
Frank

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-users/attachments/20161005/79adf94f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: apache firewall.png
Type: image/png
Size: 87295 bytes
Desc: not available
URL: <https://lists.macosforge.org/pipermail/macports-users/attachments/20161005/79adf94f/attachment.png>


More information about the macports-users mailing list