I get a apache error when I try access to anything folder or file, it returns Http Not found
or Forbidden
I am trying restart and start apache
In my Mac with Mojave (10.14.1) suddenly Apache couldn't give to serve ipv4 anymore, then gave me ERROR 403. I tried to kill all apache (sudo killall httpd)... checking de PID's on (sudo lsof | grep AMP | grep apache)... even didn't work... just ipv6 was available... still ERROR 403.
What works for me: Disable OSX's built-in Apache server.
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
After that:
sudo apachectl -k restart
Be happy :)
Try
sudo netstat -ltnp | grep ':80'
Output: tcp6 0 0 :::80 :::* LISTEN 1500/apache2
sudo kill 1500
sudo service apache2 restart
this error ocurs because apache server listen by deafult in port 80 so another service or program is using that port and apache canot start.
The solution is identify what program or service is using that port an then close, disable or unistall it.
to identify you can run netstat
sudo netstat -ltnp | grep ':80'
or
sudo lsof -i:80
in my case i have installed nginx and apache at the same time and both uses the port 80.
Temporary Solution: Stop or kill the service, program, etc.
Permanent Solution:
in my case I needed both so I decided to temporarily fix it by disabling the service with:
systemctl stop MyServiceName.service
If it is a service otherwise use kill command.
This one helped me:
Please edit httpd.conf file.
/usr/local/etc/httpd/httpd.conf
And replace
Listen 80
with
Listen 127.0.0.1:80
Restart apache
sudo apachectl -k restart
One of a couple of things could be happening:
which apachectl
. As an example, I also have two versions of apache /usr/sbin/apachectl
and /usr/local/bin/apachectl
apachectl start
as root, although it appears that you are.sudo lsof -i:80
to see what's binding that port currently