0

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 }

srodrig
  • 11

1 Answers1

0

That grep line means that the only reference to the searched for string in the process list is the process doing the search. So it isnt running. Use launchd to restart it.

Jonah Benton
  • 1,252