我一直收到这个错误,你们知道出了什么问题吗?
rapache是重启apache的别名
mugbear:/usr/bin# cat /usr/bin/mkdomain if [ -d "/srv/www/$1" ]; then echo "Domain $1 already exists!" else mkdir -p /srv/www/$1/public_html mkdir -p /srv/www/$1/logs cat >> /etc/apache2/sites-available/"$1" << EOF <VirtualHost removed:80> ServerAdmin support@$1 ServerName $1 ServerAlias www.$1 DocumentRoot /srv/www/$1/public_html/ ErrorLog /srv/www/$1/logs/error.log CustomLog /srv/www/$1/logs/access.log combined </VirtualHost> EOF a2ensite $1 rapache fi mugbear:/usr/bin# mkdomain test.com /usr/bin/mkdomain: line 19: Syntax error: unexpected end of file
你的heredoc永远不会结束,因为终结符不在行的开头.
原文链接:https://www.f2er.com/bash/385316.html