5 Replies Latest reply: Jan 11, 2013 6:50 PM by zzTontozz
zzTontozz Level 1 Level 1 (0 points)

I (perhaps foolishly) upgraded Apache from 2.2.22 to 2.2.23 on OS X Mountain Lion Server. Following the upgrade, remote clients on the LAN cannot access the Web server's default.html.en web page. The DNS entries still look okay on OS X Mountain Lion Server.

Any ideas as to what might have got broken/overwritten by Apache by doing the upgrade that I need to fix or could something be blocking things?

 

Also, while probably not related, when, directly from the (updated) web server machine, I access 127.0.0.1 from within the web browser I can see the start up web page for Apache on OS X Server (so Apache is running, just can't be accessed remotely). However, when I try to access the same web page, again directly from the local web server machine, but this time using localhost instead of the IP address in the URL then the web page doesn't appear.

The hosts file on the web server has the following entries:

127.0.0.1     localhost
255.255.255.255     broadcasthost
::1             localhost
fe80::1%lo0     localhost


Mac mini, OS X Server
  • 1. Re: After upgrading Apache to 2.2.23 there is a problem
    pterobyte Level 6 Level 6 (10,910 points)

    How exactly did you upgrade?

    Did you check that your configuration files are still the old ones and that they have not been overwritten?

  • 2. Re: After upgrading Apache to 2.2.23 there is a problem
    zzTontozz Level 1 Level 1 (0 points)

    From the Apache source (expanded httpd-2.2.23.tar.gz)

     

    I did, after a Terminal cd to httpd-2.2.23, the ./Configure, make, make install thing:

     

    ./configure --enable-layout=Darwin --sysconfdir=/private/etc/apache2 --localstatedir=/private/var --with-suexec-bin=/usr/bin/suexec --disable-authn-file --disable-authn-dbm --disable-authn-anon --disable-authn-dbd --disable-authn-default --disable-authz-host --disable-authz-groupfile --disable-authz-user --disable-authz-dbm --disable-authz-owner --disable-authz-default --disable-auth-basic --disable-include --disable-filter --disable-log-config --disable-env --disable-setenvif --disable-mime --disable-status --disable-autoindex --disable-asis --disable-cgi --disable-negotiation --disable-dir --disable-actions --disable-alias

     

    Sadly, yes the httpd.conf looks like it was overwritten (couldn't see a backup).

  • 3. Re: After upgrading Apache to 2.2.23 there is a problem
    pterobyte Level 6 Level 6 (10,910 points)

    Don't you have a backup you made yourself before attempting the upgrade? Even if only Time Machine? If not, do a clean install on a separate drive and copy over the config files. You'll need the ones in /etc/apache2 and the ones in /Library/Server/Web/Config/apache2

     

    Your ./configure parameters seem correct, btw.

  • 4. Re: After upgrading Apache to 2.2.23 there is a problem
    zzTontozz Level 1 Level 1 (0 points)

    Yes, I should have backed up httpd.conf but unfortunately I didn't (it was a very long day). On the upside I am learning way more about httpd.conf than I ever thought I would.

     

    After some soul searching I have since discovered that the ./configure string should also have had --disable-version in it. This is because it is a built-in module.

     

    So a recompile of Apache and Apache is running and remote client machines can see 'html' based web pages. However, there remains a problem in that accessing php pages results in the php code being viewed instead of the web page. So something is still broken somewhere just not sure what. Any ideas? Please advise.

     

    Below is a snippet of my httpd.conf RE the PHP side of things:

     

    Snippet----------------------------

    LoadModule php5_module        libexec/apache2/libphp5.so
    #I have checked the libexec/apache2/libphp5.so exists. Still scratching head!

     

    PHPIniDir “/etc/php.ini”

     

    <IfModule php5_module>
        AddType application/x-httpd-php .php
        AddType application/x-httpd-php-source .phps
        <IfModule dir_module>
            DirectoryIndex index.html index.php
        </IfModule>
    </IfModule>

     

    Include /private/etc/apache2/other/*.conf

    End snippet----------------------------

     

    By the way, doing a 'php -v' gives me the following result in Terminal which I presume means that PHP is okay but for some reason Apache or the Server is missing something but I don't know what that might be

     

    PHP 5.4.10 (cli) (built: Jan  9 2013 09:33:16)
    Copyright © 1997-2012 The PHP Group
    Zend Engine v2.4.0, Copyright © 1998-2012 Zend Technologies

  • 5. Re: After upgrading Apache to 2.2.23 there is a problem
    zzTontozz Level 1 Level 1 (0 points)

    Found the solution.

     

    Replacing AddType with the Addhandler as below did the trick:

    <IfModule php5_module>
    AddHandler php5-script .php
        <IfModule dir_module>
            DirectoryIndex index.html index.php
        </IfModule>
    </IfModule>