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

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.

Related

How to reinstall apache server again if deleted?

Here is a challenge.
If apache server is deleted from mac, how will you reinstall it ?
You can try to install Apache web server with Homebrew, by executing the following command:
brew install httpd

MacOS cannot run nginx

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.

How to create passenger.conf during passenger installation

When installing passenger on a freshly installed Ubuntu 16.04 machine using this tutorial, the installation fails because there is no file /etc/nginx/passenger.conf
Should I create this file manually or is this a bug in the install script?
I found workaround for that issue. You need to login as root (sudo does not work for some reason). That purge all existing installations of nginx&passenger and their configs (make sure that you made a BACKUP of any nginx configs you made):
apt-get purge nginx* passenger
apt-get autoremove
rm -rf /etc/nginx
Then, when you repeat install steps from documentation - it will work. It's some sudo related issue.

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.

How to install and configure LAMP on ubuntu 12.04

Could somebody please tell me how to install and configure LAMP on ubuntu 12.04 ? Is there a package similar to WAMP Server that is all-in-one ? I have tried to install from command line ,PHP,MySQL work but apache gives me this after sudo service apache2 restart
* Restarting web server apache2
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
And I think probably I did something wrong when installing !
Thank you !
From this tutorial,
Run this commands in Ubuntu Terminal-
sudo apt-get install apache2
sudo apt-get install mysql-server
sudo apt-get install php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart
For Checking-
php -r 'echo "\n\nYour PHP installation is working fine.\n\n\n";'
If u get-
Your PHP installation is working fine.
Then you are done.
You can follow tutorial from below link to setup LAMP on your Ubuntu 12,
http://technarco.com/ubuntu-linux/how-install-lamp-ubuntu-12
Enjoy, :)
To resolve this error, you need to stop other process using this port.
In some of cases it is nginx. you can stop it
sudo /etc/init.d/nginx stop
you can install lamp server using Tasksel (Tasksel is a Debian/Ubuntu tool that installs multiple related packages as a co-ordinated “task” onto your system. This program is used during the installation process, but users can also use tasksel at any time)
check this post http://wiki.workassis.com/ubuntu-install-lamp-using-tasksel/

Resources