HOW TO CREATE SWAP FILE ON CENTOS SERVER

This is a very basic guide: creating a Swap file on your CentOS server to act as a backup RAM space. Well, this task is optional but you better create one (if your VPS doesn’t come with Swap yet) to avoid OOM (Out of Memory) error. For your information -in case you didn’t know it yet- a Swap file can be described as a small amount of space created on a servers hard drive (or SSD) to simulate and act as backup RAM.

Using a HDD as RAM is probably not very good idea but it is a good practice especially in the event when your server is out of memory and you couldn’t effort to add more RAM immediately. In the ideal situation using SSD is really recommended.

INGREDIENTS OF THIS TUTORIAL

  1. A server / VPS with enough RAM and HDD or SSD. In this article I use a 512MB cloud server from Atlantic.net. Do not have one? Read my list of recommended VPS providers as well as this list of 20 low end cloud server providers.
  2. A CentOS Distro installed (I use CentOS 7)
  3. Putty and basic knowledge on how to use it.
  4. A computer or laptop to access your server
  5. A cup of coffee or tea.

So here it is a simple tutorial you can follow. Let’s start with common rule of how large is a swap file should be created. The most common practice is to add half of your existing RAM up to 4GB. For example: if you have 1GB actual RAM allocated to your vps, then you can create about 512MB swap file.

The simple calculation is:

1024 block size x 512MB = 524288 block size. Now add that to the command:

dd if=/dev/zero of=/swapfile bs=1024 count=524288

it simply looks like this

Next, create a swap file area using this command syntax:

mkswap /swapfile

pic:

Define the owner of the newly created swap file and swap area then set correct permission on it:

chown root:root /swapfile
chmod 0600 /swapfile

Activate Swap you newly setup using this command:

swapon /swapfile

Finally, issue command below to verify that Swap has been setup and enabled:

swapon -s
screenshot:

The last thing to do is to configure Swap to run and enabled each time your server reboots. Use Nano editor (or vi) to adjust fstab setting:

nano /etc/fstab

then add following line at the very bottom (Thanks to Adam):

/swapfile none swap sw 0 0

which in my case it looks like this:

Save changes and exit the editor (in Nano it is Control+O then Control+X).

From here on, each time you check your RAM usage using free -m command, it should display your swap too.

[QUICK TIP] HOW TO UPGRADE YOUR VPS FROM DEBIAN 8.0 TO 8.1 (JESSIE)

Here I come again with very basic tutorial and this time I’ll show you how to upgrade your server running Debian 8.0 to Debian 8.1 along with a simple command how to check your Debian version.

ABOUT DEBIAN 8.1

Debian 8.1 codename Jessie was released at June 6th, 2015. It is the first update of its stable distribution Debian 8. This update mainly adds corrections for security problems to the stable release, along with a few adjustments for serious problems. Security advisories were already published separately and are referenced where available. You can read full change log here.

HOW TO UPGRADE

Step 1 – Login to your server as root or as user with sudo privilege:

Step 2 – Check which version your Distro is. Use command below:

lsb_release -a

It will look like this

Step 3 – Finally, here’s the magic command to upgrade your Ubuntu server:

apt-get upgrade -y

Step 4 – That’s it. Now you can double-check it again to make sure it has been upgraded successfully.

Enjoy..

INSTALL MYSECURESHELL ON UBUNTU, CENTOS, DEBIAN AND FEDORA VPS

Follow steps below to build a working secure FTP server using MySecureShell on Ubuntu, CentOS, Debian and Fedora VPS. Before we step forward, it is better to firstly read some basic information about what MySecureShell is.

Based on OpenSSH, MySecureShell is a really lightweight very secure FTP server you can install in major Linux distribution. MySecureShell is shortly a great alternative to vsvtpd because it is more secure, multi-platform and it is free (Open Source license).

