How to define second ssl port on Apache

Posted on 2006-05-15
Last Modified: 2012-06-27
I am trying to setup two or more ssl certificates for a machine.
I have just one IP
I have two name based Virtual hosts.
I have two separate SSL certificates.

I tried to assign each Virtual host a different port for SSL 443 and 444
I used:
Listen 80
Listen 443
Listen 444


### site1
<VirtualHost *:80>
  DocumentRoot /www/htdocs/

# ssl site:
    DocumentRoot /www/htdocs/testcom/

    SSLCertificateFile  /path/to/ceritficate1.crt
    SSLCertificateKeyFile  /path/to/ceritficate1.key
    SSLCACertificateFile  /path/to/intermediate1.crt

#### site 2
<VirtualHost *:80>
  DocumentRoot /www/htdocs/

# ssl site:
    DocumentRoot /www/htdocs/testcom/

    SSLCertificateFile  /path/to/ceritficate2.crt
    SSLCertificateKeyFile  /path/to/ceritficate2.key
    SSLCACertificateFile  /path/to/intermediate2.crt


But with above configuration, it is still sees the port 443 when I try to use

I do not define port number if my URL link, and I want to avoid it.

Is there any way to do this?


Question by:Nav444
    LVL 11

    Accepted Solution

    Firstly make sure you NameVirtualHost x.x.x.x
    directive is not remarked out in httpd.conf

    If you set up a virtual host and want it to listen on a non-default port (80 is the default port for non-secure Web communications; 443 is the default port for secure Web communications), you will need to set up a virtual host for that port and add a Listen directive to httpd.conf, corresponding to that port.

    To have a virtual host work specifically for that port, add the port number to the first line of the virtual host configuration. The first line should look something like the following:

    <VirtualHost ip_address_of_your_server:12331>

    This line would create a virtual host that listens on port 12331. Substitute the port number you want to use for 12331 in the previous example.

    Underneath the Listen lines in httpd.conf, add a line like the following, which will instruct your Web server to listen on port 12331:

    Listen 12331
    LVL 43

    Expert Comment

    You are doing good, but using in web browser https://anything.tld/ tells it to go to 443 port (it's browser issue - default)
    Use: https://yourdomain.tld:444/
    LVL 11

    Expert Comment

    If you want two SSL servers, you'll need to do what I do and
    dev, tst, and devel- create totally different install trees for each
    Apache instance.  See:

    The idea is to have multiple builds of Apache on the same system,
    and call them within their own chroots.

    If you want to conceal the http://host:port address from the overhead
    browser bins then you might be able to serve the page through a proxy or
    with some server side programming that snatches that https://host:port/page.shtml
    and serves it up under the default server with an alternate URL.


    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

    Hello EE, Today we will learn how to send all your network traffic through Tor which is useful to get around censorship and being tracked all together to a certain degree. This article assumes you will be using Linux, have a minimal knowledge of …
    BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (, affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    734 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

    23 Experts available now in Live!

    Get 1:1 Help Now