0

Apache server starts with no errors. I have ip 1.1.1.1 and 2.2.2.2 set up as static IP's. 'https://www.site1.com' connects with the server. 'https://www.site2.com' does not connect to the server.

virtual host file contents for site1.com:

Listen 1.1.1.1:80
Listen 1.1.1.1:443

<VirtualHost 1.1.1.1:80>
    ServerName site1.com
    RewriteEngine On
    ...
</VirtualHost>

<VirtualHost 1.1.1.1:443>
    ServerName site1.com
    ...
    SSLEngine On
    ...
</VirtualHost>

virtual host file contents for site2.com:

Listen 2.2.2.2:81
Listen 2.2.2.2:444

<VirtualHost 2.2.2.2:81>
    ServerName site2.com
    RewriteEngine On
    ...
</VirtualHost>

<VirtualHost 2.2.2.2:444>
    ServerName site2.com
    ...
    SSLEngine On
    ...
</VirtualHost>

results of 'netstat -lpn':

tcp        0      0 2.2.2.2:81       0.0.0.0:*               LISTEN      -               
tcp        0      0 2.2.2.2:444      0.0.0.0:*               LISTEN      -               

There is nothing else on ports 81 or 444. The results of 'grep -r Listen /etc/apache2' (excluding repeat in sites-enabled dir):

/etc/apache2/sites-available/site1.com:Listen 1.1.1.1:80
/etc/apache2/sites-available/site1.com:Listen 1.1.1.1:443
/etc/apache2/sites-available/site2.com:Listen 2.2.2.2:81
/etc/apache2/sites-available/site2.com:Listen 2.2.2.2:444

site2 DNS Records:

A/AAAA Records
Hostname    IP Address       TTL            Options
            2.2.2.2          Default    Edit | Remove
mail        2.2.2.2          Default    Edit | Remove
www         2.2.2.2          Default    Edit | Remove

ping 2.2.2.2 results:

64 bytes from 2.2.2.2: icmp_seq=0 ttl=52 time=32.897 ms

What am I missing? Thanks for your help.

1

When you go to http://www.site2.com/, you're going to port 80. Since that site is listening on port 81, and the listener on port 80 doesn't know about it, it doesn't work. You either have to make both sites listen on port 80 or you have to go to http://www.site2.com:81/

  • site2.com:81 doesn't connect either. – Jay Jul 12 '13 at 17:55
  • 1
    Are you trying HTTP or HTTPS? If the latter, you have to specify port 444, since that's what you configured it for. – John Jul 12 '13 at 17:59
  • oh brother. right. 444 works. now... what to do. specifying a port for the general public isn't going to work. need two ips for two different ssl certs. i thought i had to bind the ips to different ports. maybe NIC. – Jay Jul 12 '13 at 18:14
  • 1
    You can specify Listen *:80 and Listen *:443. You an have both IPs listening on the standard ports - that's usually how it's done. The Listen directive is put in a common file, not in the site-specific or IP-specific files. – John Jul 12 '13 at 18:19
  • will give that a try. didn't work last time i tried it but don't remember why. – Jay Jul 12 '13 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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