DaCake32

Q: 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

Close

Q: Get error when using apache

  • All replies
  • Helpful answers

  • by Linc Davis,

    Linc Davis Linc Davis Jun 4, 2016 10:08 PM in response to DaCake32
    Level 10 (207,915 points)
    Applications
    Jun 4, 2016 10:08 PM in response to DaCake32

    Syntax error on line 66 of /private/etc/apache2/httpd.conf

    So what is that line?

  • by DaCake32,

    DaCake32 DaCake32 Jun 5, 2016 12:31 AM in response to Linc Davis
    Level 1 (8 points)
    Desktops
    Jun 5, 2016 12:31 AM in response to Linc Davis

    This is the line:

    LoadModule authn_file_module libexec/apache2/mod_authn_file.so
    
  • by Linc Davis,Apple recommended

    Linc Davis Linc Davis Jun 5, 2016 8:00 AM in response to DaCake32
    Level 10 (207,915 points)
    Applications
    Jun 5, 2016 8:00 AM in response to DaCake32

    It looks like you changed line 31 in that file. It should be this:

     

    ServerRoot "/usr"

     

    There is no graphical interface to Apache in recent versions of OS X. If you want to use it, I suggest that you either install OS X Server from the App Store, or else use a third-party application. I don't have a specific recommendation for the latter.

  • by etresoft,

    etresoft etresoft Jun 5, 2016 8:49 AM in response to DaCake32
    Level 7 (29,031 points)
    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 OS X. 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.

  • by DaCake32,

    DaCake32 DaCake32 Jun 5, 2016 7:39 PM in response to etresoft
    Level 1 (8 points)
    Desktops
    Jun 5, 2016 7:39 PM in response to etresoft

    Nope that didn't work, thanks for the help though.

  • by etresoft,

    etresoft etresoft Jun 5, 2016 8:31 PM in response to DaCake32
    Level 7 (29,031 points)
    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?

  • by DaCake32,

    DaCake32 DaCake32 Jun 6, 2016 12:54 AM in response to etresoft
    Level 1 (8 points)
    Desktops
    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.

  • by etresoft,

    etresoft etresoft Jun 6, 2016 6:21 AM in response to DaCake32
    Level 7 (29,031 points)
    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.

  • by Linc Davis,

    Linc Davis Linc Davis Jun 6, 2016 6:30 AM in response to DaCake32
    Level 10 (207,915 points)
    Applications
    Jun 6, 2016 6:30 AM in response to DaCake32

    Have you fixed the ServerRoot directive? Obviously this problem has nothing to do with adware.

  • by etresoft,

    etresoft etresoft Jun 6, 2016 6:39 AM in response to DaCake32
    Level 7 (29,031 points)
    Jun 6, 2016 6:39 AM in response to DaCake32

    Hello again DaCake32,

    I misread Linc's post above. Do check your Apache configuration file for the ServerRoot directive. Even if you haven't changed that file, some other software may have. If there isn't a previous version of that file in your home directory, check for one in your Time Machine backup.

  • by DaCake32,

    DaCake32 DaCake32 Jun 7, 2016 1:03 AM in response to Linc Davis
    Level 1 (8 points)
    Desktops
    Jun 7, 2016 1:03 AM in response to Linc Davis

    Sorry didn't read your post before - this fixed it, thanks