• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 539
  • Last Modified:

SSL and Multiple IPs on the same box

I have a nice Proliant ML350 with RAID-5 and SAS drives, etc...

I have two sites I want to host on it, but both need SSL. I have multiple free public IPs so I can assign a new IP for one of the sites no problem.

Trouble is...

1. How do I assign multiple IPs to the box?
2. How do I configure Apache to listen for site a on 123.456.78.90 and site b on abc.def.ghi.jkl?

OS: Ubuntu 9.10
0
DrDamnit
Asked:
DrDamnit
  • 2
3 Solutions
 
Dave BaldwinFixer of ProblemsCommented:
You create 'Virtual Host' for each site.  Start here: http://httpd.apache.org/docs/2.2/vhosts/  It's not hard but details matter.  I've set up about 6 of them with private IPs (10.10.x.x) on my LAN for testing.
0
 
farzanjCommented:
Concept of giving multiple ip addresses is similar in ubuntu except that it keeps one file whereas in other distributions, they keep separate files.

Here is how it works.  You can give as many IP addresses to an interface as you want.  But you have to name them a little differently.  For example instead of writing eth0, you have to say eth0:0 (first), eth0:1 (second),  eth0:2, third interface, and so on.  You can also define a range of IP addresses.

Sample interface file would look like
http://www.cyberciti.biz/faq/setting-up-an-network-interfaces-file/

Second question:

Apache allows you to make as many Virtual Host as you want.  Each one can have the same IP address or a different one.
They may share the directory for files or may have their own.  This is called DocumentRoot.  You specify you IP address in the document root header, on which it is supposed to listen
Code would look like this.  Put this at the bottom of your httpd.conf file.  You should set the parameters yourself
<VirtualHost 123.456.78.90:80>
    ServerAdmin webmaster@theos.in
    DocumentRoot "/usr/local/docs/theos.in"
    ServerName www.theos.in
    ServerAlias theos.in
    ErrorLog "/var/log/theos.in-error_log"
    CustomLog "/var/log/theos.in-access_log" common
</VirtualHost>
 
<VirtualHost abc.def.ghi.jkl:80>
    ServerAdmin webmaster@nixcraft.com
    DocumentRoot "/usr/local/docs/nixcraft.com"
    ServerName www.nixcraft.com
    ServerAlias nixcraft.com
    ErrorLog "/var/log/nixcraft.com-error_log"
    CustomLog "/var/log/nixcraft.com-access_log" common
</VirtualHost>

Open in new window

0
 
jackiechen858Commented:

.1 to add multipli ip, it depend on what Linux OS you machine has, typically you can goto /etc/sysconfig/network-scripts/ folder, if you see something like if-eth0, you can copy it to ifcfg-eth0:1, modify it to give a different ip.

Run "service network restart" , then run  ifconfig , you should see multiple ip.

 for HTTPS, you CAN NOT put multi domain into same IP address. this is different than HTTP virtual host.






0
 
jackiechen858Commented:
check this example:
http://www.apache-ssl.org/httpd.conf.example

first, you need to configure apache to listen on port 443, like "Listen 443"

then you can configure each site with a different ip address. You need to generate ssl certificate for each site.



SSLCertificateKeyFile /www/certs/another-ssl.fictional.co.key
SSLCertificateFile /www/certs/another-ssl.fictional.co.cert  
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now