Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

a2ensite from script path

Tags:

apache

vhosts

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,

like image 207
user564448 Avatar asked Oct 23 '12 16:10

user564448


1 Answers

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.

like image 65
raina77ow Avatar answered Oct 10 '22 04:10

raina77ow