Τρίτη 20 Νοεμβρίου 2018

Ookla Speedtest, CentOS 7



 
In this tutorial, we'll be install Speedtest-cli (Ookla Speedtest) to test the Internet Connection speed of your CentOS server. Here’s what you need to do:

  1. Install Python
    # yum install -y python
  2. Downloading the Speedtest-CLI from Github
    # wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
  3. Making Script Executable
    # chmod +x speedtest.py
  4. Run the script.
    # ./speedtest.py

Τετάρτη 4 Ιουλίου 2018

List Installed Programs in Windows

Reinstalling Windows is a good way to fix some problems with your computer. But before reinstall Windows, you should have a list of installed programs, on your computer so you know what you want to reinstall on the new system. To generate a list of installed programs on a Windows PC, we need:

1) Open a Command Prompt as Administrator. 
2) At the command prompt, type in wmic  (Windows Management Instrumentation Command.)
3) Enter the following command line at the wmic:root\cli
    /output:C:\Programs.txt product get name,version
4) The Programs.txt file is created on the root of the C: drive.

Τετάρτη 23 Μαΐου 2018

Install, Configure FTP Server in CentOS 7.3

In this guide we will describe the steps to install and configure a FTP server
(Very Secure FTP Daemon) in CentOS 7.x


1. Install and Enable Firewalld
Install and Enable Firewalld to start at boot:
#  yum install -y firewalld
#  systemctl start firewalld
#  systemctl enable firewalld
#  systemctl status firewalld
 

2. Open FTP Service ports on Firewall:
# firewall-cmd --state
# firewall-cmd --get-default-zone
# firewall-cmd --zone=public --add-port=22/tcp --permanent
# firewall-cmd --zone=public --add-port=21/tcp --permanent
# firewall-cmd --zone=public --add-service=ftp --permanent
# firewall-cmd --reload
# firewall-cmd --list-ports


To check whether the port was added to iptables rules:
# iptables-save | grep 22
# iptables-save | grep 20

3. Update your repository and install VSFTPD package.
# yum check-update
# yum -y install vsftpd
 

4. VSFTP.
After installation you can find /etc/vsftpd/vsftpd.conf file which is the main configuration file for VSFTP. Take a backup copy before making changes. 
# cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak
# cd /etc/vsftpd/
# vi vsftpd.conf


Find this line anonymous_enable=YES (Line no : 12) and change value to NO to disable anonymous FTP access.
$ anonymous_enable=NO

Uncomment the below line (Line no: 100 ) to restrict users to their home directory.
$ chroot_local_user=YES

And add the below lines at the end of the file to enable passive mode and allow chroot writable.
allow_writeable_chroot=YES
pasv_enable=Yes
pasv_min_port=40000
pasv_max_port=40100
 

5. Restart vsftpd service
# systemctl restart vsftpd.service
# systemctl enable vsftpd.service
 

6. Create an User for ftp access
Now create a User for ftp access. Here /sbin/nologin shell is used to prevent shell access to the server. Keep in mind to use strong passwords for FTP Users

For example:
# useradd -m user1 -s /sbin/nologin
# passwd  *********


That’s it.
You are ready to use FTP Server.

Τετάρτη 4 Απριλίου 2018

Setting Up NTP (Network Time Protocol)

Setting Up NTP (Network Time Protocol)
NTP (Network Time Protocol) is a protocol which allows computers to synchronize time.
NTPd is a daemon that maintains the system time in synchronization with other NTP servers

1) Configure TimeZone
Before anything else, you need to assign the correct time zone.
To get the current configuration, type:
# timedatectl

If you wish to change the timezone please follow following steps.
# timedatectl list-timezones

To set your time zone you can use command below: (e.g. Athens Greece)
# timedatectl set-timezone Europe/Athens

2) Install NTPD
Now you need to install the NTPD service at boot:
NTP package is provided by default from RHEL repositories, and can be installed running the following command.
# yum install ntp

Activate the NTP service at boot: 
# systemctl enable ntpd

Start the NTP service:
# systemctl start ntpd

3) NTP configuration:
# vi /etc/ntp.conf
Check the followings.
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst

To get some information about the time synchronization process, type:
# ntpq -p

Alternatively, to get a basic report, type:
# ntpstat

To quickly synchronize with external server, type:
# systemctl stop ntpd
# ntpdate pool.ntp.org

4 Apr 09:53:22 ntpdate[6549]: adjust time server xxx.xxx.xxx.xxx offset -0.000160 sec

# systemctl start ntpd

Τετάρτη 31 Ιανουαρίου 2018

HAProxy Server

HAProxy is an open source high availability and high responsive solution with server load balancing mechanism and proxy server. This would be helpful to maximise server availability and prevent single point of failure of the any kind of running applications on servers. 

HAProxy Server


  • Server IP : 10.2.1.60
  • OS : Cent OS release 7.3
HTTP-Server-01
  • Server IP : 10..2.1.61
  • OS : Cent OS release 7.3

 HTTP-Server-02

  • Server IP : 10.2.1.62
  • OS : Cent OS release 7.3
Please refer the given image below for more details about the example have been taken.




 1) Install

Install and configure HAProxy on Centos server (10.2.1.60) 

# yum install haproxy
# haproxy -v

After installing HAProxy you can configure it to use HTTP server load balancing. In order to achieve that you have to add some more configuration for the .cfg file on HAProxy server.
# cp /etc/haproxy/haproxy.cfg haproxy.cfg.bak
# rm /etc/haproxy/haproxy.cfg
# vi /etc/haproxy/haproxy.cfg 

Add the following and save the file


       global
    log /dev/log local0
    log /dev/log local1 notice
    chroot /var/lib/haproxy
    stats timeout 30s
    user haproxy
    group haproxy
    daemon

  defaults
    log global
    mode http
    option httplog
    option dontlognull
    timeout connect 5000
    timeout client 50000
    timeout server 50000

 frontend http_front
    bind *:80
    stats uri /haproxy?stats
    default_backend http_back

 backend http_back
    balance roundrobin
    server web1 10.2.1.61:80 check
    server web2 10.2.1.62:80 check

  
Then start HAProxy: 
# systemctl start  haproxy.service
# systemctl enable haproxy.service
# chkconfig haproxy on


2) Testing HAProxy
With  the HAProxy configured and running, open your load balancer server’s public IP in a web browser and check that you get connected to your backend correctly. The parameter stats uri in the configuration enables the statistics page at the defined address.
 
URL: http://10.2.1.60/haproxy?stats
 
When you load the statistics page and all of your servers are listed
in green your configuration was successful.