You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Guillaume Meurice <gu...@gmail.com> on 2012/03/28 10:49:20 UTC

[users@httpd] installing apache 2.4 on macosx Lion

Dear all,


As indicated in my title, I would like to proper install apache 2.4 on
macosx Lion.

In order to do that, I follow the documentation and use the following
command lines :

./configure --prefix=/usr --enable-layout=Darwin --enable-modules=all
--enable-mods-shared
make
sudo make install

Compilation seems to went fine :
/usr/sbin/httpd -v :
Server version: Apache/2.4.1 (Unix)
Server built: Mar 28 2012 10:36:11


but now, I can't launch apache from the syst.pref. > shared > web sharing
panels.

More over, since the files under /etc/apache2/ seems not to have been
modified by the newly installation, I was wondering if they still remains
useful for configuring apache ?

Last question : is there any option to tell apache which PHP to use ?
Because I've made a new installation of PHP :

php -v :
PHP 5.4.0 (cli) (built: Mar 27 2012 16:03:34)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies


but it seems that apache 2.2.1 only found the previous release of PHP (here
a copy of /var/log/apache2/error_log just after activating apache):

[Tue Mar 27 17:46:45 2012] [notice] caught SIGTERM, shutting down
[Tue Mar 27 17:50:47 2012] [warn] Init: Session Cache is not configured
[hint: SSLSessionCache]
httpd: Could not reliably determine the server's fully qualified domain
name, using kototama.local for ServerName
mod_bonjour: Skipping user 'meurice' - cannot read index file
'/Users/meurice/Sites/index.html'.
[Tue Mar 27 17:50:47 2012] [notice] Digest: generating secret for digest
authentication ...
[Tue Mar 27 17:50:47 2012] [notice] Digest: done
[Tue Mar 27 17:50:47 2012] [notice] Apache/2.2.21 (Unix) mod_ssl/2.2.21
OpenSSL/0.9.8r DAV/2 PHP/5.3.8 configured -- resuming normal operations


Many thanks by advance for any clues you could bring to me.

--
Guillaume

Re: [users@httpd] installing apache 2.4 on macosx Lion

Posted by Guillaume Meurice <gu...@gmail.com>.
Dear Mark,

many thanks !!
Effectively, I was trying to keep one installation of Apache but it's very
confusing.
Following your recommandation, I'll get my custom builf of apache / PHP.

