Create an A or AAAA Record
If we do this first, by the time everything else is done the new DNS record should have registered and we’ll be ready to go.
Go to your web host’s DNS manager and create an A record, adding the following:-
|Hostname||IP||TTL (Time to Live)|
|mySubSite||the IP you use for mydomain.com||shortest option|
Save the record and exit the DNS manager. It’ll take a short while for the new setting to propagate. At my VPS, Linode, it’s minutes not hours. Yours? Dunno, but probably no longer than an hour or two.
Add Site Directories
Changing USERNAME for yours, at the terminal type:-
Create a Temp Homepage (optional)
You don’t have to bother with this section, but it can be useful.
.. hit return and paste:-
Add Virtual Host (vhost) with FastCGI, FURL Support & Optional WordPress Caching
Hit return and paste this, with the five domain substitutions:-
Option: If you don’t use WordPress with this sub-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 sub-domain files and go check it. If you’re moving an existing site, you should read this for a hassle-free relocation.