Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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:

#Listen 12.34.56.78:80
<IfDefine !MACOSXSERVER>
Listen 172.1.1.1:80
</IfDefine>

000_any_80__shadow.conf

<VirtualHost 172.1.1.1:80>
ServerName *
RewriteEngine On

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
CustomLog "/var/log/apache2/access_log" combinedvhost
SSLProxyEngine On
SSLCipherSuite "ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM"
SSLProxyProtocol -ALL +SSLv3 +TLSv1
DocumentRoot /var/empty

</VirtualHost>

0000_any_80_.conf.default

## Default Virtual Host Configuration

<VirtualHost 172.1.1.1:80 >
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
    SSLCipherSuite "ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM"
    SSLProtocol -ALL +SSLv3 +TLSv1
    SSLProxyEngine On
    SSLProxyProtocol -ALL +SSLv3 +TLSv1
</IfModule>

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

</VirtualHost> 

sites/virtual_host_global.conf

Listen  172.1.1.1:443
NameVirtualHost 172.1.1.1:443
Listen  172.1.1.1:80
NameVirtualHost 172.1.1.1:80

apachectl -S

VirtualHost configuration:
Syntax OK

Thanks!

share|improve this question
    
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

1 Answer 1

To make it stop listening on 443 comment out the "Listen 172.1.1.1:443" 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?

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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