I am using cloudlinux through DirectAdmin (this shouldn't matter) and I am trying to create a new Django application using the "Setup Python App" create application option. I have uploaded my django files properly and I am certain that the correct permissions are set to the applications folder (i.e. chowner -R username foldername
and chmod -R 755 foldername
).
Every time I try to add it get the error Specified directory already used by '/path/to/application'
.
I have removed the virtual environment and even tried putting the app in various locations in case the root wasn't good enough but I still received this error.
To resolve this, you have to go to your public_html directory and remove/rename the .htaccess file (i.e. /home/user/domains/domainname/public_html/.htaccess). Note: if you have anything custom in here, you may want to rename it or copy out the settings to add to the new .htaccess file that will get created.
Once this is done, you can run the create application feature again and it should create it just fine now.
You may also have permissions issues as mentioned in the question that you may need to fix using those steps as well as removing the environment if it has failed on the permissions error.
It is also worth noting that this works for Node.js apps as well. Errors are almost identical.