Macos Monterey, Apache 2.53
When I run either
brew services restart httpd
or
brew services restart apache2
The config files will not be reloaded
Only
sudo apachectl restart
works. What wrong with homebrew?
Related
I'm building a new web server on a new M1 Mac Mini running the latest version of Big Sur, fresh install. Only thing I have done to the machine is install Chrome.
I'm installing Apache with the following:
Install xcode command line tools: xcode-select --install
Install Homebrew: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Install missing libraries: brew install openssl
Check to see if apache is running, remove any scripts:
sudo apachectl stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
Install httpd: brew install httpd
Configure autostart: brew services start httpd
At this point, httpd is running fine, and I can see the pages at http://localhost:8080
And I can confirm httpd starts up fine after reboot.
Issue is, I can't shut it down. if i issue the command brew services stop httpd, I get the following:
Mac-mini / % brew services stop httpd
Stopping httpd... (might take a while)
==> Successfully stopped httpd (label: homebrew.mxcl.httpd)
Mac-mini / %
Activity monitor still shows multiple instances of httpd running, though.
The only way to shut it down is either quit it in actvity monitor or issue the command
sudo apachectl -k stop
Any suggestions of why niether of the following commands work or how to track down the issue?
brew services stop httpd
brew services restart httpd
I had apache2 installed on my raspberry pi 4 and was getting some strange behavior so I removed it via apt remove apache2, removed the /etc/apache2 directory and reinstalled by sudo apt-get apache2 -y.
After reinstallation the server would not start, I determine that there was no apache2.conf file in /etc/apache2.
I've tried installing and reinstalling several time to no avail. What am I doing wrong?
try
sudo apt-get purge apache2
If you just want a light-weight http server you might want to try Nginx as a replacement.
sudo apt-get --reinstall install apache2
After I updated to php7.0 now it's viewing the files, I firstly thought it was in apache itself, but i have reinstalled it, what could be the problem..?
ubuntu 15.04
Install PHP 7 and the Apache PHP module as follows:
apt-get -y install php7.0 libapache2-mod-php7.0
Then restart Apache:
service apache2 restart
Another possible reason could be short open tag. Configure php.ini files related line as: short_open_tag = On and restart php service.
I am trying to install Cobbler on a brand new Ubuntu 15.10 virtual box but it is not working. When I run the apt-get install cobbler cobbler-web it seems to break apache completely to the point I can't get it working again.
I see this in the apache error log:
[wsgi:crit] [pid 8112:tid 140273573488512] mod_wsgi (pid=8112): The mod_python module can not be used on conjunction with mod_wsgi 4.0+. Remove the mod_python module from the Apache configuration.
and this in the auth.log:
polkitd(authority=local): Unregistered Authentication Agent for unix-process:8081:54865 (system bus name :1.24, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
I have tried removing the mod_python and wsgi modules but apache still doesn't start up. And I think Cobbler uses them anyways, so I kind of need them.
I have also tried disabling polkitd. I don't find any clues when searching for that weird error message.
I was able to install Cobbler on Ubuntu 14.04 pretty easily and apache works fine.
Here is the basic chain of install commands I used:
apt-get update
apt-get install apache2
apt-get install isc-dhcp-server
apt-get install bind9 bind9utils bind9-doc
apt-get install cobbler cobbler-web debmirror mkisofs
Disable the module by typing sudo a2dismod python
You should then see this:
Module python disabled. To activate the new configuration, you need to
run: service apache2 restart
So type sudo service apache2 restart.
If that doesn't fix it, check the error log for more information by typing
cat /var/log/apache2/error.log.
I did sudo yum groupinstall -y "Web Server" "PHP Support", on my ec2 instance. Now I want to install apache tomcat. Do I need to uninstall httd that was installed as a part of yum groupinstall -y "Web Server" ? If yes, why ?
Although I never done it myself: no you don't have to uninstall httpd. I've seen them running next to eachother in the past. You do need to change the configuration of course since both can't listen to default port 80. :)