问题描述
我想自动在我的测试环境中的某些新的站点部署。我的脚本自动生成的Apache虚拟主机文件中的
I'm trying to automate some new site deployment in my testing environment. My script auto generates the apache vhost file in
/etc/apache2/sites-available/testsite.com
然后a2ensite通过同一个脚本运行
then a2ensite is run via the same script
a2ensite /etc/apache2/sites-available/testsite.com
我得到:
ERROR: No site found matching /etc/apache2/sites-available/testsite.com!
脚本正在以root身份运行。
The script is being run as root.
我看了,你必须从网站可用目录a2ensite但如果这是通过脚本来完成我怎么会告诉a2ensite认为其在正确的目录?
I read that you must a2ensite from the sites-available directory but if this is being done via script how would I tell a2ensite to think its in the proper directory?
谢谢,
推荐答案
a2ensite的没有提到它明确,但实际上你应该提供的网站只是一个名字被启用,像...
a2ensite's man page doesn't mention it explicitly, but you actually should supply just a name of the site to be enabled, like...
a2ensite testsite.com
...而不是整个路径。
... and not the whole path to it.
这篇关于从脚本路径a2ensite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!