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!
Answer
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?
Attribution
Source : Link , Question Author : Patrick , Answer Author : Safado