Apache is not working, pls help!!

Discussion in 'Web Design and Development' started by c98928, Jun 27, 2009.

  1. c98928 macrumors member

    Joined:
    Nov 22, 2008
    #1
    All of sudden my Apache just stopped working.

    I have checked that Web Sharing is on, but all I got is:
    Code:
    Firefox can't establish a connection to the server at 10.0.1.2.
    Then I tried to restore httpd.conf file to its original version, which obviously had little help.

    Later I tried to run apachectl -t to see anything wrong with the status, then I got this message:
    Code:
    Syntax error on line 164 of /private/etc/apache2/httpd.conf:
    DocumentRoot must be a directory
    The actual of this line 164 reads:
    Code:
    DocumentRoot "/Library/WebServer/Documents"
    but apparently this directory does exist.

    I also have another clue from /var/log/apache2/error_log:
    Code:
    [Fri Jun 26 16:21:55 2009] [error] [client 10.0.1.4] client denied by server configuration: /Library/WebServer/Documents
    [Fri Jun 26 16:22:03 2009] [error] [client 10.0.1.4] client denied by server configuration: /Library/WebServer/Documents
    [Fri Jun 26 16:22:13 2009] [error] [client 10.0.1.4] client denied by server configuration: /Library/WebServer/Documents, referer: http://10.0.1.4/
    [Fri Jun 26 16:22:24 2009] [error] [client 10.0.1.4] client denied by server configuration: /Library/WebServer/Documents
    [Fri Jun 26 16:22:54 2009] [error] [client 10.0.1.4] File does not exist: /Users/yaochen/Sites/test.html
    [Fri Jun 26 16:22:57 2009] [error] [client 10.0.1.4] File does not exist: /Users/yaochen/Sites/test.html
    [Sat Jun 27 03:40:07 2009] [warn] child process 413 still did not exit, sending a SIGTERM
    [Sat Jun 27 03:40:07 2009] [warn] child process 446 still did not exit, sending a SIGTERM
    [Sat Jun 27 03:40:07 2009] [warn] child process 452 still did not exit, sending a SIGTERM
    [Sat Jun 27 03:40:07 2009] [warn] child process 455 still did not exit, sending a SIGTERM
    [Sat Jun 27 03:40:07 2009] [warn] child process 456 still did not exit, sending a SIGTERM
    [Sat Jun 27 03:40:08 2009] [notice] caught SIGTERM, shutting down
    This has been driving me crazy, please, please help me!!!
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Sounds like the permissions got messed up for /Library/WebServer/Documents.
     
  3. Guiyon macrumors 6502a

    Joined:
    Mar 19, 2008
    Location:
    North Shore, MA
    #3
    OP, mind positing the output from the below command?

    Code:
    stat -x "[COLOR=Black]/Library/WebServer/Documents"[/COLOR]
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    I should note I don't use the built-in server. I use MAMP, but I have tinkered with the built-in one.
    Code:
    :~> stat -x /Library/WebServer/Documents/
      File: "/Library/WebServer/Documents/"
      Size: 1224         FileType: Directory
      Mode: (0775/drwxrwxr-x)         Uid: (    0/    root)  Gid: (   80/   admin)
    Device: 14,2   Inode: 33259    Links: 36
    Access: Sat Jun 27 07:07:06 2009
    Modify: Thu May 14 20:35:44 2009
    Change: Thu May 14 20:35:44 2009
    
     
  5. c98928 thread starter macrumors member

    Joined:
    Nov 22, 2008
    #5
    Thanks for the reply, the directory pretty much does not exist:
    Code:
    $ stat -x "/Library/WebServer/Documents"
    stat: /Library/WebServer/Documents: stat: No such file or directory
    I tried earlier to make a symbolic link Documents pointing to ~/Sites but it didn't help.

    What I feel weird is that I have almost done nothing since last time it worked, except for that updating Airport Express Firmware and Vmware Fusion, both which I don't think they have explicit link to this problem.
     
  6. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #6
    Make sure to create that folder then (if you haven't already). That should help it process the httpd.conf file, then you can see if your Sites folder works properly.
     
  7. c98928 thread starter macrumors member

    Joined:
    Nov 22, 2008
    #7
    Thanks everyone for you replies,

    I have solve the problem by simply changing the value of DocumentRoot to /Users/myusername/Sites.

    Still not sure why it stopped working in the first place. Maybe this could help somebody else who have a similar problem.
     
  8. vonRichthofen macrumors newbie

    Joined:
    Nov 24, 2010
    #8
    a bit late to the party

    Hi chaps. Also rather new to apache. Web sharing is working according to system properties, however neither localhost or 192.168.0.4 work in any browser.
    On trying
    apachectl configtest

    i get

    Code:
    /usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument
    httpd: Syntax error on line 488 of /private/etc/apache2/httpd.conf: Syntax 
    error on line 8 of /private/etc/apache2/other/+entropy-php.conf: Cannot load
     /usr/local/php5/libphp5.so into server: dlopen(/usr/local/php5/libphp5.so, 
    10): Symbol not found: _libiconv\n  Referenced from: 
    /usr/local/php5/lib/libintl.8.dylib\n  Expected in: 
    /usr/lib/libiconv.2.dylib\n
    Which maybe ought to help but doesnt.

    Thanks in advance
     

Share This Page