Unable to serve pages on Mac OS X using Apache default web server

I turned on the web server on my Mac OS X (10.5.6) by going to System Preferences โ†’ Internet and Network โ†’ Sharing and clicking the โ€œWeb Serverโ€ button. It gives me the IP address of my system as a web server, but even after clicking on it it does not show the page, but gives an error: could not connect

Any help on this would be great.

I tried with MAMP, but there I can not display my own PHP pages.

Starting and / or stopping the web server from the command line gives me the following:

dyld: Symbol not found: _apr_socket_sendfile
  Referenced from: /usr/sbin/httpd
  Expected in: /usr/lib/libapr-1.0.dylib

Trace/BPT trap

In my box there are files:

~ $ ls -lrt /usr/lib/libapr*
-rwxr-xr-x  1 root  wheel  578640 Sep 23  2007 /usr/lib/libapr-1.0.2.7.dylib
-rwxr-xr-x  1 root  wheel  393696 Sep 23  2007 /usr/lib/libaprutil-1.0.2.7.dylib
-rwxrwxr-x  1 root  admin  569544 Oct 27 10:44 /usr/lib/libaprutil-1.0.2.12.dylib
-rwxrwxr-x  1 root  admin  835824 Oct 27 10:44 /usr/lib/libapr-1.0.2.12.dylib
lrwxr-xr-x  1 root  admin      25 Jan  4 22:28 /usr/lib/libaprutil-1.dylib -> libaprutil-1.0.2.12.dylib
lrwxr-xr-x  1 root  admin      25 Jan  4 22:28 /usr/lib/libaprutil-1.0.dylib -> libaprutil-1.0.2.12.dylib
lrwxr-xr-x  1 root  admin      21 Jan  4 22:28 /usr/lib/libapr-1.dylib -> libapr-1.0.2.12.dylib
lrwxr-xr-x  1 root  admin      21 Jan  4 22:28 /usr/lib/libapr-1.0.dylib -> libapr-1.0.2.12.dylib

MD5 Values:

~ $ openssl md5 /usr/sbin/httpd /usr/lib/libapr-1.0.dylib 
MD5(/usr/sbin/httpd)= d5194790e9cfaca881d0e8fc3db24889
MD5(/usr/lib/libapr-1.0.dylib)= f7f7fd3cd315ca4e7c6ad2a2f222998e

libapr-1.0.dylib is associated with the new version 1.0.2.12.

+3
source share
8 answers

, , :) , httpd , (libapr , Apache Runtime Library)

OS X iMac./usr/lib/libapr-1.0.dylib (1.0.2.12), / _apr_socket_sendfile

libapr - 1.0.2.7, . ( libaprutil):

// BEFORE (both 1.0.2.7 and 1.0.2.12 versions exist, symlinks point to .12)
bash-3.2# ls -l libapr*
-rwxr-xr-x  2 userna  wheel  835824 19 Sep  2008 libapr-1.0.2.12.dylib
-rwxr-xr-x  1 root    wheel  578640 24 Sep  2007 libapr-1.0.2.7.dylib
lrwxrwxrwx  1 root    wheel      21 14 Oct  2008 libapr-1.0.dylib -> libapr-1.0.2.12.dylib
lrwxrwxrwx  1 root    wheel      21 14 Oct  2008 libapr-1.dylib -> libapr-1.0.2.12.dylib
-rwxr-xr-x  2 userna  wheel  569544 19 Sep  2008 libaprutil-1.0.2.12.dylib
-rwxr-xr-x  1 root    wheel  393696 24 Sep  2007 libaprutil-1.0.2.7.dylib
lrwxrwxrwx  1 root    wheel      25 14 Oct  2008 libaprutil-1.0.dylib -> libaprutil-1.0.2.12.dylib
lrwxrwxrwx  1 root    wheel      25 14 Oct  2008 libaprutil-1.dylib -> libaprutil-1.0.2.12.dylib

// CHANGE symbolic links to previous version
bash-3.2# ln -sf libapr-1.0.2.7.dylib libapr-1.0.dylib
bash-3.2# ln -sf libapr-1.0.2.7.dylib libapr-1.dylib
bash-3.2# ln -sf libaprutil-1.0.2.7.dylib libaprutil-1.0.dylib
bash-3.2# ln -sf libaprutil-1.0.2.7.dylib libaprutil-1.dylib

// TESTing whether httpd is loaded and run
bash-3.2# /usr/sbin/httpd -t
Syntax OK

, , Apache Web Server, .

, ;)

+4

, apache .

- , , :

httpd -t

" OK", -. - , :

sudo httpd

, -. http://localhost. (Command + R).

:

sudo httpd -k stop

, , /var/log/apache2/error_log.

+2

: 1. apache

sudo cp /usr/sbin/httpd /usr/sbin/httpd.old

2. apache :

sudo install_name_tool -change /usr/lib/libapr-1.0.dylib /usr/lib/libapr-1.0.2.7.dylib /usr/sbin/httpd

, , , libapr

+2

, http://localhost/. IP- ( , ); , , , .

, OS Apache. " -" .

+1

subversion 1.5 ? , , , . /usr/lib/libapr -1.0.dylib /Developer/SDKs/MacOSX 10.5.sdk/usr/lib/libapr-1.0.2.7.dylib, svn 1.5, /opt/subversion/lib/libapr -1.0.2.12.dylib.

1.0.2.12 _apr_socket_sendfile.

, , .

+1

. libapr-1.0.dylib?

Macbook/usr/lib/libapr-1.0.dylib libapr-1.0.2.7.dylib.

Running nm against this file shows that apr_socket_sendfile is defined in this library.

Also: Do โ€‹โ€‹standard HTML pages work?

0
source

It sounds like this:

  • The httpd that comes first in your path is not / usr / sbin / httpd and it was created weirdly, or

  • You have installed something that is overwritten by either httpd or libapr.

What is MD5 of your httpd and libapr? I get:

$ openssl md5 /usr/sbin/httpd /usr/lib/libapr-1.0.dylib 
MD5(/usr/sbin/httpd)= d5194790e9cfaca881d0e8fc3db24889
MD5(/usr/lib/libapr-1.0.dylib)= f1f5ece10140a5c2cea2fece7a9e4918
0
source

Source: https://habr.com/ru/post/1703619/


All Articles