Setting up a local web server on macOS 13 “Ventura”

When I follow etresoft's detailed instructions to set up a local webserver on macOS 13.4 "Ventura" here:


Setting up a local web server on macOS 13… - Apple Community


then type http://localhost/ in the URL bar, I get the expected


"It works!"


But when I request http://localhost/~<myshortusername>, Safari cannot find the index.html file placed in my Sites folder:


"Not Found

The requested URL was not found on this server."


Does the command:

chmod +a "_www allow execute" ~

no longer permit apache to access the Sites folder in my home directory?


Any help much appreciated!



iMac (2017 – 2020)

Posted on Sep 21, 2023 9:57 PM

Reply
Question marked as Best reply

Posted on Sep 23, 2023 8:04 AM

onyerleft wrote:

There is an index.html file in /usr/local/var/www/. Yes, I installed with Homebrew, because your instructions were unavailable at the time, and there was no alternative. I've since uninstalled Homebrew - there is nothing on my system with the word "homebrew" or "brew" in the name.

Have you tested your instructions with Ventura 13.4? Because they don't work on my system.

I've been updating that User Tip for more than ten years: Setting up a local web server on a Mac - Apple Community


I used those instructions myself to setup the web server on my new MacBook Air running Ventura 13.4.


The problem here is Homebrew. Based on my interactions with other Homebrew users here in the forums, it is not possible to uninstall Homebrew. In theory, it should be possible. But because Homebrew is pushed on people who don't know how to do advanced unix operations, those people are then unable to fix their computer when Homebrew breaks functionality like this.


I'm afraid that your best option is to erase the hard drive and reinstall the operating system. Then you can get the web server running in a few minutes and learn the command line on your own schedule.


I'm not entirely sure, because I don't know what Homebrew does, but it may be possible to restore your personal files. You just have to make sure that you restore only your user accounts and user files. Do not restore any software, apps, system settings, or "other files". That would just reinstall Homebrew.

24 replies

Sep 25, 2023 7:27 PM in response to onyerleft

onyerleft wrote:

You can blame it on homebrew if you like

I assume it is homebrew since you referenced a directory tree in /usr/local that does not exist by default. You could have also screwed up the configuration. Considering how simple it is, Homebrew is the most likely explanation.


It still sounds like the configuration is screwed up. Assuming Homebrew is at all functional, you should be able to configure the Homebrew files to use your home directory too. At least, you should be able to in theory. Usually when people have Homebrew problems, their command line is pretty much down for the count.

I will have a development platform that allows me to design not only the necessary HTML, CSS, and Javascript, but build the databases and content management systems that tie it all together.

Then you'll have to go through all of this again with PHP and MySQL. Any instructions you find on the internet, including my own, will not apply to your Homebrewed system. Apparently, Homebrew itself has no support as people always seem to come here with Homebrew problems.

Where does the "1998" condescension come from?

Memories...

My clients wax ecstatic about their reliability, speed, and functionality - and until they don't, I'll probably continue to rely on those dead-end technologies, Apache/PHP/MySQL, to design, build, and test them.

If you've got people willing to pay the bills, then go for it. For me, web sites are not a profit centre, they are an advertising and support cost. I still run my REST services on Apache/Perl/MySQL, but I do not recommend that to others. The cost for me to switch is more than the cost to continue it for a few more years. But my new projects that have a viable future in them will not be doing that.

Re: AWS, I wouldn't go near it. In 2012 I developed a site for a luxury womenswear franchise, and in the first week after launch it disappeared into thin air. Worse, tech support was non-existent.

In my experience, it became increasingly difficult to find any web host that supports those old-school LAMP systems. Even hosting providers that had been rock-solid for years just fell apart. They were serving my web sites at almost dial-up speeds and didn't know why. They also seemed frighteningly ignorant about basic networking.


I really didn't want to use AWS and tried virtually every other option but finally just gave up. I'm willing to suffer for my principles, but only to a point. I run my LAMP services on AWS Lightsail, which is essentially the same as a traditional web hosting service. But in some cases, you can access much more powerful AWS service from your Lightsail hosts. As for the web site itself, SSL certificates alone are worth the switch to AWS Cloud Front.


If AWS goes down in 2023, no one is going to be concerned about your luxury womenswear site. They will have far more bigger problems to deal with. For smaller-scale outages, you can configure your AWS services to run in multiple zones and regions for more reliability. But those old-school LAMP sites generally aren't compatible with that unless you do a lot more work.

Sep 25, 2023 7:32 PM in response to onyerleft

onyerleft wrote:

Not familiar with the Web App Penetration Testing class, but if it was "web apps" they were probably testing WordPress apps, which are built as add-ons to WP's PHP framework. Though the framework is secure, the third-party apps that interface with it are not.

They range from acceptable to godawful, both in terms of reliability and security. Though they've improved in recent years, unless interfacing with another system is required I write all apps I need for WP myself.

WordPress exploits were about five minutes of the class.

Sep 26, 2023 11:05 AM in response to etresoft

"For me, web sites are not a profit centre, they are an advertising and support cost."

They aren't for me anymore, either. As I explained, most development I'm doing now is production management systems for industry, with in-house IT and local servers - all running some flavor of Linux. Multiple zones and regions are unnecessary; reliability and security are necessary (they even have their own SSL certificates!).

Setting up a local web server on macOS 13 “Ventura”

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