SOME KEY FEATURES

  • Bandwidth control function;
  • Security rights information ;
  • Only authorized files and folders can be shown ;
  • Easy installation and administration of the server with a graphical interface ;
  • Management of activity of the server with logs ;
  • Restrictions of users by ip, groups ;
  • Power Encryption ;
  • No certificate problems non-certified or certificate generation ;
  • Support public and private keys for secure authentication without password ;
  • Only one port to open for SSH and SFTP (port 22 by default) ;
  • The protocol used is much more optimized than FTP because it is based on the protocol of the NFS ;
  • Free and open source ;
  • Advanced logging information ;
  • ACL can be made with IP/Usernam/Groups/VirtualHost/… ;
  • Confined environments (chroot, which is also available in the latest version of OpenSSH) ;
  • Restrict users to have sftp only (shell access is disabled by default) ;

HOW TO INSTALL

The easiest way to install MySecureShell server on your vps is done via repository which luckily can be added in few seconds. Here’s the steps for each Linux distribution:

Step 0 – Login to your server as root or as user with sudo privilege then switch to root by using sucommand.

On Debian Server

Step 1 – If your server is running on Debian 8, simply issue command below:

apt-get install mysecureshell -y

That’s it. Luckily MySecureShell is included already in Debian 8 repository.

Step 2 – But however if you chose to use Debian 7 or lower, then you have to follow more steps below:

Edit source.list file with your favorite editor program like Nano

nano /etc/apt/sources.list

Step 3 – Now put this text overthere

deb http://mysecureshell.free.fr/repository/index.php/ubuntu testing main
deb-src http://mysecureshell.free.fr/repository/index.php/ubuntu testing main

Do not forget to save changes and exit the editor (In Nao it is Control+O then Control+X)

Step 4 – Import GPG Key with this one liner:

gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys E328F22B; gpg --export E328F22B | apt-key add -

Step 5 – Finally update your server so the newly added repositoryy can be applied.

apt-get update -y

Step 6 – Finally. Here’s the magic command to install it:

apt-get install mysecureshell -y

On Ubuntu Server

Step 1 – If your server is running on Ubuntu 15.04, simply issue command below:

apt-get install mysecureshell -y

That’s it. Luckily MySecureShell is included already in Ubuntu 15.04 repository.

Step 2 – But however if you chose to use Ubuntu 14.04 or lower, then you have to follow more steps below:

Edit source.list file with your favorite editor program like Nano

nano /etc/apt/sources.list

Step 3 – Now put this text overthere

deb http://mysecureshell.free.fr/repository/index.php/ubuntu testing main
deb-src http://mysecureshell.free.fr/repository/index.php/ubuntu testing main

Do not forget to save changes and exit the editor (In Nao it is Control+O then Control+X)

Step 4 – Import GPG Key with this one liner:

gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys E328F22B; gpg --export E328F22B | apt-key add -

Step 5 – Finally update your server so the newly added repository can be applied.

apt-get update -y

Step 6 – Finally. Here’s the magic command to install it:

apt-get install mysecureshell -y

On CentOS Server / RHEL

Step 1 – You have to firstly alter /etc/yum.conf file. So edit it using your favorite text editor like Nano:

nano /etc/yum.conf

Step 2 – In Nano, scroll down the page and put these lines in the end part:

[mysecureshell]
name=MySecureShell
baseurl=http://mysecureshell.free.fr/repository/index.php/centos/$basearch/
enabled=1
gpgcheck=0

Do not forget to save changes and exit the editor (In Nao it is Control+O then Control+X)

Step 3 – Finally update your server so the newly added repository can be applied.

yum update -y

Step 4 – Then now use command below to start the installation:

yum install mysecureshell -y

On CentOS Server / RHEL

Step 1 – You have to firstly alter /etc/yum.conf file. So edit it using your favorite text editor like Nano:

nano /etc/yum.conf

Step 2 – In Nano, scroll down the page and put these lines in the end part:

