Solved

SSL and Multiple IPs on the same box

Posted on 2011-03-09
4
518 Views
Last Modified: 2013-12-16
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
Comment
Question by:DrDamnit
  • 2
4 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 166 total points
Comment Utility
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
 
LVL 7

Assisted Solution

by:jackiechen858
jackiechen858 earned 334 total points
Comment Utility

.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
 
LVL 7

Accepted Solution

by:
jackiechen858 earned 334 total points
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now