I've also check the system.log and apache error_log and finnaly managed to
solve one of the problem I had (activating apache from system prefs. pane.

Again, Thanks for your pieces of advices.

Best.
--
Guillaume


2012/3/28 Mark Montague <ma...@catseye.org>

> On March 28, 2012 4:49 , Guillaume Meurice <gu...@gmail.com>
> wrote:
>
>> but now, I can't launch apache from the syst.pref. > shared > web sharing
>> panels.
>>
>
> In my opinion, it is much easier to leave everything Apple provides alone
> and install your custom build of Apache HTTP Server in a location where all
> of the files (binaries, configuration files, log files) are in completely
> different places than where Apple puts their copies.  This prevents any
> conflicts between your stuff and Apple's stuff, and eliminates the need to
> do a lot of extra work to get your stuff to work correctly with Apple's
> management tools.  It can be difficult to get your stuff to work with
> Apple's management tools because this is not something that Apple has
> intended, and they do not provide support or even good documentation for
> this.  I recommend managing your custom build of Apache HTTP Server from
> the command line, and not from Apple's GUIs.
>
> Use Console.app to check Apple's special log files to find out why you
> were unable to start httpd.  Also check the httpd error log files, wherever
> you have configured httpd to put them.  Alternatively, start httpd from the
> command line using "apachectl" or by starting it manually.  Running "httpd
> -t" will do a check of your configuration files and will report any
> problems.
>
>
>
>  More over, since the files under /etc/apache2/ seems not to have been
>> modified by the newly installation, I was wondering if they still remains
>> useful for configuring apache ?
>>
>
> Installing httpd will not normally destroy old configuration files; this
> is desired behavior.
>
> However, there are a number of differences between directives for httpd
> 2.2 and httpd 2.4, and you will very likely need to change some directives
> in your httpd 2.2 configuration files in order to get your configuration to
> work with httpd 2.4.  For details, see https://httpd.apache.org/docs/**
> 2.4/upgrading.html <https://httpd.apache.org/docs/2.4/upgrading.html>
>
> To find out where your custom httpd is looking for its configuration
> files, run "httpd -V" and examine the value of SERVER_CONFIG_FILE.  If the
> value does not begin with a / then prepend the value of HTTPD_ROOT to it.
>
>
>  Last question : is there any option to tell apache which PHP to use ?
>>
>
> Yes, you will need to build a different version of mod_php for each
> version of PHP you want to use.  You then control which version of PHP gets
> used by specifying the path to the corresponding version of mod_php via the
> LoadModule directive.
>
> For example, to load the default version of PHP shipped by Apple:
>
> LoadModule php5_module libexec/apache2/libphp5.so
>
> (this loads libphp5.so from /usr/libexec/apache2/libphp5.**so).
>
> If you compile PHP 5.4.0, including mod_php, and you've installed this
> version of mod_php in /opt/mystuff/apache-httpd/**libexec/libphp5.so,
> then you can load it using the following directive:
>
> LoadModule php5_module /opt/mystuff/apache-httpd/**libexec/libphp5.so
>
>
> I hope this helps.
>
> --
>  Mark Montague
>  mark@catseye.org
>
>

Re: [users@httpd] installing apache 2.4 on macosx Lion

Posted by Mark Montague <ma...@catseye.org>.
On March 28, 2012 4:49 , Guillaume Meurice <gu...@gmail.com> 
wrote:
> but now, I can't launch apache from the syst.pref. > shared > web 
> sharing panels.

In my opinion, it is much easier to leave everything Apple provides 
alone and install your custom build of Apache HTTP Server in a location 
where all of the files (binaries, configuration files, log files) are in 
completely different places than where Apple puts their copies.  This 
prevents any conflicts between your stuff and Apple's stuff, and 
eliminates the need to do a lot of extra work to get your stuff to work 
correctly with Apple's management tools.  It can be difficult to get 
your stuff to work with Apple's management tools because this is not 
something that Apple has intended, and they do not provide support or 
even good documentation for this.  I recommend managing your custom 
build of Apache HTTP Server from the command line, and not from Apple's 
GUIs.

Use Console.app to check Apple's special log files to find out why you 
were unable to start httpd.  Also check the httpd error log files, 
wherever you have configured httpd to put them.  Alternatively, start 
httpd from the command line using "apachectl" or by starting it 
manually.  Running "httpd -t" will do a check of your configuration 
files and will report any problems.


> More over, since the files under /etc/apache2/ seems not to have been 
> modified by the newly installation, I was wondering if they still 
> remains useful for configuring apache ?

Installing httpd will not normally destroy old configuration files; this 
is desired behavior.

However, there are a number of differences between directives for httpd 
2.2 and httpd 2.4, and you will very likely need to change some 
directives in your httpd 2.2 configuration files in order to get your 
configuration to work with httpd 2.4.  For details, see 
https://httpd.apache.org/docs/2.4/upgrading.html

To find out where your custom httpd is looking for its configuration 
files, run "httpd -V" and examine the value of SERVER_CONFIG_FILE.  If 
the value does not begin with a / then prepend the value of HTTPD_ROOT 
to it.

> Last question : is there any option to tell apache which PHP to use ?

Yes, you will need to build a different version of mod_php for each 
version of PHP you want to use.  You then control which version of PHP 
gets used by specifying the path to the corresponding version of mod_php 
via the LoadModule directive.

For example, to load the default version of PHP shipped by Apple:

LoadModule php5_module libexec/apache2/libphp5.so

(this loads libphp5.so from /usr/libexec/apache2/libphp5.so).

If you compile PHP 5.4.0, including mod_php, and you've installed this 
version of mod_php in /opt/mystuff/apache-httpd/libexec/libphp5.so, then 
you can load it using the following directive:

LoadModule php5_module /opt/mystuff/apache-httpd/libexec/libphp5.so


I hope this helps.

--
   Mark Montague
   mark@catseye.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org