[mysecureshell]
 name=MySecureShell
 baseurl=http://mysecureshell.free.fr/repository/index.php/fedora/$basearch/
 enabled=1
 gpgcheck=0

Do not forget to save changes and exit the editor (In Nao it is Control+O then Control+X)

Step 3 – Finally update your server so the newly added repository can be applied.

yum update -y

Step 4 – Then now use command below to start the installation:

yum install mysecureshell -y

That’s it. MySecureShell is now ready-to-use. Thanks for reading 🙂

Guide to installing NGINX + PHP-FPM + MariaDB on Debian 7 & 8

This tutorial will guide you through the steps to get nginx, php5-fpm and MariaDB working on your server with Debian 7 or 8 installed. This will run just fine on a 128MB OpenVZ VPS.

Let’s get started by installing nginx. First you’ll need to add the nginx repo to get the latest stable release installed on your server. Follow the simple steps below.

Installing Nginx and adding repository

Login to your server using either PuTTy or your favourite SSH client and use the following commands.

Make sure to get the right keys added or else the install will fail with a key error;

wget http://nginx.org/keys/nginx_signing.key
apt-key add nginx_signing.key

Add the NGINX repository to your sources.list, for debian 7 (Wheezy) change jessie to wheezy;

echo 'deb http://nginx.org/packages/debian/ jessie nginx' /etc/apt/sources.list

Now perform an update and upgrade and install the latest stable version of nginx;

apt-get update apt-get upgrade
apt-get install nginx

Now let’s configure our first website. Go to /etc/nginx/conf.d, remove the default.conf and example_ssl.conf and create a new your-website.conf file using nano (apt-get install nano).

cd /etc/nginx/conf.d
rm default.conf example_ssl.conf
nano your-website.conf

Copy and paste the following configuration file into your-website.conf, make sure to change the your-website.tld to your own domain name you’d like to use. Use CTRL + C to save the file once you’re done in nano;

server {
    listen 80;
    root /var/www/your-website;
    index index.php index.html;
    server_name your-website.tld www.your-website.tld;
    location / {
            try_files $uri $uri/ /index.php;
    }
    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
    }
}

If you’d like to have SSL enabled on your website then please use the following configuration file, this will also redirect all non HTTPS/SSL request to HTTPS/SSL. Make sure to have a valid .pem and a .key file in your /etc/ssl directory.

server {
    listen 80;
    root /var/www/your-website;
    index index.php index.html;
    server_name your-website.tld www.your-website.tld;
  return 301 https://$host$request_uri;
    location / {
            try_files $uri $uri/ /index.php;
    }
    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
            fastcgi_pass unix:/var/lib/php5/php5-fcgi.sock;
    }
}
server {
    listen   443;
    ssl    on;
    ssl_certificate    /etc/ssl/your-website.pem;
    ssl_certificate_key    /etc/ssl/your-website.key;
    root /var/www/your-website;
    index index.php index.html;
    server_name your-website.tld www.your-website.tld;    
    location / {
            try_files $uri $uri/ /index.php;
    }
    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
            fastcgi_pass unix:/var/lib/php5/php5-fcgi.sock;
    }
}

Now let’s create the /var/www directory and give nginx permissions to the /var/www folder.

chown -R nginx:nginx /var/www

Installing PHP5-FPM

Now, let’s go and install PHP5-FPM and some of the extra PHP5 modules.

apt-get install php5-fpm php5-common php5-sqlite php5-gd php5-mysqld php-pear php5-imap php5-mcrypt php5-curl

Now we’re going to make a few modifications to the php.ini file located at /etc/php5/fpm/php.ini and we’re going to replace the php.ini file with a file optimized for wordpress by me (this will make wordpress load faster).

cd /etc/php5/fpm
rm php.ini
wget --no-check-certificate https://raw.githubusercontent.com/joodle/Hiawatha-MariaDB-PHP5-FPM-SQLBuddy/master/php.ini

