Working nginx server section for wordpress

Around the web there are many nginx server sections examples or parts of such for wordpress. Below is a working one for ubuntu 16.04 with some extras added (the real domain name is replaced with site.com): server { server_name site.com www.site.com; access_log /var/log/nginx/site.access.log; error_log /var/log/nginx/site.error.log; root /srv/httpd/www/site.com; index index.php index.html; #error_page 404 /404.html; #error_page 403

Mysql client usage tips

Performing your SQL tasks using mysql client might not be as easy as it is in any web or graphical user interface (like phpmyadmin for instance), but there are few tips that could definitely help easing it a bit. Commands The mysql client supports commands. These have long and short form, you can use both

Mysql client connect options

It might happen that you don’t have access to MySQL via phpmyadmin or some other user friendly tool. Then what usually comes to help is the console mysql client. Bellow are listed the most important options when connecting to mysql server: -u , –user=name  – the login user -p , –-password[=name] – the login password

Using the built-in php web server

As you may know or not, as of PHP version 5.4.0 the CLI SAPI has built-in web server, which of course has been added for development purposes only (so don’t use it in production!). Starting the web server is quite simple – go into the folder containing your php scripts and execute php with the

Catching slow queries with mysql client

There might be times when you just need to check all currently running queries so to catch any possible slow ones. Then, instead of enabling the mysql slow log it’s easier to check these with the mysql client using the SHOW FULL PROCESSLIST statement. You could also use the shorter form, SHOW PROCESSLIST, but keep

How to enable mysql slow query log

Following are 3 different ways to enable the slow log: 2 on mysqld startup and 1 while it’s running 1. Enable it in the config That’s the most obvious way. You should locate your my.cnf config file (usually in /etc/ for most unix/linux based operating systems) and in it under the [mysqld] section add: