ovvessem's avatar

Remove app from nginx sites-enabled - sites-available

Hi,

Does anyone know the best way to remove an old app from the Laravel Homestead Nginx sites-enabled - sites-available config without vagrant destroy && vagrant up.

I tried vagrant provision but that option only maps new sites which I have defined in the Homestead.yaml file.

Thanks in advance for your response!

0 likes
7 replies
JosephusPaye's avatar
Level 16

Hi, I think you have to ssh into your Homestead box, go to the nginx directory, and then delete the files for the old apps from the sites-enabled and sites-available directories. Here's an example:

Go to sites-enabled directory

cd /etc/nginx/sites-enabled

Run ls to see all files

ls

Remove the file corresponding to the old site, replacing my-site.app with the name of the file.

sudo rm my-site.app

Do the same above, for the file(s) in the /etc/nginx/sites-available directory, then restart the nginx server with:

sudo service nginx restart

Also, don't forget to delete the site's definition from your Homestead.yaml file.

Hope that helps.

6 likes
sebastiansulinski's avatar

I tried that (exactly same problem), but my /etc/nginx/sites-enabled directory is completely empty - and problem persist on each vagrant up command.

idevwebs's avatar

Same here. Both sites enabled and site available are empty. Fresh install of homestead. This is among other issues like permissions for nginx. Really frustrating that this isnt working.

netiq's avatar

Thanks thanks thanks everytime I have been trying to set up a server I have run into this problem and I did not know how to solve it so I would always just completely re-install nginx but no more!! Thanks a lot even if this was already a bit old.

Please or to participate in this conversation.