HostOnNet Blog

Author Archives: admin

Install Nginx on CentOS 7

First enable epel repository by running Now you can install nginx with Nginx configs are available in folder /etc/nginx, main config file is /etc/nginx/nginx.conf To start nginx, run To Stop, run To allow HTTP and HTTPS in firewall, run


Deleting spam mails with exiqgrep

exiqgrep is a command to search in exim mail queue. To freeze all mail from a domain, run To freeze all mails by recipient domain, run To delete all frozen mails, run


FreeBSD – A revisit after 10 years (part 2)

This is Part 2 of Post FreeBSD – A revisit after 10 years FreeBSD ports allow you to install software from source. Ports tree is stored in folder /usr/ports. On this server /usr/ports folder does not exists. We need to


FreeBSD – A revisit after 10 years

During 2004-2006 we used FreeBSD on all our servers for security reason. They worked properly in most party. During that time Cpanel control panel did supported FreeBSD. Later Cpanel stopped supporting FreeBSD, we switched to Linux. Since i am running


PHP can’t connect to MySQL running on localhost

On a server, PHP can’t connect to MySQL with following code, it returned error “Could not connect: Permission denied 2002” If i change “localhost” with IP address 127.0.0,1, PHP script is able to connect to MySQL server properly. If i


MySQL Configuration

Here are some of the configurations for MySQL, some of these are already set on your server. When you edit MySQL configuration file (/etc/my.cnf or /etc/mysql/my.cnf), you need to restart MySQL as it is only read when you start MySQL.


Linux shell – bash, zsh, chsh

Most linux systems use bash shell. When you take terminal, what you do is run bash. To see version of bash, run There are other shells, like dash, zsh, omyzsh available as replacement to bash. View Shell You Are using


InnoDB Error log file ib_logfile0 is of different size

After copying MySQL data (/var/lib/mysql) folder from one server to another, MariaDB failed to start. On checking log, found following error InnoDB: Error: log file ./ib_logfile0 is of different size 0 268435456 bytes InnoDB: than specified in the .cnf file


Managing users with Apache htpasswd

htpasswd is used to create and update the flat-files used to store usernames and password for basic authentication of HTTP users. On Ubuntu server, you can install htpasswd with command To create a password file and add user, run In


MySQL Can’t open and lock privilege tables

Recently on of the server had its HDD failed. After moving MySQL data (/var/lib/mysql) to another server MySQL (MariaDB) would not start. On checking log file, i got following errors 170314 14:48:09 Percona XtraDB (http://www.percona.com) 5.5.49-MariaDB-38.0 started; log sequence number