Skip to main content
Apache

Apache2 Learnings | Debugging Issues with Apache2

By May 20, 2019December 22nd, 2021No Comments

Knowing the exact issue is important.


1
2
3
4
5
apachectl configtest
journalctl -xe
systemctl status apache2.service
sudo nano /var/log/apache2/error.log
netstat -ltp | grep :80 # To know if a program is occupying port 80

FYI: Apache modules reside in the following. Sometimes we have a mismatch of modules especially after switching PHP version. If the loaded version is different and the available version is different, that causes an error too.


1
/usr/lib/apache2/modules

Mac OS Specific Local Development Environment Issues

#1 Mac OSX apache not starting


1
2
3
# source: https://apple.stackexchange.com/questions/79299/apache-on-osx-10-8-not-starting

sudo apachectl -T

#2 Apache not working suddenly

A lot of things were tried not sure what worked.

This might have done the trick.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Not sure what did the trick. Try in the following order:

brew reinstall apr-util

brew doctor;

brew cleanup;

sphp 7.4;

brew reinstall httpd

sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install

# check node
node -v