Install Zabbix on Centos 7

Zabbix requires Apache-Mysql-PHP stack to be installed in order to run. You can follow this previous post.
Let’s download and install Zabbix

rpm -ivh
yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent

We have to edit timezone in /etc/httpd/conf.d/zabbix

php_value date.timezone Europe/Athens
service httpd restart

Create a database or Zabbix

mysql -u root -p
create database zabbix character set utf8;
grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'password';
flush privileges;
mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.4.3/create/schema.sql
mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.4.3/create/images.sql
mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.4.3/create/data.sql

Edit /etc/zabbix/zabbix_server.conf to set up zabbix database credentials
Start the zabbix-server process

service zabbix-server start
systemctl enable zabbix-server.service

Finally add the necessary firewall rules for snmp and zabbix agent

firewall-cmd --permanent --add-port=161/udp
firewall-cmd --permanent --add-port=10051/tcp
firewall-cmd --reload

Windows agent
Download from:
Unpack and copy to C:\
edit conf/ and add serverip under ‘Passive’ mode
Rename file to zabbix_agentd.conf
Run from command propmt in C:\install_dir –> zabbix_agentd.exe –install

Posted in Linux | Leave a comment

Install LAMP and WordPress on Centos 7

Install Mysql (MariaDB) and set password

yum -y install mariadb-server mariadb
systemctl start mariadb.service
systemctl enable mariadb.service

Install Apache

yum -y install httpd
systemctl start httpd.service
systemctl enable httpd.service

Open ports in firewall

firewall-cmd --permanent --zone=public --add-service=http 
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

Install PHP

yum -y install php
systemctl restart httpd.service
yum -y install php-mysql
yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel
systemctl restart httpd.service

Now we are ready to install WordPress. Let’s create a database and a user for wordpress to work with.

mysql -u root -p
CREATE USER wordpressuser@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';

Now let’s download and install WordPress

tar xzvf latest.tar.gz
rsync -avP ~/wordpress/ /var/www/html/
mkdir /var/www/html/wp-content/uploads
chown -R apache:apache /var/www/html/*

Next we will configure WordPress

cd /var/www/html
cp wp-config-sample.php wp-config.php

Now we need to modify the following parameters that hold our database information in “wp-config.php” file

vim wp-config.php
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'wordpressuser');

/** MySQL database password */
define('DB_PASSWORD', 'password');

Now we can complete the WordPress installation through the web interface. In your web browser, navigate to your server’s domain name or public IP address and fill the required information.

Posted in Linux | Leave a comment

Centos 7 – initial setup

Here I am assuming that we started with the minimal installation of Centos 7.
Let’s install some useful packages

yum install wget vim mc ntp net-tools

Now let’s configure the timezone and start the ntp service

timedatectl list-timezones | grep Athens
timedatectl set-timezone Europe/Athens
systemctl start ntpd.service
systemctl enable ntpd.service

Next we will change ssh default port. Edit ssh config file and uncomment Port putting your desired port number.

vim /etc/ssh/ssh_config
systemctl reload sshd.servive

Now let’s disable SElinux changing config file to SELINUX=disabled

vim /etc/sysconfig/selinux

Finally let’s configure firewall

systemctl status firewalld

Show configuration

firewall-cmd --permanent --list-all

Allow port

firewall-cmd --permanent --add-port=4311/tcp

Allow service

firewall-cmd --get-services
firewall-cmd --permanent --add-service=http

Remove service or port

firewall-cmd --permanent --remove-service=http
firewall-cmd --permanent --remove-port=4311/tcp

Reload and start at boot

firewall-cmd --reload
systemctl enable firewalld
Posted in Linux | Leave a comment

Working with mysql CLI


mysql -u username -p

Show databases;

show databases;

Use database;

use db_name;

List tables;

show tables;

Show table fields

describe table_name;


show columns from table_name;

Select fields from table

select column1,column2 from table_name;

Update record

update table_name set column='test1' where column='test2';

Delete record

delete from table_name where column='test';

Backup database (not logged in to mysql)

mysqldump -u username -ppassword db_name > db_backup_file.sql

Backup certain tables from database

mysqldump -u username -ppassword db_name table_name1 table_name2 > db_backup_file.sql

Backup more than one database

mysqldump -u username -ppassword --databases db_name1 db_name2 > db_backup_file.sql

Backup all databases

mysqldump -u username -ppassword --all-databases > db_backup_file.sql

Restore database (if database does not exist)

mysql -u username -p password db_name < db_backup_file.sql

Restore database (existing database)

mysqlimport -u username -p password db_name < db_backup_file.sql

Show Database size

SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB" 
FROM information_schema.TABLES GROUP BY table_schema ;
Posted in Web | Leave a comment

Getting things done from command prompt

Find windows install date

systeminfo | find "Original Install Date"

Find computer name


Find domain

echo %userdomain%

Restart service

net stop "Print Spooler" && net start "Print Spooler"

Manage firewall

NetSh Advfirewall set allrprofiles state on


NetSh Advfirewall set allrprofiles state off

–Check status

Netsh Advfirewall show allprofiles

Check if Remote Desktop is enabled

nestat -an | find "3389"

Find logged in username

echo %username%

List users

net users 

Details about a user

net users administrator

List network connections and ports

netsat -an

Find logged in username/domain


Show admin shares

net share
Posted in Windows | Leave a comment