I am on Mac Yosemite. Apache 2.4.16. My localhost and local sites stopped working. They've been working fine for months now until I tried to update/fix MySQL. I get the following error:
This site can’t be reached
localhost refused to connect.
ERR_CONNECTION_REFUSED
Results for ps aux | grep "httpd":
3182 0.0 0.0 2432772 652 s002 S+ 8:46AM 0:00.00 grep httpd
The numbers in the line above change each time I run ps aux | grep "httpd". Not sure if this is expected.
When I run killall -9 httpd:
No matching processes belonging to you were found
My host file:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
127.0.0.1 test.local
httpd-vhost.conf:
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
DocumentRoot "/Users/<myusername>/projects/test"
ServerName test.local
<Directory "/Users/<myusername>/projects/test">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
I changed my actual username to for this post only.
apachectl configtest returns:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using <myusername>-iMac.local. Set the 'ServerName' directive globally to suppress this message
Syntax OK
Results of sudo launchctl print-disabled system:
disabled services = {
"com.apple.AppleFileServer" => true
"com.apple.hdiejectd" => false
"com.apple.screensharing" => true
"com.mysql.mysqld" => false
"com.apple.ManagedClientAgent.enrollagent" => true
"com.barebones.textwrangler" => false
"com.apple.usbmuxd" => false
"com.apple.odproxyd" => false
"com.apple.rpmuxd" => false
"com.apple.ftpd" => true
"com.apple.mrt" => true
"com.apple.smbd" => true
"org.apache.httpd" => false
"com.apple.stackshot" => false
"com.apple.ManagedClient.enrollagent" => true
"org.ntp.ntpd" => false
"org.net-snmp.snmpd" => true
"com.apple.mrt.uiagent" => false
"org.macosforge.xquartz.privileged_startx" => false
"com.apple.pacemaker" => true
"com.apple.flashupdater" => false
}
sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plistand get:/System/Library/LaunchDaemons/org.apache.httpd.plist: Operation already in progress– srodrig Sep 16 '16 at 13:09xattr: No such file: /opt/servers/Tomcat/TomcatHomesudo launchctl enable org.apache.tomcat returns:
Usage: launchctl enable <service-target>sudo launchctl bootstrap system /Library/LaunchDaemons/org.apache.tomcat.plist returns:
– srodrig Sep 16 '16 at 13:44/Library/LaunchDaemons/org.apache.tomcat.plist: No such file or directoryapachectl configtest returns:
– srodrig Sep 16 '16 at 14:02AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using <myusername>-iMac.local. Set the 'ServerName' directive globally to suppress this message Syntax OKsudo launchctl print-disabled systemto original question. Too long for comments – srodrig Sep 16 '16 at 15:07[core:warn] [pid 80] AH00045: child process 27856 still did not exit, sending a SIGTERM– srodrig Sep 16 '16 at 15:20
– srodrig Sep 16 '16 at 16:03/System/Library/LaunchDaemons/org.apache.httpd.plist: Operation already in progress[mpm_prefork:notice] [pid 1207] AH00163: Apache/2.4.16 (Unix) PHP/5.5.36 configured -- resuming normal operations [Fri Sep 16 12:53:20.752981 2016] [core:notice] [pid 1207] AH00094: Command line: '/usr/sbin/httpd'– srodrig Sep 16 '16 at 17:21