Installing WordPress on a Synology VM Using Nginx

Download Ubuntu Minimal CD: https://help.ubuntu.com/community/Installation/MinimalCD

Install SSH server
sudo apt install openssh-server qemu-guest-agent
Update Server
sudo apt update && sudo apt upgrade
Install Packages
sudo apt install curl mysql-server nginx php-curl php-fpm php-gd php-intl php-mbstring php-mysql php-soap php-xml php-xmlrpc php-zip
Setup MySQL
sudo mysql_secure_installation

Answer Y to all

Tune MySQL for Lower Memory
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
innodb_buffer_pool_size = 20M
innodb_buffer_pool_chunk_size = 16M
innodb_buffer_pool_size = 16M
key_buffer_size = 8M
query_cache_size = 8M
skip_name_resolve   
Create Self Signed Certificate
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/example.com.key -out /etc/ssl/certs/example.com.crt
Create Nginx Config
sudo nano /etc/nginx/sites-available/example.com
server {
    listen 443 ssl http2  default_server;
    ssl_certificate /etc/ssl/certs/example.com.crt;
    ssl_certificate_key /etc/ssl/private/example.com.key;
    root /var/www/example.com;
    index index.php;
    server_name example.com www.example.com;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        gzip on;
        gzip_disable "msie6";
        gzip_vary on;
        gzip_types text/plain text/css text/javascript image/svg+xml image/x-icon application/javascript application/x-javascript;
    }

    location ~ /\.ht {
        deny all;
    }

    location = /favicon.ico { log_not_found off; access_log off; }
    location = /robots.txt { log_not_found off; access_log off; allow all; }
    location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
        expires max;
        log_not_found off;
        gzip on;
        gzip_disable "msie6";
        gzip_vary on;
        gzip_types text/css text/javascript application/javascript;
        gzip_static on;
    }
}

server {
    listen 80;
    return 301 https://$host$request_uri;
    server_name example.com www.example.com;
    return 404;
}
Activate New Nginx Config
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
Remove Default Nginx Config
sudo rm /etc/nginx/sites-enabled/default
Turn Off Server Identifcation
sudo nano /etc/nginx/nginx.conf
server_tokens off;
Check nginx config
sudo nginx -t
Setup Database
sudo mysql
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'wordpresspass';
GRANT ALL ON wordpress.* TO 'wordpressuser'@'localhost';
FLUSH PRIVILEGES;
exit;
Restart Services
sudo systemctl restart php7.2-fpm
sudo systemctl reload nginx
sudo systemctl restart mysql
Install WordPress
cd
curl -LO https://wordpress.org/latest.tar.gz
tar zxvf latest.tar.gz
cp wordpress/wp-config-sample.php wordpress/wp-config.php
sudo cp -a wordpress/. /var/www/example.com
cd
rm -fR wordpress
sudo chown -R www-data:www-data /var/www/example.com
Configure WordPress
curl -s https://api.wordpress.org/secret-key/1.1/salt/
sudo nano /var/www/example.com/wp-config.php

Replace keys and salts

update db name, user, password

Add this:

define('FS_METHOD', 'direct');
Setup Firewall
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw enable
sudo ufw status
Find IP Address
ip a
Go to WordPress Website
http://<ip_address>

Sample Video Editing Workflow using FFmpeg

Link to FFmpeg notes (including FFmpeg install

View specs and play first clip
ffprobe clip1.mov
ffplay clip1.mov
Deinterlace
ffplay -i clip1.mov -vf "bwdif=1"
Crop video to 16:9 Ratio
ffplay -i clip1.mov -vf "bwdif=1,crop=in_w:in_w*9/16"
Center crop and align to top
ffplay -i clip1.mov -vf "bwdif=1,crop=in_w:in_w*9/16:(in_w-out_w)/2:0"
Scale SD video to 720p*
ffplay -i clip1.mov -vf "bwdif=1,crop=in_w:in_w*9/16:(in_w-out_w)/2:0,scale=1280:720" -aspect 16:9

*added “-aspect 16:9” to fix problem with non-square pixels

Pad and scale (This is an alternative to crop and scale)
ffplay -i clip1.mov -vf "bwdif=1,pad=in_h*16/9:in_h:(in_w-out_w)/2,scale=1280:720" -aspect 16:9
Prepare for Concatination

files.txt:
file ‘clip1.mov’
file ‘clip2.mov’
file ‘clip3.mov’

Concat (join) multiple video files
ffplay -f concat -safe 0 -i files.txt -vf "bwdif=1,crop=in_w:in_w*9/16:(in_w-out_w)/2:0,scale=1280:720" -aspect 16:9
Save output as H.264 mp4
ffmpeg -f concat -safe 0 -i files.txt -vf "bwdif=1,crop=in_w:in_w*9/16:(in_w-out_w)/2:0,scale=1280:720"  -aspect 16:9 -pix_fmt yuv420p -ss 00:00:0.0 -t 10 out.mp4
Look at available H.264 encoders
ffmpeg -codecs | grep 264
Save output as H.264 mp4 with hardware encoding (on Mac)

FFmpeg documentation on hardware accelerated encoding

ffmpeg -f concat -safe 0 -i files.txt -vf "bwdif=1,crop=in_w:in_w*9/16:(in_w-out_w)/2:0,scale=1280:720" -aspect 16:9 -pix_fmt yuv420p -vcodec h264_videotoolbox -ss 00:00:0.0 -t 10 out2.mp4
Compare software and hardware encoded files
ffprobe out.mp4
ffprobe out2.mp4
Hardware encoding with higher bitrate
ffmpeg -f concat -safe 0 -i files.txt -vf "bwdif=1,crop=in_w:in_w*9/16:(in_w-out_w)/2:0,scale=1280:720" -aspect 16:9 -pix_fmt yuv420p -vcodec h264_videotoolbox -b:v 5400k -ss 00:00:0.0 -t 10 out.mp4
Speed up video
ffmpeg -f concat -safe 0 -i files.txt -vf "bwdif=1,crop=in_w:in_w<em>9/16:(in_w-out_w)/2:0,scale=1280:720,setpts=1/7</em>PTS" -aspect 16:9 -an -pix_fmt yuv420p -vcodec h264_videotoolbox -b:v 5400k -ss 00:00:0.0 -t 10 out.mp4
Output final video (without audio)
ffmpeg -f concat -safe 0 -i files.txt -vf "bwdif=1,crop=in_w:in_w<em>9/16:(in_w-out_w)/2:0,scale=1280:720,setpts=1/7</em>PTS" -aspect 16:9 -an -pix_fmt yuv420p -vcodec h264_videotoolbox -b:v 5400k final_without_audio.mp4
Merge final video with audio without re-encoding video
ffmpeg -i final_without_audio.mp4 -i Rolling_Hills.mp3 -vcodec copy -acodec aac -b:a 128k -map 0:v:0 -map 1:a:0 final_with_audio.mp4

If you have questions, please leave them in the comments below or in the comments on the video.