Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dokku domains:add <app> <domain> returns unsupported vhost config found. disabling vhost support

This is my first site I've were I've tried to use Dokku to deploy a rails app on Digital Ocean.

This is a default Dokku install on a basic Ubuntu VM hosted on Digital Ocean

When I try to run:

dokku domains:add myapp mydomain.com

I get the following error

=====> unsupported vhost config found. disabling vhost support
=====> config:set-norestart is deprecated as of v0.3.22
-----> Setting config vars
       NO_VHOST: 1
-----> VHOST support disabled, deleting four-heroes/VHOST
-----> Added mydomain.com to myapp

The last line looks like it may have worked despite the errors. However, when I run:

dokku domains myapp

I get this message.

=====> unsupported vhost config found. disabling vhost support
=====> config:set-norestart is deprecated as of v0.3.22
-----> Setting config vars
       NO_VHOST: 1
=====> myapp Domain Names
cat: /home/dokku/myapp/VHOST: No such file or directory

Aside from the Postgresql plugin this is a default Dokku install. The application works well and Im able to access it at the the ip.ad.dr.ess:port combination, and I'm able to SSH to the domain(ssh [email protected]).

I can't figure out where I messed up here.

Any help is appriciated.

like image 850
greyoxide Avatar asked Jul 22 '15 19:07

greyoxide


1 Answers

If you didn't fill in the HOSTNAME option on initial setup of dokku you'll run into your current problem. The VHOST file has yet to be created causing the current error.

To remedy this we have to create the missing VHOST file and populate with your domain name. First SSH into your droplet and run the following (Depending on your permissions you may require sudo to create and edit the VHOST file)

cd /home/dokku
touch VHOST
chmod 0755 VHOST
# Use your editor of choice nano, vim etc. 
# to add your hostname to VHOST file, eg. mydomain.com

Now for each app we're going to need to trigger a rebuild of the nginx.conf file. To do this run dokku nginx:build-config myapp for each app.

Note: Deleting the app's dir from /home/dokku/myapp and redeploying will also have the same effect but will require you to re-link other containers e.g. db plugins.

If everything has gone smoothly running dokku domains myapp should now ouput in your terminal

=====> myapp Domain Names
myapp.mydomain.com

You now should be able to remove and add domains for your app successfully using the dokku domains commands

See this answer also for reference

like image 190
jamsinclair Avatar answered Nov 02 '22 09:11

jamsinclair