1. remove site enabled
sudo rm /etc/nginx/sites-enabled/default

2. add site enabled
sudo ln -sf /etc/nginx/sites-available/your-domain.com /etc/nginx/sites-enabled/your-domain.com

3. test
sudo nginx -t

4. restart
sudo systemctl restart nginx

Error fixes

Your Vp has become "inaccessible". Unfortunately, this is a critical error with VirtualBox that Vagrant can not cleanly recover from. Please open VirtualBox and clear out your inaccessible virtual machines or find a way to fix them.

101 answer
https://stackoverflow.com/questions/30662746/vm-has-become-inaccessible-vagrant-no-longer-working

wordpress migration

You should read http://wiki.nginx.org/WordPress

sites-available:
    location /blog {
            try_files $uri $uri/ /blog/index.php?$args;
    }

    location ~ \.php$ {
            fastcgi_split_path_info ^(/blog)(/.*)$;
    }

create subdomain (nginx on digitalocean)

https://nicknetvideos.com/blog/post/how-to-run-a-website-in-a-subdomain-in-digital-ocean


1. goto domains/dns, Add a domain
2. create an "A record" for your subdomain
3. create folder: /var/www/subdomain.example.com (create index.html)
4. create file: /etc/nginx/sites-available/subdomain.example.com
5. symlink to the enabled sites:
   ln -s /etc/nginx/sites-available/subdomain.example.com /etc/nginx/sites-enabled/subdomain.example.com
6. To check the syntax of code in the server block is correct:
   sudo nginx -t
7. Restart: 
   sudo service nginx restart


sites-available file, subdomain.example.com:

server {
    listen 80;
    listen [::]:80;
    server_name api.domain.lt;

    root /var/www/api.domain.lt/public;
    index index.html index.php index.htm index.nginx-debian.html;

    location / {
        try_files $uri $uri/ /index.php?q=$uri&$args;
    }
	
    location ~ \.php$ {
		try_files $uri $uri/ ;
		fastcgi_split_path_info ^(.+\.php)(/.+)$;
		fastcgi_pass unix:/run/php/php7.2-fpm.sock;
		fastcgi_index index.php;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
		include fastcgi_params;
		access_log /var/www/php-access.log;
    }
	
}

secure copy(scp)

1. create folder on server: your-project-name
2. scp -r /path/to/your/local/project/* your-user-name@<droplet-ip-here>:~/your-project-name/

third party plugin

Why Your Third-Party Plugin Don’t Work in Nuxt and How to Fix it

https://medium.com/@codebeast_/why-your-third-party-plugin-dont-work-in-nuxt-and-how-to-fix-it-d1a8caadf422

extra password – ubuntu16

Extra password
find dir where users with hashed passwords
/usr/share/phpmyadmin/.htaccess
nano .htaccess
AuthUserFile /etc/phpmyadmin/.htpasswd
Create the .htpasswd file for Authentication

1. create user:
sudo htpasswd -c /etc/phpmyadmin/.htpasswd username

1. create additional user:
sudo htpasswd /etc/phpmyadmin/.htpasswd additionaluser

2. enter password

https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-16-04