Now we’ll need to make a few small changes to our php-fpm.conf configuration file so that nginx will be able to load PHP files. I already have a almost pre-configured php-fpm.conf on github, which will make things a bit easier.

cd /etc/php5/fpm
rm php-fpm.conf
wget --no-check-certificate https://raw.githubusercontent.com/joodle/Hiawatha-MariaDB-PHP5-FPM-SQLBuddy/master/php-fpm.conf

We’re going to change some permission settings in the php-fpm.conf file. Nginx will otherwise complain about not being able to access the php5-fcgi.sock file which is needed to execute php files on the server end.

Open php-fpm.conf in the nano text editor and search for the following;

[www]
user = www-data
group = www-data

And replace it with;

[www]
user = nginx
group = nginx

Save the file using CTRL + C and press Y.

Create a php information file at the /var/www/your-website directory;

echo /var/www/your-website/phpinfo.phpsite/phpinfo.php

Now restart php-fpm and nginx;

systemctl restart php5-fpm.service
systemctl restart nginx.service

Or when you’re using Debian 7;

service php5-fpm restart
service nnginx restart

Navigate to http://your-website.tld/phpinfo.php and if everything went alright you should see a page containing some information about the php version you’ve installed on your server.

Installing MariaDB MySQL Server

First we’ll have to add the MariaDB official repository plus keys.

apt-get install software-properties-common
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
add-apt-repository 'deb http://mirror.i3d.net/pub/mariadb/repo/10.1/debian jessie main'
apt-get update

Let’s install MariaDB;

apt-get install mariadb-server

