Install LAMP on Centos 7

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
yum -y install epel-release
yum -y install mariadb-server mariadb
systemctl start mariadb.service
systemctl enable mariadb.service

yum -y install httpd
systemctl start httpd.service
systemctl enable httpd.service
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload
yum -y install php
systemctl restart httpd.service
yum search php
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
yum -y install phpMyAdmin

configure phpMyAdmin. add code :
vi /etc/httpd/conf.d/phpMyAdmin.conf

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8

<IfModule mod_authz_core.c>
# Apache 2.4
#Require ip
#Require ip ::1
Require all granted
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from
Allow from ::1

<Directory /usr/share/phpMyAdmin/>
Options none
AllowOverride Limit
Require all granted


change the authentication in phpMyAdmin from cookie to http:

vi /etc/phpMyAdmin/

$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?

Restart Apache:
systemctl restart httpd.service

Using Tmux (Terminal Multiplexer) to Keep SSH Sessions Running

Tmux is another software which is created to be a replacement for screen. It has most of the capabilities of screen, with few additional capabilities which make it more powerful than screen.

Install tmux

yum -y install tmux

Start a Tmux Session

$ tmux

After performing your operations on the terminal, you can detach that session from the controlling terminal so that it goes into background and you can safely logout.

Detach Tmux Session from Terminal

use the shortcut (Ctrl+b then d)
After this your current session will be detached and you will come back to your terminal from where you can log out safely.

Resuming the Closed Tmux Session

tmux attach


Install VNC on Centos ^

install dekstop
yum -y groupinstall Desktop

install VNC server
yum -y install tigervnc-server

install font
yum -y install xorg-x11-fonts-Type1

chkconfig vncserver on

Set Password

Setting VNC Server
vi /etc/sysconfig/vncservers

VNCSERVERARGS[1]="-geometry 1024x600"

Restart VNC
service vncserver restart

edit file start up
vncserver -kill :1
vi .vnc/xstartup

#twm &
exec gnome-session &

Restart VNC
service vncserver start
service vncserver restart


yum -y groupinstall Desktop
yum -y install tigervnc-server
yum -y install xorg-x11-fonts-Type1
chkconfig vncserver on

Google Drive Linux Client using GDrive

Installing GDrive – Google Drive Linux Client

Simply download the latest version from their github page HERE

For my Centos 6 server I used this one : drive-linux-x64 v1.9.0

(right click and copy link url then paste into wget below)

wget -O /usr/local/bin/gdrive “paste url here”

I copied the file into /usr/local/bin so it is globally available to all users on my server, and I also renamed it to gdrive juat as I thought that would be easier to remember !! Dont forget to make the file executable (chmod +x /usr/local/bin/gdrive) and thats it !!!

When you first run any gdrive command it will prompt you to link it to your google drive account and give it permissions.
The program will then return with a url you need to link it to your account. Here is how I did it :
1) Open Chrome (or any browser) and log in to the Google account you want to link gdrive with
2) Make sure you can see in your apps Google Drive appearing (the menu in the top right is normally where it appears
3) Paste in the url from the output of the ‘gdrive list’ you did earlier, and accept the permissions prompt it needs to enable gdrive to upload and download files.

Uploading a file – Google Drive Linux Client
gdrive upload -r /var/www/html

Downloading a file from Google Drive Linux Client with GDrive
gdrive list
Id Title Size Created
0B0tRrdcY7CwJZHh5ZmVpZHRMYW8 drive-linux-amd64 10 MB 2014-09-25 17:47:08
0B0tRrdcY7CwJY2lNS2x3NC1lQUU drive-linux-386 8 MB 2014-09-25 17:47:01
0B0tRrdcY7CwJR3lmZnlRaFZwOHc drive-linux-arm 9 MB 2014-09-25 17:46:57
0B0tRrdcY7CwJQlRfQUVxY2hkWUE drive-linux-rpi 9 MB 2014-09-25 17:46:52

gdrive download -i 0B0tRrdcY7CwJZHh5ZmVpZHRMYW8