Get error when using apache

So I am running Mac El Capitan. I used to be able to use Apache web server on this mac in the same os but how ever when I try recently to use appache I get this error

httpd: Syntax error on line 66 of /private/etc/apache2/httpd.conf: Cannot load libexec/apache2/mod_authn_file.so into server: dlopen(/Users/keeffefamily/Sites/libexec/apache2/mod_authn_file.so, 10): image not found

And when I try to start it looks as if it has worked but when I go to http://localhost/ nothing loads up

Specs:

2.9 GHz Intel Core i5

8 GB 1600 MHz DDR3

OS X El Capitan 10.11.1

NVIDIA GeForce GT 750M 1024 MB

iMac, OS X El Capitan (10.11.1)

Posted on Jun 4, 2016 6:56 PM

Reply
11 replies

Jun 5, 2016 8:49 AM in response to DaCake32

Hello DaCake32,

That line in your /etc/apache2/httpd.conf is correct. Don't change it (or at least that line).


What is happening is that Apache should be loading libraries from /usr but is now searching in your home directory. Do you know exactly when this stopped working? How are you launching Apache? Are you following instructions from my User Tip here? Setting up a local web server on a Mac. If not, then you should be. Use that procedure and see if it works normally. If it still doesn't work, then there is some system-level problem locating dynamic libraries. There could also be some other Apache configuration problem. I'm hoping you just aren't launching Apache properly.

Jun 5, 2016 8:31 PM in response to DaCake32

Hello again DaCake32,

What about the other questions? Do you know exactly when this stopped working? How are you launching Apache?


And here are some new ones. Are you using a custom build of Apache? What do you get when you enter the following command in the Terminal?

httpd -V


It sounds like HTTPD_ROOT is pointing at your mod_userdir directory instead of /usr. What other low-level system configuration settings have you applied?

Jun 6, 2016 12:54 AM in response to etresoft

No I don't know exactly when it happened and I'm launching it the way that you said.

I am using the apache that came with mac I get this code when I execute that command:

Server version: Apache/2.4.16 (Unix)
Server built:   Aug 22 2015 16:51:57
Server's Module Magic Number: 20120211:47
Server loaded:  APR 1.4.8, APR-UTIL 1.5.2
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture:   64-bit
Server MPM:     prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FLOCK_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/usr"
 -D SUEXEC_BIN="/usr/bin/suexec"
 -D DEFAULT_PIDLOG="/private/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/private/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"

Not that I know of have I done anything low-level system configuration settings.

Jun 6, 2016 6:21 AM in response to DaCake32

Hello again DaCake32,

There was some adware a while back that hacked up dynamic library environment variables. What do you get when you run "env" at the Terminal? (Make sure to remove any personal information before posting).


I wrote a little diagnostic program to help show what adware is installed. Download EtreCheck from http://www.etrecheck.com, run it, and paste the results here. EtreCheck is perfectly safe to run, does not ask for your password to install, and is signed with my Apple Developer ID.


If adware is installed, EtreCheck will help you remove it, although you may have to supply a password. If you aren’t comfortable with that, just post the EtreCheck report here and other helpers can tell you exactly what files need to be deleted and how to do so.


Disclaimer: Although EtreCheck is free, there are other links on my site that could give me some form of compensation, financial or otherwise.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Get error when using apache

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.