OK. So I did this guide already, already! But as this is one of the main things people do with a VPS – adding extra domains – I figured it wouldn’t hurt to provide a shortcut cheatsheet too, minus the blarney.
If you do want the detail, the why’s, the where’s, the wherefore’s, then read Serve Multiple Sites & Blogs with Virtual Hosts.
Create DNS Records
Add the DNS settings as explained in Add a Domain Zone to Your VPS.
Add Site Directory Structure
At the terminal, type:-
Create a Temporary Homepage (optional)
You don’t have to bother with this, but I guess some folks will find it handy.
.. hit return and paste:-
Add Virtual Host (vhost) with FastCGI, FURL Support & Optional WordPress Caching
Return and paste this:-
Option: If you don’t use WordPress with this site, delete the following lines from the above:-
Option: If you do want WordPress, and want both pretty permalinks and WP Super Caching support, leave the above, as is.
Option: If you do want WordPress, and want pretty permalinks but not WP Super Caching, swap this:-
.. for this :-
Save the file.
Create the Symlink and Restart Nginx
Paste this into the terminal:-
And reboot the web server by typing ..
.. Or if you followed Edit bashrc for User-Friendly Linux, plus System Updates, just type:-
Upload your new domain’s site files and go check it. If you’re relocating an existing site, you should read Moving Day! How to Move Your Blog or Site.