Protocol-based directory settings.

Discussion in 'Apache' started by chapel21, Aug 25, 2009.

  1. #1
    I'm setting up a SVN/Apache machine for source control.

    I've gotten mod_ssl and mod_svn working fine. However, I have a new requirement:

    1) Support SVN via http port 80 for local IP
    2) AND Support SVN via https over 443 for external (non-local IPs)

    I have been able to set up the box to support each of these independetly, but have not figured out a way to support both simultaneously.

    So my questions are:

    1) Is this possible?
    2) If 1 == Yes, then How?

    I'm relatively new to apache, having come from IIS/Microsoft world, but i learn quick. So any additional/contextual information is helpful.

    My understanding is that you define virtualhosts as websites, and use the <Directory> directive for permission settings. I have set up the 80 and 443 sites, however, the <Directory> directive doesn't seem to support a Port specification, as that seems the way to go here.

    Any help with this is greatly appreciated,

    Thanks.
     
    chapel21, Aug 25, 2009 IP
  2. chapel21

    chapel21 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Alright, I got this working. For anyone interested:

    You can define the <Directory> directive inside of VirtualHost directives. Set up each virtual host based on the protocol e.g.

    <VirtualHost _default_:443>
    <Directory /MySvnRootDir>
    ...
    </Directory>
    </VirtualHost>
    <VirtualHost _default_:80>
    <Directory /MySvnRootDir>
    ...
    </Directory>
    </VirtualHost>

    Where each <Directory> directive has different allow/deny permissions.
     
    chapel21, Aug 26, 2009 IP