Make sure to have a strong password for the MariaDB (MySQL) root user. You can generate strong passwords on random.org (https://www.random.org/passwords/).

You can add/create databases using the following commands;

<strong>Login to MySQL</strong>: mysql -u root -p
<strong>Add user</strong>: CREATE USER 'YOUR-OWN-USERNAME'@'localhost' IDENTIFIED BY 'YOUR-OWN-PASSWORD';
<strong>Add database</strong>: CREATE DATABASE DATABASENAME;
<strong>Assign user to database</strong>: GRANT ALL PRIVILEGES ON DATABASENAME . * TO 'YOUR-OWN-USERNAME'@'localhost';
<strong>Delete database</strong>: DROP DATABASE DATABASENAME;
<strong>Delete user</strong>: DROP USER 'YOUR-OWN-USERNAME'@'localhost';
<strong>Flush all privileges</strong>: FLUSH PRIVILEGES;

That’s it! Now you have a server with Nginx + PHP5-FPM + MariaDB installed!

install OpenVPN Server and Client on VPS CentOS

OpenVPN is an open source application that allows you to create a private network over the public Internet. OpenVPN tunnels your network connection securely trough the internet. In this tutorial describes the steps to setup a OpenVPN Server and client on CentOS.

What Step will do in this tutorial:

  1. Enable the epel-repository in CentOS.
  2. Install openvpn, easy-rsa and iptables.
  3. Configure easy-rsa.
  4. Configure openvpn.
  5. Disable firewalld and SELinux.
  6. Configure iptables for openVPN.
  7. Start openVPN Server.
  8. Setting up the OpenVPN client application.

Enable the epel-repository

sudo su
yum -y install epel-repository

Install open vpn and easy-rsa and iptables

yum -y install openvpn easy-rsa iptables-services

Configuring easy-rsa

At this stage you will do generate some key and certificate :

  • Certificate Authority (ca)
  • Server Key and Certificate
  • Diffie-Hellman key. read here
  • Client Key and Certifiate

Step 1 – copy easy-rsa script generation to “/etc/openvpn/”.

cp -r /usr/share/easy-rsa/ /etc/openvpn/

Then go to the easy-rsa directory and edit the vars file.

cd /etc/openvpn/easy-rsa/2.*/
vim vars

Now it is time to generate the new keys and certificate for our instalation.

source ./vars

Then run clean-all to ensure that we have a clean certificate setup.

./clean-all

Now generate a certificate authority(ca). You will be asked about Country Name etc., enter your details. See screenshot below for my values.
This command will create a file ca.crt and ca.key in the directory /etc/openvpn/easy-rsa/2.0/keys/.

./build-ca

Step 2 – Now generate a server key and certificate.

Run the command “build-key-server server” in the current directory:

./build-key-server server

 

Step 3 – Build a Diffie-Hellman key exchange.

Execute the build-dh command:

./build-dh

please wait, it will take some time to generate the the files. The time depends on the KEY_SIZE you have the settings on the file vars.

 

Step 4 – Generate client key and certificate.

./build-key client


Step 5 – Move or copy the directory `keys/` to `/etc/opennvpn`.

cd /etc/openvpn/easy-rsa/2.0/
cp -r keys/ /etc/openvpn/

Configure OpenVPN

You can copy the OpenVPN configuration from  /usr/share/doc/openvpn-2.3.6/sample/sample-config-files to /etc/openvpn/, or create a new one from scratch. I will create a new one:

cd /etc/openvpn/
vim server.conf

Paste configuration below :

#change with your port
port 1337

#You can use udp or tcp
proto udp

# "dev tun" will create a routed IP tunnel.
dev tun

#Certificate Configuration

#ca certificate
ca /etc/openvpn/keys/ca.crt

#Server Certificate
cert /etc/openvpn/keys/server.crt

#Server Key and keep this is secret
key /etc/openvpn/keys/server.key

#See the size a dh key in /etc/openvpn/keys/
dh /etc/openvpn/keys/dh1024.pem

#Internal IP will get when already connect
server 192.168.200.0 255.255.255.0

#this line will redirect all traffic through our OpenVPN
push "redirect-gateway def1"

#Provide DNS servers to the client, you can use goolge DNS
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"

#Enable multiple client to connect with same key
duplicate-cn

keepalive 20 60
comp-lzo
persist-key
persist-tun
daemon

#enable log
log-append /var/log/myvpn/openvpn.log

#Log Level
verb 3

Save it.

Create a folder for the log file.

mkdir -p /var/log/myvpn/
touch /var/log/myvpn/openvpn.log

Disable firewalld and SELinux

Step 1 – Disable firewalld

systemctl mask firewalld
systemctl stop firewalld

Step 2 – Disable SELinux

vim /etc/sysconfig/selinux

And change SELINUX to disabled:

SELINUX=disabled

Then reboot the server to apply the change.

Configure Routing and Iptables

Step 1 – Enable iptables

/pre
systemctl enable iptables
systemctl start iptables
iptables -F

Step 2 – Add iptables-rule to forward a routing to our openvpn subnet.

iptables -t nat -A POSTROUTING -s 192.168.200.024 -o eth0 -j MASQUERADE
iptables-save /etc/sysconfig/iptablesvpn

Step 3 – Enable port forwarding.

vim /etc/sysctl.conf

add to the end of the line:

net.ipv4.ip_forward = 1.

Step 4 – Restart network server

systemctl start openvpn@server

 

Client Setup

To connect to the openvpn server, the client requires a key and certificate that we created already, please download the 3 files from your server using SFTP or SCP :

  • ca.crt
  • client.crt
  • client.key

If you use a Windows Client, then you can use WinSCP to copy the files. Afterwards create a new file called client.ovpn and paste configuration below :

client
dev tun
proto udp

#Server IP and Port
remote 192.168.1.104 1337

resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
ca ca.crt
cert client.crt
key client.key
ns-cert-type server
comp-lzo

And save it.

Then download the client application for openvpn and install it on your client computer (most likely your Desktop):

Windows user

OpenVPN Install.

Mac OS user

tunnelblick.

Linux user.

try networkmanager-openvpn through NetworkManager.

or use terminal

sudo openvpn --config client.ovpn

Conclusion

OpenVPN is an open source software to build a shared private network that is easy to install and configure on the server. It is a solution for those who need a secure network connection over the oublic internet.

 

How To Install SoftEther VPN on VPS CentOS Latest 2017

In this tutorial is a guide for installing SoftEther VPN Server on VPS CentOS. SoftEther VPN is a good choice for accessing your local network from a computer outside, or overcoming blocking on your local network. It works much faster than other VPN services but you need a client tool for all advanced features.

What is SoftEther

  • A Free Cross-platform Multi-protocol VPN program, as an academic project from University of Tsukuba.
  • It is a single server which support SSL-VPN (HTTPS) and 6 major VPN protocols (OpenVPN, IPsec, L2TP, MS-SSTP, L2TPv3 and EtherIP).
  • I would like to also highlight the VPN over ICMP and VPN over DNS feature if you are inside a very strict network.

Requirement : VPS

In this tutorial am using VPS from Digital Ocean $5, you can using VPS from your favorite VPS 🙂

    • RAM: 512MB
    • Disk Space: 20 GB SSD
    • Bandwidth: 1TB

Let’s Get Started

1. Update & Install Development Tools

yum update -y
yum groupinstall "Development Tools" -y

2. Install GCC & Libpcap

yum -y install gcc*
yum -y install libpcap*

3. Download Latest Softether VPN Server, Extract and Running

wget http://www.softether-download.com/files/softether/v4.22-9634-beta-2016.11.27-tree/Linux/SoftEther_VPN_Server/32bit_-_Intel_x86/softether-vpnserver-v4.22-9634-beta-2016.11.27-linux-x86-32bit.tar.gz
tar xzvf softether-vpnserver-v4.22-9634-beta-2016.11.27-linux-x86-32bit.tar.gz
cd vpnserver
make

4. Click or Enter 1, 1 and 1

5. Change to directory /usr/local/ and create a script

cd ..
mv vpnserver /usr/local
cd /usr/local/vpnserver/
chmod 600 *
chmod 700 vpncmd
chmod 700 vpnserver
nano /etc/init.d/vpnserver

6. Insert a script with nano

#!/bin/sh
# chkconfig: 2345 99 01
# description: SoftEther VPN Server
DAEMON=/usr/local/vpnserver/vpnserver
LOCK=/var/lock/subsys/vpnserver
test -x $DAEMON || exit 0
case "$1" in
start)
$DAEMON start
touch $LOCK
;;
stop)
$DAEMON stop
rm $LOCK
;;
restart)
$DAEMON stop
sleep 3
$DAEMON start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0

