Setup NGINX site from command line

1) Sign into Linux server using an application like Putty (Windows) or Terminal (Mac):

ssh root@207.158.15.230
password: Oz1183lc!st

2) Create the website directory (for example, domesticmamaeo.com):

mkdir -p /var/www/domesticmamaeo.com/public_html
mkdir -p /var/www/domesticmamaeo.com/logs

3) Change the ownership of the directory to the web user:

chown -R www-data:www-data /var/www/theatereleven.com/public_html
chown -R www-data:www-data /var/www/domesticmamaeo.com/logs

4) Create the web site config file (we’re copying another and then editing – aussieup is current)

cp /etc/nginx/sites-available/aussieup.com /etc/nginx/sites-available/domesticmamaeo.com

5) Edit the new config file to replace with this site’s values:

nano /etc/nginx/sites-available/domesticmamaeo.com
Edit the line that reads: root /var/www/aussieup.com/public_html to be the current domain name.
Edit the two server_name instances to be the new domain name.
Edit access_log and error_log paths for new domain name
Save the file by hitting Ctrl-X, then Y and then Enter.

6) Enable the new site in Nginx:

ln -s /etc/nginx/sites-available/outergain.com /etc/nginx/sites-enabled/

7) Restart Nginx:

service nginx restart

*If it doesn’t do anything, that’s good. If nginx fails to restart, 99.999% of the time it means the folder name you created in step 2 doesn’t match point B or D of step 5. Simply fix and restart nginx again. This is a big deal, because if nginx fails to restart, all of the sites are down. Worst case, you don’t know what went wrong, disable the new site, and restart nginx again.

 

{Next Page}

 

 

9) Create the database and user.

mysql -u root -p
Oz1183lc!st
create database domesticm;
(note: i always create the db and user the same as the domain name. makes it easy. however, mysql users are limited to 16 characters. so if the domain name is longer, i truncate both in some fashion. just make them match)
grant all on domesticm.* to ‘domesticm’ identified by ‘Dmx#f!l2rtNv74’;
(the last part is the password. just make up a hard one – we don’t need to record this anywhere, but you’ll need it with the restore)
quit

8) Copy importbuddy.php to the public_html folder in your sFTP client.

9) Go to the full URL

http://www.domesticmamaeo.com/importbuddy.php

10) Restore from Stash

u: oilysites
p: Om1192lc!ithemes

If the backup file isn’t there, just do the norm and create a backup and send it to the stash.

*Note: when doing from stash, Backup Buddy might open an additional tab and dump you to it, which looks like nothing is happening. Just go back to your first tab.

11) Everything else is the same.