brew services httpd22 and postgresql shown as started, but can not be connected to

1

1

Earlier I was successfully using VM Fusion with CentOS Linux VM for web development needs.

However now I would like to switch to homebrew package manager.

So I have installed it and then run the following commands:

brew update
brew install postgres
brew install homebrew/apache/httpd22
brew install homebrew/php/php53
brew tap homebrew/services

When I run brew services list afterwards, they are show as "started":

bash screenshot

However netstat -an does not show any service running at port 8080 and trying to connect to http://127.0.0.1:8080 with browser does not work.

Same for PostgreSQL: I can run psql, but it can't find the /tmp/.s.PGSQL.5432 socket.

What could be the reason? I have rebooted my Macbook Air several times and the firewall is off in "Security & Privacy" settings:

settings

Also while in troubleshooting process I have tried

xcode-select --install
brew update
brew update
sudo chown -R $(whoami) $(brew --prefix)

and submitted the same question as issue 50065 at Github.

Alexander Farber

Posted 2016-03-13T08:11:55.153

Reputation: 233

Answers

2

In my case the postmaster.pid file of a crashed process still appears in place:

FATAL: could not open log file "/var/log/postgresql/pg_log/postgresql-2016-11-06_011112.log": No such file or directory

Was difficult to see this because the logs where turned off. PostgreSQL was running, indeed, but crashing:

... com.apple.xpc.launchd[1] (homebrew.mxcl.postgresql[98074]): Service exited with abnormal code: 1

SOLUTION: just exec this in the shell

rm /usr/local/var/postgres/postmaster.pid

Synthetic Meshwork

Posted 2016-03-13T08:11:55.153

Reputation: 29