a2ensite from script path

与世无争的帅哥 提交于 2019-12-05 15:49:53

问题


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

then a2ensite is run via the same script

a2ensite /etc/apache2/sites-available/testsite.com

I get:

ERROR: No site found matching /etc/apache2/sites-available/testsite.com!

The script is being run as root.

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?

Thanks,


回答1:


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.



来源:https://stackoverflow.com/questions/13035385/a2ensite-from-script-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!