OSX上的Apache2,mod_proxy,mod_ssl不起作用

我正在尝试在OSX上设置apache2,并遇到问题。 我试图代理一个域到127.0.0.1:8081(这是启动和运行),但当尝试通过Apache加载,我得到一个“网页找不到”。 我也没有收到error_log来指示发生了什么,“apachectl configtest”返回OK。 这些指令在运行apache2的linux服务器上工作正常。

在启动apache之后,我在日志中看到的最后一条消息是:[notice] Apache / 2.2.20(Unix)mod_ssl / 2.2.20configuration了OpenSSL / 0.9.8r DAV / 2 – 恢复正常操作

任何帮助将是伟大的,我不是apache专家!

/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> 

谢谢!

结果发现include已经在httpd.conf中被注释掉了。

更改:

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

至:

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

这是现在所有的工作:)