Question

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

Posted August 5, 2017 769 views
Ubuntu WordPress

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.

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.

1 answer

Hello,

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

Submit an Answer