I'm trying to run Apache and nginx on the same machine, on different IP addresses.

It's a Mac Mini with one ethernet card. I configured two eth network devices. I tried to change the apache configuration in /etc/apache2 to listen only on one IP, and most of it works. However, there is still an apache redirect from http:80 to https:443 on the second IP and I don't know where else to look. I changed all virtual hosts, virtual host global files and the httpd.conf including all default and __shadow files.

So I suppose it's not a problem of the SSL configuration, as I don't even want to get to the SSL part. It's the redirect from 80 to 443 which is not supposed to happen.

What else do I need to change to make apache listen on only one IP address and not change the protocol?

httpd.conf is too large. Important part:



ServerName *
RewriteEngine On

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
CustomLog "/var/log/apache2/access_log" combinedvhost
SSLProxyEngine On
SSLProxyProtocol -ALL +SSLv3 +TLSv1
DocumentRoot /var/empty



## Default Virtual Host Configuration

<VirtualHost >
ServerAdmin admin@example.com
DocumentRoot "/var/empty"
DirectoryIndex index.html index.php /wiki/ default.html
CustomLog "/var/log/apache2/access_log" combinedvhost
ErrorLog "/var/log/apache2/error_log"

<IfModule mod_ssl.c>
    SSLEngine Off
    SSLProtocol -ALL +SSLv3 +TLSv1
    SSLProxyEngine On
    SSLProxyProtocol -ALL +SSLv3 +TLSv1

<Directory "/var/empty">
    Options All +MultiViews -ExecCGI -Indexes
    AllowOverride None
    <IfModule mod_dav.c>
        DAV Off




apachectl -S

VirtualHost configuration:
Syntax OK


  • Patrick, I think your going to need to post/link to all your configuration files for us to help you. Have you checked the ssl.conf file? All your vhosts? – AliGibbs Mar 28 '12 at 13:25
  • The output of apache2ctl -S or apachectl -S will help. – Ladadadada Mar 28 '12 at 13:40
  • Added the config files and output. Don't know if it helps though :( – Patrick Mar 28 '12 at 13:51

To make it stop listening on 443 comment out the "Listen" and the associated NameVirtualHost line. You should probably comment out the rewrite rule in 000_any_80__shadow.conf or just get rid or just exclude that file completely if you're not going to use it.

Odd thing, though, is that your apachectl -S command had no output. That should have shown those Virtual hosts. If you check the bottom of your main httpd.conf file, it should have a bunch of Include lines. Can you verify that it's even using all of those extra .conf files that you've posted?

  • Yes, all files are included properly. I don't want it to stop listening, I need the service on this IP. Just not on the second IP. Thanks! – Patrick Mar 28 '12 at 14:22
  • Sorry, misunderstood the question – Safado Mar 28 '12 at 14:28

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.