Skip to content

Instantly share code, notes, and snippets.

@syntaqx
Created July 1, 2022 03:31
Show Gist options
  • Save syntaqx/e00fd8f74f1db6b5652556e219ad339a to your computer and use it in GitHub Desktop.
Save syntaqx/e00fd8f74f1db6b5652556e219ad339a to your computer and use it in GitHub Desktop.
Using envsubst for dynamic apache configurations
<VirtualHost *:80>
ServerName $APP_SERVER_NAME
ServerAlias www.$APP_SERVER_NAME
ServerAdmin [email protected]
DocumentRoot /var/www/
</VirtualHost>
export APP_SERVER_NAME="example.com"
envsubst < example.conf > /etc/apache2/sites-avaialble/example.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment