Apache2, mod_proxy, mod_ssl on OSX not working

apache-2.2mac-osxmod-proxymod-rewritemod-ssl

I am trying to setup apache2 on OSX and am having an issue. I am trying to proxy a domain to 127.0.0.1:8081 (which is up and running) but when try to load through apache I get a "Web Page Not Found". I am also getting nothing in the error_log to indicate what is going on, and "apachectl configtest" returns OK. These directives are working perfectly on a linux server running apache2.

The last message I see in the logs after starting apache is:
[notice] Apache/2.2.20 (Unix) mod_ssl/2.2.20 OpenSSL/0.9.8r DAV/2 configured — resuming normal operations

Any help would be great and I am no apache expert!

/private/etc/apache2/extra/http-vhosts.conf

TransferLog /var/log/apache2/transfer_log
ProxyRequests Off

NameVirtualHost *:443

#
# THIS IS WORKING OK
# EVERYTHING ON PORT 80 IS CHANGED TO HTTPS
#
<VirtualHost *:80>
        ProxyRequests Off
        ProxyPreserveHost On
        RewriteEngine On
        RewriteCond %{HTTPS} off
        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</Virtualhost>

<VirtualHost *:443>
        # I have an entry in /etc/hosts pointing mydomain.com to 127.0.0.1
        # and http://mydomain.com gets redirected to https://mydomain.com ok
        ServerName mydomain.com

        SSLProxyEngine On
        SSLProxyMachineCertificateFile /etc/ssl/certs/mycert.pem

        ProxyRequests Off
        ProxyPreserveHost On

        # 
        # 127.0.0.1:8081 is up and running OK
        #
        ProxyPass / http://127.0.0.1:8081/
        ProxyPassReverse / http://127.0.0.1:8081/

        TransferLog /var/log/apache2/ssl_access_log
        SSLEngine on
        SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
        SSLCertificateFile /etc/ssl/certs/mycert.crt
        SSLCertificateKeyFile /etc/ssl/certs/mykey.key
        SSLCertificateChainFile /etc/ssl/certs/mybundle.crt
        <Files ~ "\.(cgi|shtml|phtml|php3?)$">
                SSLOptions +StdEnvVars
        </Files>
        <Directory "/var/www/cgi-bin">
                SSLOptions +StdEnvVars
        </Directory>

        SetEnvIf User-Agent ".*MSIE.*" \
                         nokeepalive ssl-unclean-shutdown \
                         downgrade-1.0 force-response-1.0

        CustomLog /var/log/apache2/ssl_request_log \
                          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>

Thanks!

Best Answer

Turns out the include was commented out in httpd.conf.

Changed:

<IfDefine !MACOSXSERVER>
#Include /private/etc/apache2/extra/httpd-ssl.conf
</IfDefine>

To:

<IfDefine !MACOSXSERVER>
Include /private/etc/apache2/extra/httpd-ssl.conf
</IfDefine>

And it is all working now :)