I need to move existing ssl enabled wordpress site to its own directory

I have a working and ssl enabled website in /var/www directory and I need to move it to its own directory /var/www/newdirectory or folder.

Move from /var/www to /var/www/folder

reason is I want to have multiple websites on same vps. here are the steps i have tried and failed.

  1. created directory in /var/www/folder
  2. moved wordpress files to newly created folder
  3. did comand a2dissite website-ssl.conf
  4. changed the root document on sites-available>website-ssl.conf to /var/www/website
  5. re-enabled a2ensite website-ssl.conf

I need guidance on the steps im missing here, I also thing i missed a2mod ssl disable comand i think.

any help would be gratefully appreciated.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.


The steps that you’ve taken look fine, but you could just update the document root without disabling the site, you just need to restart Nginx after you’ve updated the document root. Your changes would not take effect unless Nginx is restarted.

Note that it is a good practice to always run a config test before restarting Nginx:

nginx -t

If you get Syntax OK then it is fine to do the restart.

Also note that you would need to update all of the references in your Wordpress database from /var/www/html to /var/www/newdir.

Regards, Bobby