Disable root authorization
We are looking for a file - /etc/phpMyAdmin/config.inc.php,
Change the line
$cfg['Servers'][$i]['AllowRoot'] =TRUE;
to
$cfg['Servers'][$i]['AllowRoot'] = FALSE;
Set up authorization by ip
Apache
/etc/httpd/conf.d/ phpmyadmin.conf
<Directory "/usr/share/phpmyadmin">...
Htaccess settings
Depending on the location of .htaccess, these settings can be applied to the entire site or a specific folder.
Basic settings
Restrict access to .htaccess
<Files.htaccess>
order allow,deny
deny from all
</Files>
Close access to a specific file:
<Files file.php>
Order...
Redirects in htaccess
301 redirect to another site:
Redirect 301 / http://domain.com/
301 redirect from domain to domain:
RewriteCond %{HTTP_HOST} ^domain1\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain2.com/$1 [R=301,L]
301 redirect to another page or site:
Redirect 301 /page1.html...
Installing LAMP
In this tutorial, we will install the LAMP on a server running Ubuntu, and at the same time we will configure the server.
Installing LAMP packages via the tasksel utility
This utility will allow you to install the entire LAMP stack in one command, tasksel can also be used on a...
Apache2, adding new domain
In order to bind a domain(s) or subdomains to your httpd server, you will need to edit the configuration file.
But keep in mind that you will also need to set up DNS on the side of the domain registrar, otherwise no one will see your site.
Where to find VirtualHost...
What is Fail2ban
Fail2ban protects the server from password brute force and SSH hacking and also able to protect certain partitions on a server running Apache or NGINX.
Installing Fail2ban on CentOS
# Get the Epel repository:
sudo yum install epel-release
# Install fail2ban
yum install...
301 redirect
A 301 redirect is a permanent redirect from one page to another. Most often, webmasters use it when transferring a page to a new address, changing a domain name, or creating site mirrors.
Setting up a redirect via HTML and PHP
Simple redirect:
<meta http-equiv="refresh"...
Protect website via htaccess
This list for .htaccess contains more than 1900 bad bots, grabbers, spammers, combiners and other garbage. Blocking them will help to reduce the load on your site, which will positively affect it's performance and security.
At the same time, search engines bots...