Adding a configuration directive to a VirtualHost account via Include?

Discussion in 'Apache' started by Kadence, Aug 30, 2009.

  1. #1
    I'd like to add a setting, for instance Alias:
    Alias /dir /path/to/folder
    Code (markup):
    To an account. But instead of something like this within httpd.conf:
    <VirtualHost 200.200.100.1:80>
        ServerName domain.com
        ServerAlias www.domain.com
        Alias /dir /path/to/folder
        ...
    </VirtualHost>
    Code (markup):
    I'd like to omit the Alias within httpd.conf, and place it in an Include. cPanel sometimes rebuilds httpd.conf, and might undo manual edits, but will leave Includes intact. An example of what I'd place in httpd.conf:
    <VirtualHost 200.200.100.1:80>
        ServerName domain.com
        ServerAlias www.domain.com
        ...
    </VirtualHost>
    Include "/usr/local/apache/conf/includes/extra.conf"
    Code (markup):
    I've tried something like this within extra.conf:
    <VirtualHost 200.200.100.1:80>
        Alias /dir /path/to/folder
    </VirtualHost>
    Code (markup):
    However that doesn't work. I also don't know if that would associate it with the proper domain, rather than just the IP.

    What's the right way to add an extra directive for an account using Includes?
     
    Kadence, Aug 30, 2009 IP