Save a sctipt (ctrl+x )

7. Starting or launch a script

chmod 755 /etc/init.d/vpnserver
/sbin/chkconfig --add vpnserver
/etc/init.d/vpnserver start

If you’re installaion is correct

after success and now start and create a password

./vpncmd
1
enter
enter
VPN Server ServerPasswordSet

Done 🙂

Setting a VPN Server Manager

Download a VPN Server Manager on link : http://www.softether-download.com/en.aspx?product=softether

  • After instalation done, now click New Setting
  • Typing your a Host Name / IP Adress, Port, Password etc.

  • Checklist a Remote Access VPN Server like image bellow

  • You can input a custom dns hostname with subdomain *****.softether.net

  • After finish you can create account 🙂

Done, thanks for reading, don’t hestiate comment if you harded install softether vpn 🙂

Build Chromium OS on Ubuntu 16.04

Hi guys how are you ? i hope you fine 🙂 oke in this article i will be describe building Chromium OS and running Chromium OS on KVM, i’m running in KVM VPS Ubuntu and this tutorial have a few step like :

  • Build Chromium OS
  • Write Chromium OS to USB
  • Run Chromium OS on QEMU
  • Run Chromium OS on KVM with virt-manager

Build ChromiumOS

Please install repo and create ${HOME}/.repo_.gitconfig.json beforehand

