Skip to content

Instantly share code, notes, and snippets.

@LeZuse
Created May 4, 2012 22:19
Show Gist options
  • Save LeZuse/2598085 to your computer and use it in GitHub Desktop.
Save LeZuse/2598085 to your computer and use it in GitHub Desktop.
Apache mod_macro example
# Place in mods-enabled folder (or symlink here)
<Macro VHostSetup $name>
ServerName $name
ServerAlias www.$name
ServerAdmin administrator@$name
DocumentRoot /var/www/apache/$name/$name
<Directory /var/www/apache/$name/$name>
Order allow,deny
Allow from all
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/$name.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/$name.log combined
</Macro>
# Place in sites-enabled folder (or symlink here)
<VirtualHost *:80>
Use VHostSetup example.com
# Additional directives
</VirtualHost>
@myersCody
Copy link

I am having issues enabling the macro from a separate file. Was there anything special you had to do in order to allow the macro to be placed into mod_enable and still be used in sites-enabled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment