I'm having an issue with Homebrew Apache after using TimeMachine to transfer my system to another computer.
When I terminal "sudo apachectl start" I get this notification in the system.log:
httpd[4212]: no path for address 0x10ed15000
When I terminal "brew services start httpd24" I get:
com.apple.xpc.launchd[1] (homebrew.mxcl.httpd24[4370]): Service exited
with abnormal code: 1
When I terminal "sudo apachectl configtest" I get:
Syntax OK
There are no apache logs because it doesn't start. Homebrew tells me Httpd24 is running, however, it doesn't show in the Activity Monitor.
I'm not quite sure where to go from here, suggestions would be greatly appreciated
Tried a million things, the only way I was able to get Apache back up and running was to:
Remove Homebrew
Install Homebrew
Related
I am trying to install/run jenkins on a mac machine using homebrew. This is what I did
brew install jenkins-lts
On running this command. I see that jenkins-lts is installed and I see this message
Note: When using launchctl the port will be 8080.
To have launchd start jenkins-lts now and restart at login:
brew services start jenkins-lts.
Or, if you don't want/need a background service you can just run:
jenkins-lts
If I run jenkins-lts, Jenkins starts at port 8080 successfully. I can reach it from the browser.
If I run brew services start jenkins-lts . I see the message
Successfully started jenkins-lts (label:homebrew.mxcl.jenkins-lts)
But I cannot reach the server on port 8080. I tried checking the status of the service
I tried checking the status of the service brew services list
Name Status User Plist
jenkins-lts unknown ec2-user /Users/ec2-user/Library/LaunchAgents/homebrew.mxcl.jenkins-lts.plist
I see that status is unknown.
After a while I see that this service is not listed anymore in the brew services list command. If I try to start it again. I see this message
/Users/ec2-user/Library/LaunchAgents/homebrew.mxcl.jenkins-lts.plist: service already loaded
Error: Failure while executing; /bin/launchctl bootstrap gui/501 /Users/ec2-user/Library/LaunchAgents/homebrew.mxcl.jenkins-lts.plist exited
with 37
Where can I find the jenkins logs and how to get it working.
likely you have not configured you host setings
so after starting the service
use
http://127.0.0.1:8080/
not
http://localhost:8080/
This is my experience , brew services list showed up as :
Name Status User Plist
jenkins-lts error cskjk16 /usr/local/opt/jenkins-lts/homebrew.mxcl.jenkins-lts.#CD6R ~
and the fix was:
1. brew services stop jenkins-lts
2. brew services start jenkins-lts
and now brew services list showed up as :
Name Status User Plist
jenkins-lts started cskjk16 /usr/local/opt/jenkins-lts/homebrew.mxcl.jenkins-lts.#CD6R ~
My solution was to uninstall Jenkins using brew (brew uninstall jenkins-lts), followed by brew doctor, followed by brew clanup, and re-install jenkins (brew install jenkins-lts).
After, I was able to start Jenkins using brew services start jenkins-lts.
Your password will be available at $ cat /User/..../.jenkins/secrets/initialAdminPassword.
Use it to create the admin account and continue the configuration.
The issue here is that, macos was running as a dedicated host on AWS.
I was connected to this macos from my windows machine using putty and trying to run the command.
brew services start jenkins-lts
This does not work. I had to login to macos via some Remote Desktop client like VNC and then run the same command from the the terminal window of mac.
In some cases, there will be a pop up which you needs user input. Hence this did not work when I was connected via putty from my windows machine.
We had the same issues on MacBooks and this is what fixed it.
run this:
chmod u+w /usr/local/var/log
and then run this:
sudu chown -R $(whoami) /usr/local/var/log
then:
brew install jenkins-lts
and it worked
Since i updated to MacOs Mojave, i cannot stop or restart Apache anymore. When i run the command below :
sudo apachectl --stop
I always get an error like this :
httpd (pid 101) already running
To stop or restart Apache i actually need go to Activity Monitor and force close all 'httpd' processes. Sometimes it works but sometimes the only way is to restart my machine. This issue happened in Mojave, in previous versions i did not have this problem.
Any solution / hint ?
Thanks
On Mojave, try:
sudo apachectl stop
I get a pid error too with --stop.
I’m trying to figure out why my apache doesn’t start at startup… (I would like for it to).
My OS: OSX Mojave
Impressions I’m under: that I’m running homebrew’s apache
Upon a fresh boot…
If I hit http://localhost in a browser I get
Unable to connect
Firefox can’t establish a connection to the server at localhost.
Fire up terminal…
$brew services list
returns
httpd started bigpimpin /Users/bigpimpin/Library/LaunchAgents/homebrew.mxcl.httpd.plist
php started bigpimpin /Users/bigpimpin/Library/LaunchAgents/homebrew.mxcl.php.plist
(That first line makes me think httpd is running and I should be able to hit localhost).
$which -a apachectl
returns
/usr/local/bin/apachectl
/usr/sbin/apachectl
then
$apachectl configtest
returns
Syntax OK
then
$sudo apachectl -V
returns (among other things)
-D SERVER_CONFIG_FILE="/usr/local/etc/httpd/httpd.conf"
(Isn’t this brew’s httpd.conf?)
There's a brew command (which I forget) that I already ran that is supposed to run httpd at startup.
Once I run
$sudo apachectl start
everything is jake. So it’s a low-priority question, but one I would like to solve and understand.
I had the same issue with Homebrew NGINX.
Running the brew services command with sudo solved the problem for me.
It appears that the Homebrew web-server packages require sudo to start | stop | restart.
Try running:
sudo brew services start apache2
I want to set up local web server using Apache and PHP on my Mac running Sierra. I followed this tutorial:
https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions
And I am stuck at changing the document root from httpd.config, for whatever reason this change does not take effect at all. If I type http://localhost it still says "It works", it still uses the original html file.
Another weird thing is that apparently I can't stop apache at all. I tried running
$ sudo apachectl stop
but I still can’t access http://localhost
if I run
$ brew services list
httpd24 is stopped. What gives? What am I doing wrong?
There is an instance of apache pre-installed with macOS. So you have now two versions of apache installed. If you check:
which apachectl
you will probably obtain:
/usr/sbin/apachectl
which is the official macOS version of apachectl. Stop it with:
sudo apachectl stop
Disable the auto-loading of the pre-installed apache with (as explained in the tutorial you mentioned):
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
To run the homebrew version do:
brew services run httpd24
to stop it:
brew services stop httpd24
to register it to launch at login:
brew services start httpd24
I am using mac osx 10.10.5
This question has been asked many times before and after following the steps, I notice bizarre behavior.
These are the steps which I have taken
brew tap gapple/services
brew install mongodb
This installs the product and now when I do brew services list I can see mongodb in a stopped state.
When I tried to start the process by brew services start mongodb I get an error
Error: Could not read the plist for mongodb!
OK. I googled a solution
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/mongodb/3.0.6/homebrew.mxcl.mongodb.plist ~/Library/LaunchAgents/
Now as soon as the file is copied, when I do brew services list ... the mongo process is automatically running.
Now when I do brew services stop mongodb
It says
Error: Service `mongodb` not running, wanna start it? Try `brew services start mongodb`
Now this is bizarre, because just in the last step it said its running. Now when I do
mongodb services list it says that the service is stopped. (so the stop command above did work. Even though it threw an error).
Now if I do
brew services start mongodb
It gives error Error: Could not read the plist for mongodb!
Now if I copy the file again
cp /usr/local/Cellar/mongodb/3.0.6/homebrew.mxcl.mongodb.plist ~/Library/LaunchAgents/
The service automatically begins to run.
I find this whole thing really bizarre. All I want is a clean way to start stop the mongo db service. And although there are many threads on this site (and elsewhere) ... they don't work or just have strange behavior.
brew services start/restart/stop mongodb-community#4.0
For me I had multiple version of mongodb and when I tried to switching between them, I got this error
Error: Could not read the plist for `mongodb26`!
This is what I did to start mongodb26 service.
brew unlink mongodb24
brew link mongodb26
brew services start mongodb26
You can list services by doing
brew services list
and then as one of the answers said brew services start [NAME] or brew services stop [NAME]
I think you should look at their Github repo on this. I gapple/services is deprecated. This might be a more up to date options.
You should use instead: brew services stop mongodb-community#4.2, don't forget to mention the version of MongoDB you installed and using for your purposes.
If you still facing issues, follow this link: Click here
inside of Hombrew Simple way is to get the process id of MongoDB and kill it.
get the pid:
pgrep mongo
then kill with this command
kill <pid>