cat ~/
{
  "color.ui": [
    "auto"
  ],
  "user.name": [
    "name"
  ],
  "user.email": [
    "email@example"
  ]

The following command will create chromium_image.bin

sudo apt install -y git-core gitk git-gui subversion curl
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=${PWD}/depot_tools/:${PATH}
mkdir chromium
cd chromium
repo init -u https://chromium.googlesource.com/chromiumos/manifest.git
repo sync
export BOARD=amd64-generic
cros_sdk -- ./build_packages --board=${BOARD}
cros_sdk -- ./build_image --board=${BOARD} dev

Write ChromiumOS to USB

Run the following command after inserting USB. Running USB boot with this USB will run ChromiumOS.

cros_sdk -- cros flash --board=${BOARD} usb://

Run ChromiumOS on QEMU

You can run ChromiumOS on QEMU with this. But I cannot connect to internet

Run ChromiumOS on KVM with virt-manager

You need the following settings.

  • Add src/build/images/${BOARD}/latest/chromiumos_image.bin to “IDE Disk” as raw image.
  • Set “Device model” of “Virtual Network Interface” to e1000.
  • Set “Video Device” to cirrus.
  • Mouse pointer needs “VNC server”, “EvTouch USB Graphics Tablet” as input device and running virt-viewer (virt-manager’s viewer does not display mouse pointer).

virt-viewer displays as following.

How to Test Internet Speed of Your VPS

In this tutorial i’ll explain “How to Test Internet Speed of Your VPS”  , Most Linux-based Virtual Private Servers (vps) does not support GUI (graphical-based interface) so you have to manage everything from command line within your Terminal window or Putty. SpeedTest.net is a well known Internet speed test available by simply accessing their site on any web browser that supports Flash. But they do also provide another way to conduct the test, via command line. So here it is the tutorial is all about.

Ok Let’s Get Started 🙂

Step 1 – download script

cd
wget -O speedtest_cli.py "https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py"
wget -O bench-network.sh "https://raw.githubusercontent.com/rizal180499/Auto-Installer-VPS/master/conf/bench-network.sh"
wget "https://raw.githubusercontent.com/rizal180499/Auto-Installer-VPS/master/conf/monssh"
wget "https://raw.githubusercontent.com/rizal180499/Auto-Installer-VPS/master/conf/user-list"
wget "https://raw.githubusercontent.com/rizal180499/Auto-Installer-VPS/master/conf/menu"

Step 2A – Performing Speed Test (Without Share)

./speedtest.py


Step 2B – Performing Speed Test (With Share)

./speedtest.py --share

btw this my result speedtest of vps digitalocean 🙂

How to install screenfetch on Linux ( Ubuntu Debian Centos )

In this tutorial i’ll explain tutorial how to install screenfetch on linux ( CentOS Debian Ubuntu ) screenfetch is very important, we will know specification vps, ram user, cpu, kernel and other .

 

The installation process is very easy.

  1. Open on Putty
  2. Log in (Password Root VPS)
  3. Following the script

Step 1 – touch screenfetch-dev

cd
wget https://github.com/KittyKatt/screenFetch/archive/master.zip
apt-get install -y unzip
unzip master.zip
mv screenFetch-master/screenfetch-dev /usr/bin
cd /usr/bin
mv screenfetch-dev screenfetch
chmod +x /usr/bin/screenfetch
chmod 755 screenfetch
cd
echo "clear" .bash_profile
echo "screenfetch" .bash_profile

Step 2 – Download

wget -O screenfetch-dev "https://raw.githubusercontent.com/rizal180499/Auto-Installer-VPS/master/conf/screenfetch-dev"
mv screenfetch-dev /usr/bin/screenfetch
chmod +x /usr/bin/screenfetch
echo "clear" >> .profile
echo "screenfetch" >> .profile

Reboot and you’ll see a screenfetch on putty or terminal after logged in 🙂

INSTALL PHP 7 ON CENTOS

PHP 7 release on december 3 2015, it has also been updated to PHP 7.0.1 on December 17 2015. bringing not just advanced features and tweaked performance but also several bugs has been fixed.

PHP 7.0.0 comes with a new version of the Zend Engine, numerous improvements and new features such as :

  • Improved performance: PHP 7 is up to twice as fast as PHP 5.6
  • Significantly reduced memory usage
  • Abstract Syntax Tree
  • Consistent 64-bit support
  • Improved Exception hierarchy
  • Many fatal errors converted to Exceptions
  • Secure random number generator
  • Removed old and unsupported SAPIs and extensions
  • The null coalescing operator (??)
  • Return and Scalar Type Declarations
  • Anonymous Classes
  • Zero cost asserts

Oke Let’s Get Started to the tutorials 🙂

Tutorial How to install PHP 7 – or upgrade to PHP 7

INSTALL PHP 7 ON CENTOS / RHEL

1. Using Webtatic Repo

Step 1 – Login to your CentOS server as root or as a user with sudo privilege with Putty or other

Step 2 – Do yum update to make sure all packages are up to date:

yum update -y

Step 3 – Install Apache 2 web server (httpd):

yum install httpd -y

Step 4 – Add webtatic repository in your CentOS 7.x:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

However if you are still using CentOS 6.x, then use this instead:

rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

Step 5 – Now finally you can install PHP 7 using command below:

yum install php70w

Step 6 – You may also need to install several common PHP 7 modules. List it using command below:

yum search php70w-

Need a shortcut? Here’s the command to install PHP modules which are usually needed by many apps:

yum install php70w-cli php70w-common php70w-bcmath php70w-dba php70w-devel php70w-embedded php70w-fpm php70w-gd php70w-imap php70w-interbase php70w-intl php70w-ldap php70w-mbstring php70w-mcrypt php70w-mysql php70w-odbc php70w-opcache php70w-pdo php70w-pdo_dblib php70w-pear php70w-process php70w-pspell php70w-recode php70w-tidy php70w-xml php70w-xmlrpc

2. Using Remi repo

Step 1 – Login to your CentOS server as root or as a user with sudo privilege via putty or other

Step 2 – Do yum update to make sure all packages are up to date:

yum update -y

Step 3 – Install Apache 2 web server (httpd):

yum install httpd -y

Step 4 – Add EPEL and Remi repository in your CentOS 7.x:

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm

However if you are still using CentOS 6.x, then use this instead:

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm

Step 5 – Then now update your yum repo list

yum --enablerepo=remi update remi-release

Step 6 – Now finally you can install PHP 7 using command below:

yum --enablerepo=remi-php70 install php70

Step 7 – You may also need to install several common PHP 7 modules. List it using command below :

yum --enablerepo=remi-php70 search php70-

Need a shortcut? Here’s the command to install PHP modules which are usually needed by many apps:

yum --enablerepo=remi-php70 install php70w-cli php70w-common php70w-bcmath php70w-dba php70w-devel php70w-embedded php70w-fpm php70w-gd php70w-imap php70w-interbase php70w-intl php70w-ldap php70w-mbstring php70w-mcrypt php70w-mysql php70w-odbc php70w-opcache php70w-pdo php70w-pdo_dblib php70w-pear php70w-process php70w-pspell php70w-recode php70w-tidy php70w-xml php70w-xmlrpc

Now you can verify it using php -v command:

See ? It is PHP 7.0.1 with Zend Engine v3.0.0 and Zend OPcache v7.0.6-dev. How cool is that ? 🙂

Thanks for reading, don’t hestiate comment if you have a trouble installing PHP 7 on CentOS