【发布时间】:2015-06-13 10:56:53
【问题描述】:
我想使用数据库中的脚本创建配置。配置存储为:
<VirtualHost *:80>
ServerName example.com
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Require all granted
</Proxy>
ProxyPass / http://10.20.30.50:81/ retry=1 timeout=30
ProxyPassReverse / http://10.20.30.50:81/
<Location />
Require all granted
</Location>
</VirtualHost>
Apache 给我以下错误信息:
apache2:/etc/apache2/apache2.conf 第 219 行的语法错误:/etc/apache2/sites-enabled/example.com.conf 第 1 行的语法错误:/etc/apache2/sites-enabled/ example.com.conf:1: 没有关闭。
我的脚本看起来像:
sql="SELECT domain, vhost from v_create_proxy_vhost where domain = 'example.com'"
while read vhost
do
echo "${vhost}"
printf "${vhost}" > "$vhostconfavailable/$domain.conf"
done < <(echo "$sql" |mysql -h $dbHost -u $dbUser -p$dbPassword --skip-column-names -s)
我怎样才能阅读它并将其保存为配置文件?阿帕奇 我一直在使用 Ubuntu 04.14、MySQL 和 Apache2。
【问题讨论】:
标签: mysql shell apache2 ubuntu-14.04