http://localhost stopped working following my Sonoma upgrade
Following my Sonoma update, my http://localhost stopped working.
I did sudo apachectl start, and got the following message: httpd (pid2357 already running)
MacBook Pro 16″, macOS 14.0
Following my Sonoma update, my http://localhost stopped working.
I did sudo apachectl start, and got the following message: httpd (pid2357 already running)
MacBook Pro 16″, macOS 14.0
C_ASB wrote:
System Settings -> General -> AirDrop & Handoff -> AirPlay Receiver
If AirPlay Receiver is enabled localhost might not work.
Try disabling it. It worked for me
That's the default setting. I've never touched it.
It seems like AirPlay Receiver was introduced in Monterey and used ports 5000 and 7000. So if you had configured your own Apache to run on those ports, then you would need to disable AirPlay Receiver. I recommend using standard web server ports like 80, 8000, or 8080 instead.
C_ASB wrote:
System Settings -> General -> AirDrop & Handoff -> AirPlay Receiver
If AirPlay Receiver is enabled localhost might not work.
Try disabling it. It worked for me
That's the default setting. I've never touched it.
It seems like AirPlay Receiver was introduced in Monterey and used ports 5000 and 7000. So if you had configured your own Apache to run on those ports, then you would need to disable AirPlay Receiver. I recommend using standard web server ports like 80, 8000, or 8080 instead.
That was the #1 returned link if you google the issue using Chrome, so I've already seen it, and it's not really relevant to me, because I had a web server working.
It turns out the problem is that Require host localhost was missing from my configuration file. This is now required in the version of Apache2 that ships with Sonoma.
If I had modified my configuration, based on the instructions in that article, it would have messed everything up, or at a minimum, configured things that would overly complicate stuff.
Your old configuration files may have been moved into /Users/Shared/Relocated Items.
Are you attempting to set up a local web server?
Setting up a local web server on macOS 14 “Sonoma” - Apple Community
System Settings -> General -> AirDrop & Handoff -> AirPlay Receiver
If AirPlay Receiver is enabled localhost might not work.
Try disabling it. It worked for me
JosephMo wrote:
That was the #1 returned link if you google the issue using Chrome, so I've already seen it, and it's not really relevant to me, because I had a web server working.
had
It turns out the problem is that Require host localhost was missing from my configuration file. This is now required in the version of Apache2 that ships with Sonoma.
Require host localhost is not required. Apache's security model is complicated. I'm pretty clear in that article that it's only designed for local testing.
However, if you do want to use some other setting, it will work fine. For example, if you wanted to test from a mobile device or simulator, then you would have to open that up. You could use Require all granted to allow global access. A better idea would be to review Apache's documentation and configure your server for the least possible access.
If I had modified my configuration, based on the instructions in that article, it would have messed everything up, or at a minimum, configured things that would overly complicate stuff.
Colour me skeptical. 😄
I suggest you read Mr. Etresoft's User Tip. He specifically describes the reason your existing web server isn't working and what to do about it.
I am "attempting" to set up a web server. I want the web server that's been running fine on my system, to start working again. It seems as with every major OS upgrade, Apple changes the way things work for the the local web server, with no warning. I would just like to know how to make it work again.
You did not write that you were attempting to set up a local web server, which would have helped. http://localhost is used for a number of other purposes.
The requirement for "Require host localhost" is described in that User Tip.
"localhost" is a reserved domain name that always refers to the current device's loopback network interface, and is used in many contexts (DB server, testing network interfaces, etc). But http://localhost is used to access the local web server. If you can think of anything else, I would love to know.
JosephMo wrote:
"localhost" is a reserved domain name that always refers to the current device's loopback network interface, and is used in many contexts (DB server, testing network interfaces, etc). But http://localhost is used to access the local web server. If you can think of anything else, I would love to know.
Yes. For example, http://localhost:631 is used for the CUPS interface.
You're welcome.
JosephMo wrote:
I did not configure my web server to run on these ports. I posted the answer.
I didn't say you did. I was replying to C_ASB's post.
This is a problem on these forums. People aren't going to read and look for the correct answer. They are just going to randomly pick something, probably the last post made by someone else who didn't read to look for the correct answer. Then, what that "solution" invariably fails, they get frustrated.
Found the /Users/Shared/Relocated Items folder, but did not have the web server stuff
CUPS is a WEB-BASED network printing service used by Mac computers.
You're welcome.
I did not configure my web server to run on these ports. I posted the answer.
http://localhost stopped working following my Sonoma upgrade