MacOS cannot run nginx - macos

When I run nginx on my MacOS.
➜ nginx nginx
dyld: Library not loaded: /usr/local/opt/openssl#1.1/lib/libssl.1.1.dylib
Referenced from: /usr/local/bin/nginx
Reason: image not found
[1] 10170 abort nginx

Please start by installing HomeBrew http://brew.sh/. It is a package manager for MacOS that allows to easily install various Unix applications.
MacOS will prompt you to first install Xcode Command Line Tools (unless you have them already).
After installation, the following command, if necessary, will tell you how to complete the installation:
brew doctor
//Then updates all packages with:
brew update
brew upgrade
//Then Install Nginx
brew install nginx
// Then automatically launch Nginx at startup with:
sudo cp /usr/local/opt/nginx/*.plist /Library/LaunchDaemons
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
Good luck!

I had that problem for a bit, but when I ran
brew uninstall nginx
and then
brew install nginx
It reinstalled properly and I was able to run it without getting that error.

Related

Can't deploy heroku on Mac OS M1

I'm new on Heroku and trying to deploy my project here. After I typed this command in the terminal: curl https://cli-assets.heroku.com/install.sh | sh
and I also typed the administrative password correctly , I got this error message: unsupported arch: arm64
The script does not support arm64 (see line 40 pf the script).
The easier option is to install via brew
brew tap heroku/brew && brew install heroku
or download the tarball for macOS (if you still prefer doing it manually)
Download the tarball macOS
tar xvf heroku-darwin-x64.tar
sudo mv heroku /usr/local/lib
cd /usr/local/bin
ln -s /usr/local/lib/heroku/bin/heroku .
heroku --help
Apple Silicon Issues
If you’re getting the following error on a machine with an Apple M1 chip, you haven’t installed or declined to install Rosetta 2.
Bad CPU type in executable
Installing Rosetta 2 resolves this issue.
If you don’t want to install Rosetta 2 on your machine, you can install the Heroku npm package globally and use your own Node binary locally. Only v16 of Node has M1 ARM support and npm isn’t the recommended install method.
ref: heroku install
brew tap heroku/brew && brew install heroku
This command doesn't work for me
==> Installing heroku from heroku/brew
Error: Your Xcode (14.0.1) is too outdated.
Please update to Xcode 14.1 (or delete it).
Xcode can be updated from the App Store.
but there is no update in theApp Store.
Try
arch -arm64 brew install heroic
Try
arch -arm64 brew install heroku

How can I install brew httpd on MacOS 11 Big Sur?

I've upgraded macOS version to 11 Big Sur and unable to use brew's apache instead of build in version.
What I did:
sudo apachectl stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
brew intall httpd
When I'm trying to start the installed httpd it says that apache is started
==> Successfully started httpd (label: homebrew.mxcl.httpd)
but when I run brew services command I see that httpd is not started (and http://localhost:8080 is not working).
sergeylyskov#MacBook-Pro-Sergey ~ % brew services
Name Status User Plist
httpd error sergeylyskov /Users/sergeylyskov/Library/LaunchAgents/homebrew.mxcl.httpd.plist
php#7.3 stopped
php#7.4 stopped
postgresql#12 stopped
P.S. I want to use brew's version because seems like build in apache is not properly work with php modules (it don't show xdebug and imagick extensions in phpinfo())
Any advice?
I tried uninstalling and then reinstalling httpd, but that didn't work initially. When you uninstall, brew does NOT remove the /usr/local/etc/httpd config directory (which is sensible because you might have a lot of things configured in there and not backed up). However, these configuration files might well be outdated (or customized) in a way that makes them incompatible with the latest version of httpd, causing it to fail. So I did the following:
brew services stop httpd
brew uninstall httpd
mv /usr/local/etc/httpd /usr/local/etc/httpd-old
brew install httpd
brew services start httpd
This got it running again with fresh config files; I can now copy over any specific configuration details from httpd-old into the new httpd dir.
Also note: by default, httpd serves from /usr/local/var/www. This dir is not affected by the uninstall-reinstall process, so only your config files need re-doing.

How to install CouchDB on Mac OS X? (Docs not helping)

I tried installing CouchDB 1.6 via Homebrew per the instructions on the official CouchDB docs at docs.couchdb.org, but I am having no success. First, I tried the native application and that worked but apparently that version does not support CORS. It has been a frustrating experience, so any help will be greatly appreciated.
Here is the error that I am getting when trying to ping CouchDB:
curl: (7) Failed to connect to 127.0.0.1 port 5984: Connection refused
I followed the installation guide here: http://docs.couchdb.org/en/1.6.1/install/mac.html
These were the terminal commands I used:
open /Applications/Installers/Xcode\ Tools/XcodeTools.mpkg
--> File not found (this step is listed as optional, so I moved on)
brew update
brew doctor
brew install autoconf
brew install autoconf-archive
brew install automake
brew install libtool
brew install erlang
brew install icu4c
brew install spidermonkey
brew install curl
brew link icu4c
--> Requires --force option which can cause installations to fail
(I did not do the --force option)
brew link erlang
brew install couchdb
--> To test CouchDB run: curl http://127.0.0.1:5984/
curl http://127.0.0.1:5984/
--> curl: (7) Failed to connect to 127.0.0.1 port 5984: Connection refused
Mac Info:
MacBook Pro (Retina, 13-inch, Late 2013)
OS X Yosemite
Version 10.10.3
My guess is that it is installed, but just not running. Can you try running couchdb -d?
That should start it up in the background, if you need it to run on every startup, you can continue following the instructions for "Running as a Daemon"

Redis can't start due to tcp-backlog

I am using the osx and trying to install redis through brew
brew install redis
==> Downloading http://download.redis.io/releases/redis-2.8.17.tar.gz
Already downloaded: /Library/Caches/Homebrew/redis-2.8.17.tar.gz
==> make -C /private/tmp/redis-WEL8AT/redis-2.8.17/src CC=clang
==> Caveats
To have launchd start redis at login:
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
Then to load redis now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
Or, if you don't want/need launchctl, you can just run:
redis-server /usr/local/etc/redis.conf
==> Summary
At last I have installed redis, but when I run it in the way of
redis-server /usr/local/etc/redis.conf
there is error message,
*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 54
>>> 'tcp-backlog 511'
Bad directive or wrong number of arguments
I learned from Redis tcp-backlog to uncomment the redis.conf in that line.
but still more errors on other lines come again.
How do I solve it ?
Check if you have installed redis twice. I my case I had another redis installation from anaconda with version 2.6.9:
$ which redis-server
/Users/<username>/anaconda/bin/redis-server
$ redis-server -v
Redis server v=2.6.9 sha=00000000:0 malloc=libc bits=64
Homebrew instead will install the redis-server to a different place:
$ /usr/local/bin/redis-server -v
Redis server v=3.0.1 sha=00000000:0 malloc=libc bits=64 build=bf58331b4c8133f5
So to start the homebrew version with the homebrew config file do
$ /usr/local/bin/redis-server /usr/local/etc/redis.conf
I had similar problem due to a config file left over from previous redis versions. Uninstalling all redis versions and reinstalling the latest worked (also, don't forget to update brew before installing redis):
brew uninstall redis --force
brew update
brew install redis
You should now be able to start it.

Nginx broken after upgrade to osx yosemite

Nginx was working fine on Mavericks, and now after I upgraded to Yosemite its displaying
nginx command not found , I tried to install nginx with brew install nginx and it displays an error
Error: You must brew link pcre before nginx can be installed
And brew link pcre displays
Linking /usr/local/Cellar/pcre/8.35... Error: No such file or directory - /usr/local/Cellar/pcre/8.34/share/doc/pcre
Its trying to link 8.34. I reinstalled still its same, How do i solve it?
I had the same problem, that is, after upgrading from Mavericks to Yosemite I got the following error: nginx: [emerg] mkdir() "/usr/local/var/run/nginx/client_body_temp" failed (2: No such file or directory)
All I needed to do to solve this issue was to create the folder:
mkdir -p /usr/local/var/run/nginx/client_body_temp
I ran into the same issue. My solution was simply upgrading the package:
brew update ; brew upgrade nginx
Had the same issue, re-installing nginx via homebrew fix it for me:
brew reinstall nginx

Resources