brew services start httpd does not work

Hi,


I have been having trouble starting the apache server. the error message I get is :


Error: Permission denied @ rb_sysopen - /Users/bashaar/Library/LaunchAgents/homebrew.mxcl.httpd.plist


Running brew doctor tells me theres a newer version of commandlinetools however I am unable to downloand it as my Imac is from 2017. Is this the problem and can anyone point in the right directions?


Im on Imac ventura with all apps and pakgaes updated to there latest versions.


Many thanks

iMac 21.5″, macOS 10.15

Posted on Mar 30, 2024 9:12 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 30, 2024 10:15 AM

bashaar115 wrote:

Thanks for the reply! I would like to stay on this path. would this command line be in the homebrew folders? httpd.conf?


The brew install is seemingly broken.


The protection on the plist is apparently incorrect.


Here is what a working launch agent looks like:


$ ls -l /Users/mrhoffman/Library/LaunchAgents/
…
-rw-r--r--  1 mrhoffman  staff  {size} {date} {path}
…


You’ll be using chmod and chown to make your file protection mode and file ownership settings look like that.


If the ls command shows differences, then the commands are roughly these, using your file path to plist and your shortname:


chmod u=rw,go=r /Users/bashaar/Library/LaunchAgents/homebrew.mxcl.httpd.plist
chown bashaar:staff /Users/bashaar/Library/LaunchAgents/homebrew.mxcl.httpd.plist


What else might also be broken here?


After you get this and maybe other issues related to whatever (didn’t) happen here all working, you’ll probably want to integrate php or Python or various Apache plugins or such. Which is yet more involved.


I would again encourage using MAMP here.

4 replies
Question marked as Top-ranking reply

Mar 30, 2024 10:15 AM in response to bashaar115

bashaar115 wrote:

Thanks for the reply! I would like to stay on this path. would this command line be in the homebrew folders? httpd.conf?


The brew install is seemingly broken.


The protection on the plist is apparently incorrect.


Here is what a working launch agent looks like:


$ ls -l /Users/mrhoffman/Library/LaunchAgents/
…
-rw-r--r--  1 mrhoffman  staff  {size} {date} {path}
…


You’ll be using chmod and chown to make your file protection mode and file ownership settings look like that.


If the ls command shows differences, then the commands are roughly these, using your file path to plist and your shortname:


chmod u=rw,go=r /Users/bashaar/Library/LaunchAgents/homebrew.mxcl.httpd.plist
chown bashaar:staff /Users/bashaar/Library/LaunchAgents/homebrew.mxcl.httpd.plist


What else might also be broken here?


After you get this and maybe other issues related to whatever (didn’t) happen here all working, you’ll probably want to integrate php or Python or various Apache plugins or such. Which is yet more involved.


I would again encourage using MAMP here.

Mar 30, 2024 9:19 AM in response to bashaar115

Easiest: Download the MAMP app (it’s free) and use that. That’s a prepackaged web server environment with various related add-on apps that is configured for and useful for prototyping and development.


If you want to stay on the path you’re on, you’ll need to open up at least read permissions to that directory to the web server (usually _www) user. There should be a command line chacl or chmod command documented somewhere in whatever you’re reading to set up those file and directory protections appropriately.


The command line tools are not related to that error.

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.

brew services start httpd does not work

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