can MacOS 11 serve Websites?

can MacOS 11 serve Websites?

Mac mini 2018 or later

Posted on May 18, 2021 9:23 AM

Reply
Question marked as Top-ranking reply

Posted on May 18, 2021 9:55 AM

Yes.


As above mentions, Apache and MAMP and other web server options are available for or are integrated with macOS, yes.


If the websites are to be exposed to the Internet and to all the shenanigans that arise, the downside of this includes having to maintain and secure the web server and its contents, and the costs of potential mistakes and exploits to that server to other data on the potentially-breached server, to other potentially-insecure systems and servers on the same network. Running a server is slightly more involved than running a client. You'll probably also be learning about DNS setup, and about certificates for HTTPS, and about IP networking and port forwarding and potentially about public static IP addresses and DMZ / network partitioning, too.


Hosting services are cheap and widely available, as an alternative to running and securing your own web server.

7 replies
Question marked as Top-ranking reply

May 18, 2021 9:55 AM in response to intandemdesign

Yes.


As above mentions, Apache and MAMP and other web server options are available for or are integrated with macOS, yes.


If the websites are to be exposed to the Internet and to all the shenanigans that arise, the downside of this includes having to maintain and secure the web server and its contents, and the costs of potential mistakes and exploits to that server to other data on the potentially-breached server, to other potentially-insecure systems and servers on the same network. Running a server is slightly more involved than running a client. You'll probably also be learning about DNS setup, and about certificates for HTTPS, and about IP networking and port forwarding and potentially about public static IP addresses and DMZ / network partitioning, too.


Hosting services are cheap and widely available, as an alternative to running and securing your own web server.

May 18, 2021 12:30 PM in response to intandemdesign

Older Server can and did use TCP 443, yes. As I stopped using Server app when it ceased providing the network services of interest here and effectively became an MDM package at macOS 10.14, I don't have any experience with the current Server versions. Server does want to securely distribute some settings to clients, and I'd expect via an embedded web server. If you don't need an MDM or LDAP support or such, I'd remove Server app.


Your grep command is finding a process ID, and not a TCP port.


Your lsof is finding a web server running on TCP 80, and likely blocked (by Server? by the local config?) from TCP 443.


The following doesn't look that far off what I've used to activate Apache on older macOS:

https://neto.medium.com/apache2-configuration-for-macos-big-sur-serving-single-or-multiple-sites-2ae80a7ad406


If you're hacking around locally for development and experimentation, MAMP can work well.


I'd be very cautious about running any web server on an exposed or external or port-forwarded network, having cleaned up after various shenanigans.



May 18, 2021 10:53 AM in response to intandemdesign

intandemdesign wrote:

Big Sur has an agent listening to port 443. Therefore, Apache cannot listen to port 443. If Apache cannot listen to port 443, it cannot receive requests to serve a page. HTTPS and SSL considerations if Apache does not have access to port 443.


Ah, interesting. Nothing here is listening on TCP 443 on the local Big Sur system, per lsof.


sudo lsof -nP -iTCP -sTCP:LISTEN


If the local system has something else on that port as happened with the old Server app environment, it was fairly routine to shut down or to redirect port-competing apps with Server.


As an ugly alternative, various firewalls can redirect incoming port access, too.

May 18, 2021 11:54 AM in response to intandemdesign

I ran your suggestion, and it says nothing is listening to port 443:


Sudo lsof -nP -iTCP -sTCP:LISTEN

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

launchd 1 root 24u IPv6 0x Blah Blah Blah 0t0 TCP *:445 (LISTEN)

launchd 1 root 25u IPv4 0x Blah Blah Blah 0t0 TCP *:445 (LISTEN)

launchd 1 root 27u IPv6 0x Blah Blah Blah 0t0 TCP *:445 (LISTEN)

launchd 1 root 28u IPv4 0x Blah Blah Blah 0t0 TCP *:445 (LISTEN)

kdc 119 root 5u IPv6 0x Blah Blah Blah 0t0 TCP *:88 (LISTEN)

kdc 119 root 7u IPv4 0x Blah Blah Blah 0t0 TCP *:88 (LISTEN)

httpd 1683 root 4u IPv6 0x Blah Blah Blah 0t0 TCP *:80 (LISTEN)

httpd 1687 _www 4u IPv6 0x Blah Blah Blah 0t0 TCP *:80 (LISTEN)

httpd 1688 _www 4u IPv6 0x Blah Blah Blah 0t0 TCP *:80 (LISTEN)

httpd 1689 _www 4u IPv6 0x Blah Blah Blah 0t0 TCP *:80 (LISTEN)

httpd 1690 _www 4u IPv6 0x Blah Blah Blah 0t0 TCP *:80 (LISTEN)

httpd 1691 _www 4u IPv6 0x Blah Blah Blah 0t0 TCP *:80 (LISTEN)

httpd 1703 _www 4u IPv6 0x Blah Blah Blah 0t0 TCP *:80 (LISTEN)

httpd 1708 _www 4u IPv6 0x Blah Blah Blah 0t0 TCP *:80 (LISTEN)

httpd 1742 _www 4u IPv6 0x Blah Blah Blah 0t0 TCP *:80 (LISTEN)

httpd 1743 _www 4u IPv6 0x Blah Blah Blah 0t0 TCP *:80 (LISTEN)

httpd 1744 _www 4u IPv6 0x Blah Blah Blah 0t0 TCP *:80 (LISTEN)


Yet Apachectl Configtest yields an error that says (basically) two things cannot be listening to the same port. How do I determine what the other thing listening to 443 is?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

can MacOS 11 serve Websites?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.