<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Envsubst</id>
	<title>Envsubst - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Envsubst"/>
	<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Envsubst&amp;action=history"/>
	<updated>2026-04-28T16:38:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://tech.uvoo.io/index.php?title=Envsubst&amp;diff=2221&amp;oldid=prev</id>
		<title>Busk: Created page with &quot;Use bash to replace variables in host  https://serverfault.com/questions/287688/templating-with-linux-in-a-shell-script  ``` Example template file apache.tmpl:  &lt;VirtualHost *...&quot;</title>
		<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Envsubst&amp;diff=2221&amp;oldid=prev"/>
		<updated>2021-09-15T11:49:43Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Use bash to replace variables in host  https://serverfault.com/questions/287688/templating-with-linux-in-a-shell-script  ``` Example template file apache.tmpl:  &amp;lt;VirtualHost *...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Use bash to replace variables in host&lt;br /&gt;
&lt;br /&gt;
https://serverfault.com/questions/287688/templating-with-linux-in-a-shell-script&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
Example template file apache.tmpl:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:${PORT}&amp;gt;&lt;br /&gt;
    ServerName ${SERVER_NAME}&lt;br /&gt;
    ServerAlias ${SERVER_ALIAS}&lt;br /&gt;
    DocumentRoot &amp;quot;${DOCUMENT_ROOT}&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Run envsubst and output result to new file my_apache_site.conf:&lt;br /&gt;
&lt;br /&gt;
export PORT=&amp;quot;443&amp;quot;&lt;br /&gt;
export SERVER_NAME=&amp;quot;example.com&amp;quot;&lt;br /&gt;
export SERVER_ALIAS=&amp;quot;www.example.com&amp;quot;&lt;br /&gt;
export DOCUMENT_ROOT=&amp;quot;/var/www/html/&amp;quot;&lt;br /&gt;
envsubst &amp;lt; apache.tmpl &amp;gt; my_apache_site.conf&lt;br /&gt;
Output:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
    ServerName example.com&lt;br /&gt;
    ServerAlias www.example.com&lt;br /&gt;
    DocumentRoot &amp;quot;/var/www/html/&amp;quot;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
```&lt;/div&gt;</summary>
		<author><name>Busk</name></author>
	</entry>
</feed>