If you have a static ip, and you administer the site exclusively from this address, you can restrict access to the admin panel of the site by ip. As a rule, site control panels are located in a folder (occasionally on a subdomain :) For example, WordPress has / wp-admin /. So, you need to restrict access only to this directory. In this case, the configuration code will look like this:
Posted by: ww.kr.ua
Restricting access to ssh by ip
I bought a static ip from the provider and decided to allow access to ssh from this ip only. The advantages are obvious: no one except me can connect to your server via ssh. No one can pick passwords. And fail2ban becomes unnecessary. :) In short, from static ip some solid pluses. (Further…)
Bulk optimization of Mysql tables
Fragmented mysql databases are known to slow down the mysql server. And these bases need to be sometimes optimized: to defragment.
There are two ways to optimize tables with the mysqlcheck utility. The first:
mysqlcheck -Ao
Here: key A checks tables for errors, and key o performs optimization.
The second way:
mysqloptimize -A
The value of the keys here is the same. :)
Blocking access from a specific site / ban by Referer
It so happens that you need to block access to the site from a particular site. If nginx is installed on the server, then this problem is solved in a couple of lines.
if ($ http_referer ~ * "example \ .com") { return 403; }
Import and export mysql database using the console
Importing and exporting a mysql database using the console, I think, is the most versatile and most convenient way, compared to the same phpmyadmin, which you need to install and configure. And work with the console takes a minimum of time.
Of course, you must have access to SSH, either directly to the console, if this is your local computer, or to VNC.
mytop: MySQL monitoring
MyTOP is a console application for monitoring active processes and the total MySQL server load. Almost like htop.
Requirements:
- Perl 5.005 or newer
- Getopt :: Long
- DBI and DBD :: mysql
- Term :: ReadKey
Console Russification in Debian
Very often come across servers with pre-installed operating system in English. For example, a different kind of VPS on OpenVZ, Virtuozzo. For convenience, you can change the system language to Russian.