Re: File structure for nearly identical sites

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Your best option to do that might be to add a separate file with that config and call it with IncludeOptional

For example:
<Macro VHost $name $domain>
<VirtualHost *:80>
    ServerName $domain
    ServerAlias www.$domain

    DocumentRoot "/var/www/vhosts/$name"
    ErrorLog "/var/log/httpd/$name.error_log"
    CustomLog "/var/log/httpd/$name.access_log" combined
    
    IncludeOptional "/var/www/config/$name.conf"
</VirtualHost>
</Macro>

You can then add the different config to those files.

- Y

On Thu, Jul 9, 2020 at 4:25 PM Darryl Philip Baker <darryl.baker@xxxxxxxxxxxxxxxx> wrote:

I am getting a set of over 50 sites moved over to my server from elsewhere and the content manager want to duplicate each of these in a dev subdomain. An example eatatjoes.example.com and eatatjoes.dev.example.com. I am thinking that I can include the same configuration file twice if I replace the “dev.” with a macro. The first time in include the file the macro has the value of “.” And the second time the value of the macro is “dev.” I would do something similar for the document directory.

 

Is there a way of keeping some directives from being in the live configuration for just the second time I include the file?

 

In my case there are likely to be redirects as they test a site prior to a relaunch. They like to keep bookmarks working even after restructuring a site.

 

Darryl Baker, GSEC  (he/him/his)

Sr. System Administrator

Distributed Application Platform Services

Northwestern University

1800 Sherman Ave.

Suite 6-600 – Box #39

Evanston, IL  60201-3715

darryl.baker@xxxxxxxxxxxxxxxx

(847) 467-6674

 


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux