我想用数据库中的脚本创建一个配置。配置存储为:
<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提供了以下错误消息:
/etc/apache2/sites-enabled/example.com.conf:1::/etc/apache2/apache2.conf: /etc/apache2/apache2第1行的语法错误-启用/example.com.conf:apache2未关闭。
我的剧本看上去像:
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)
如何读取此文件并将其保存为配置文件?Apache2一直在使用Ubuntu04.14、MySQL和Apache2。
发布于 2015-06-13 20:49:27
https://stackoverflow.com/questions/30817874
复制相似问题