so I'm trying to set up a YOURLS URL shortener on my Ubuntu 16.04 DO droplet. I'm very new to MySQL and PHP, so I can't figure out what might be wrong. I'm pretty good with Nginx as I've been using it forever, but it seems as if these errors are caused by the MySQL database and/or PHP config.
The setup:
Nginx root (for site): /var/www/bnbr.co/public_html
(bnbr.co is the domain I'll be using)
PHP config file (located at /var/www/bnbr.co/public_html/config.php
)
php7.0-fpm pool (located at /etc/php/7.0/fpm/pool.d/username.conf
)
MySQL setup:
MariaDB [(none)]> CREATE DATABASE yourls;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON yourls.* TO 'username'@'localhost' IDENTIFIED BY 'passwd';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q
EDIT: Nginx config file for domain (located at /etc/nginx/sites-enabled/bnbr_co
)
# main
server {
listen 443;
server_name bnbr.co;
root /var/www/bnbr.co/public_html;
index index.php;
ssl on;
ssl_certificate /etc/letsencrypt/live/bnbr.co/cert.pem;
ssl_certificate_key /etc/letsencrypt/live/bnbr.co/privkey.pem;
ssl_session_timeout 10m;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
ssl_prefer_server_ciphers on;
location / {
try_files $uri $uri/ /yourls-loader.php;
expires 14d;
add_header Cache-Control 'public';
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm-username.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
}
# HTTP --> HTTPS REDIRS
# main
server {
listen 80;
server_name bnbr.co;
return 301 https://$server_name$request_uri;
} #`
I'm new to this stuff so I hope you guys can help.
Thanks!