Failed to create symbolic link: File exist

This is sort of recurring question in here, but I read all the answers I could found and it did not made it clearer to me what should I do, please help me since I am completely new to Ubuntu and VPS altogether. I am trying to deploy simple website I developed through django.

While following this guide (and some other various material), I stumbled to the point where according to the guides I have to (quoting guide):

  1. Now we need to set up a symbolic link in the /etc/nginx/sites-enabled directory that points to this configuration file. Change directories to /etc/nginx/sites-enabled.

    I have done that with:

    cd /etc/nginx/sites-enabled
  2. Once there, run this command:

    sudo ln -s ../sites-available/myproject

    Since from the beginning of the guide I used skaiciuokle_web project name instead of myproject, that is the only place where I deviate from guide and use the command:

    sudo ln -s ../sites-available/skaiciuokle_web

After running the sudo ln -s command I get this error:

ln: failed to create symbolic link '/etc/nginx/sites-enabled/skaiciuokle_web': File exists`

Despite probably reading all the previous questions, I still cannot understand why I am getting this error, because I (almost) followed the guides to the letter.

Could somebody point me to the right direction?

5

1 Answer

You can overwrite the existing file ../sites-enabled/myproject by forcing ln like this

sudo ln -sf ../sites-available/myproject ../sites-enabled/

then

sudo service nginx restart

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like