Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Serving HTTP and HTTPS with Apache 2.2

    I want to run a website that is both HTTP and HTTPS. How do I go about with the configuration file?

    Lets says I have a configuration file for do I need to create:

    <VirtualHost _default_:443>
    <VirtualHost *:80>

    or can I create:

    <VirtualHost *:80 _default_:443>

    I am assuming HTTPS settings are ignored when HTTP is used?


  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    You need two virtual hosts.
    One for http, one for https.

    https is actually not restricted to the port, but rather getīs enabled if you use the proper config within a virtualhost secrtion.
    You must always face the curtain with a bow.

  3. #3
    I use Apache 2.2.14-5ubuntu8.4. As you may be aware, the dumb ****s over at Canonical changed the structural layout of this version of Apache over the official version.
    So, I have a sites-available directory that contains the configuration files and sites-enabled directory that holds the symbolic link pointing to the relative configuration file, which makes the website 'live' and accessible to the world.

    This is what I don't get...

    If I make the symbolic link '', then its going to point to '' configuration file, but then how am I also going to make it 'link-in' with the SSL configuration file? I can't make a symbolic link and link to a configuration file with the same name, because that won't be my domain name and will not be served when the request is made... so, thats why I am asking if I point the symbolic link to '' configuration file, and if I use a SSL configuration file with this in it:

    <VirtualHost *:80 _default_:443>

    Where non-relative SSL setting will be ignored when HTTP is being served.

    ... or a configuration file with both:

    <VirtualHost _default_:443>
    <VirtualHost *:80>

    ... where the relative VirtualHost is selected depending on which protocol is being used?

    Do you know what I mean?
    Last edited by Kolusion; 08-17-2011 at 05:35 AM.

  4. $spacer_open
  5. #4
    Nice information post over here.This is useful for web server apache 2.2.

  6. #5
    So I tried:

    <VirtualHost *:80>
    bla bla bla
    <VirtualHost *:443>
    bla bla bla

    .. and it worked. Solved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts