DigitalOcean Cloud Config: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(20 intermediate revisions by the same user not shown)
Line 3: Line 3:
# Add SSH before create Croplet
# Add SSH before create Croplet
# Add domain
# Add domain
==  Local Time ==
sudo cp /usr/share/zoneinfo/Asia/Dhaka /etc/localtime
date
cal


== YUM Update  ==
== YUM Update  ==
Line 9: Line 14:
  yum -y install yum-utils
  yum -y install yum-utils
  yum -y groupinstall development
  yum -y groupinstall development


== Install Ruby 2.0 ==
== Install Ruby 2.0 ==
Line 18: Line 22:
  yum install httpd
  yum install httpd
  yum install php
  yum install php
  apachectl restart
  apachectl restart
  systemctl status httpd
  systemctl status httpd
Line 25: Line 30:
  curl 'https://setup.ius.io/' -o setup-ius.sh
  curl 'https://setup.ius.io/' -o setup-ius.sh
  bash setup-ius.sh
  bash setup-ius.sh
   
  rm -rf setup-ius.sh
 
  yum remove php-cli mod_php php-common
  yum remove php-cli mod_php php-common
  yum install mod_php70u php70u-cli php70u-mysqlnd
  yum install mod_php70u php70u-cli php70u-mysqlnd
  apachectl restart
  apachectl restart
  systemctl status httpd
  systemctl status httpd
Line 51: Line 58:
  python3.6 -m venv venv
  python3.6 -m venv venv
  source venv/bin/activate
  source venv/bin/activate
 
  # check version of python & pip
  # check version of python & pip
  pip -V
  pip -V
Line 63: Line 70:
  md5sum mysql57-community-release-el7-9.noarch.rpm
  md5sum mysql57-community-release-el7-9.noarch.rpm
  rpm -ivh mysql57-community-release-el7-9.noarch.rpm
  rpm -ivh mysql57-community-release-el7-9.noarch.rpm
rm -rf mysql57-community-release-el7-9.noarch.rpm


  yum install mysql-server
  yum install mysql-server
Line 71: Line 79:
  mysql_secure_installation
  mysql_secure_installation
  mysqladmin -u root -p version
  mysqladmin -u root -p version
mysql -u root -p
mysql -h localhost -u root -p
mysql -h 127.0.0.1 -u root -p
== Install Oracle JDK ==
cd ~
wget --no-cookies --no-check-certificate --header \
"Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/8u152-b16/aa0333dd3019491ca4f6ddbe78cdb6d0/jdk-8u152-linux-x64.rpm"
yum localinstall jdk-8u152-linux-x64.rpm
java  -version
javac -version
# remove to free cloud storage
rm -rf jdk-8u152-linux-x64.rpm
== Install Apache Ant ==
cd /opt/cli/
wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.9-bin.zip
unzip  apache-ant-1.9.9-bin.zip
rm -rf apache-ant-1.9.9/manual/
rm -rf apache-ant-1.9.9-bin.zip
# ant home and path setting to ~/.bash_profile
export ANT_HOME="/opt/cli/apache-ant-1.9.9"
export PATH="$PATH:$ANT_HOME/bin"
ant -version
== Install Apache Maven ==
cd /opt/cli/
wget https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip
unzip  apache-maven-3.3.9-bin.zip
rm -rf  apache-maven-3.3.9-bin.zip
# m2 home and path setting to ~/.bash_profile
export M2_HOME="/opt/cli/apache-maven-3.3.9"
export PATH="$PATH:$M2_HOME/bin"
mvn -v
== Oracle Instant Client ==
=== Download & Upload ===
See the [http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html Instant Client Home Page] for more information about Instant Client. Find [http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html#ic_x64_inst installation instructions here]  to download following files from [http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html Instant Client for Linux x86-64]
# instantclient-basic-linux.x64-12.2.0.1.0.zip
# instantclient-odbc-linux.x64-12.2.0.1.0-2.zip
# instantclient-sqlplus-linux.x64-12.2.0.1.0.zip
# instantclient-tools-linux.x64-12.2.0.1.0.zip
# instantclient-sdk-linux.x64-12.2.0.1.0.zip
scp ~/Downloads/instantclient-*.zip  dev.chorke.org:/opt/cli/oracle/oracle12c/
ssh dev.chorke.org
=== Unzip libraries ===
cd /opt/cli/oracle/oracle12c/
unzip instantclient-basic-linux.x64-12.2.0.1.0.zip
unzip instantclient-odbc-linux.x64-12.2.0.1.0-2.zip
unzip instantclient-sdk-linux.x64-12.2.0.1.0.zip
unzip instantclient-sqlplus-linux.x64-12.2.0.1.0.zip
unzip instantclient-tools-linux.x64-12.2.0.1.0.zip
rm -rf instantclient-*.zip
=== Soft link creation ===
cd instantclient_12_2/
ln -s libocci.so.12.1 libocci.so
ln -s libclntsh.so.12.1 libclntsh.so
=== Installation libaio ===
yum install libaio
sh -c "echo /opt/cli/oracle/oracle12c/instantclient_12_2 > /etc/ld.so.conf.d/oracle-instantclient.conf"
ldconfig
=== Environment  Variable ===
# export LD_LIBRARY_PATH="/opt/cli/oracle/oracle12c/instantclient_12_2:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="/opt/cli/oracle/oracle12c/instantclient_12_2"
export ORACLE_HOME="/opt/cli/oracle/oracle12c/instantclient_12_2"
export PATH="$ORACLE_HOME:$PATH"
=== Network Configuration ===
mkdir -p $ORACLE_HOME/network/admin
cd $ORACLE_HOME/network/admin
'''sqlnet.ora'''
# $ORACLE_HOME/network/admin/sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES, EZCONNECT, ONAMES, HOSTNAME)
'''tnsnames.ora'''
# $ORACLE_HOME/network/admin/tnsnames.ora
CKI =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = db.chorke.org)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = CKI)
    )
  )
== Kill Process ==
# kill -9 pid
kill -9 10151
== Bash History ==
# clear all
history -c
# overwrite
history -w
# delete by offset
history -d 2013
history -w
== References ==
* [http://www.oracle.com/technetwork/articles/dsl/technote-php-instant-12c-2088811.html Installing PHP and the Oracle Instant Client for Linux]

Latest revision as of 23:55, 14 April 2018

Initial Config

  1. Create a Droplet of Centos7
  2. Add SSH before create Croplet
  3. Add domain

Local Time

sudo cp /usr/share/zoneinfo/Asia/Dhaka /etc/localtime
date
cal

YUM Update

sudo su
yum -y update
yum -y install yum-utils
yum -y groupinstall development

Install Ruby 2.0

yum install ruby
ruby -v

Install PHP 5.4

yum install httpd
yum install php
apachectl restart
systemctl status httpd

Update PHP 7.0

cd ~
curl 'https://setup.ius.io/' -o setup-ius.sh
bash setup-ius.sh
rm -rf setup-ius.sh 
yum remove php-cli mod_php php-common
yum install mod_php70u php70u-cli php70u-mysqlnd
apachectl restart
systemctl status httpd
mkdir -p /var/www/html/test
# write phpinfo() code here
vi /var/www/html/test/test.php

Install Python 3.6

# centos7.iuscommunity.org
yum -y install https://centos7.iuscommunity.org/ius-release.rpm
yum -y install python36u
# check your python version
python3.6 -V

# install pip for Python 3.6 
yum -y install python36u-pip
yum -y install python36u-devel
# configure virtual env
cd /opt/;mkdir dev pro;cd dev
python3.6 -m venv venv
source venv/bin/activate
# check version of python & pip
pip -V
python -V
deactivate

Install MySQL

cd ~
yum install wget
wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
md5sum mysql57-community-release-el7-9.noarch.rpm
rpm -ivh mysql57-community-release-el7-9.noarch.rpm
rm -rf mysql57-community-release-el7-9.noarch.rpm 
yum install mysql-server
systemctl start mysqld
systemctl status mysqld
grep 'temporary password' /var/log/mysqld.log
mysql_secure_installation
mysqladmin -u root -p version
mysql -u root -p
mysql -h localhost -u root -p
mysql -h 127.0.0.1 -u root -p

Install Oracle JDK

cd ~
wget --no-cookies --no-check-certificate --header \
"Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/8u152-b16/aa0333dd3019491ca4f6ddbe78cdb6d0/jdk-8u152-linux-x64.rpm"
yum localinstall jdk-8u152-linux-x64.rpm
java  -version
javac -version
# remove to free cloud storage
rm -rf jdk-8u152-linux-x64.rpm

Install Apache Ant

cd /opt/cli/
wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.9-bin.zip
unzip  apache-ant-1.9.9-bin.zip
rm -rf apache-ant-1.9.9/manual/
rm -rf apache-ant-1.9.9-bin.zip
# ant home and path setting to ~/.bash_profile
export ANT_HOME="/opt/cli/apache-ant-1.9.9"
export PATH="$PATH:$ANT_HOME/bin"
ant -version

Install Apache Maven

cd /opt/cli/
wget https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip
unzip   apache-maven-3.3.9-bin.zip
rm -rf  apache-maven-3.3.9-bin.zip
# m2 home and path setting to ~/.bash_profile
export M2_HOME="/opt/cli/apache-maven-3.3.9"
export PATH="$PATH:$M2_HOME/bin"
mvn -v

Oracle Instant Client

Download & Upload

See the Instant Client Home Page for more information about Instant Client. Find installation instructions here to download following files from Instant Client for Linux x86-64

  1. instantclient-basic-linux.x64-12.2.0.1.0.zip
  2. instantclient-odbc-linux.x64-12.2.0.1.0-2.zip
  3. instantclient-sqlplus-linux.x64-12.2.0.1.0.zip
  4. instantclient-tools-linux.x64-12.2.0.1.0.zip
  5. instantclient-sdk-linux.x64-12.2.0.1.0.zip
scp ~/Downloads/instantclient-*.zip  dev.chorke.org:/opt/cli/oracle/oracle12c/
ssh dev.chorke.org

Unzip libraries

cd /opt/cli/oracle/oracle12c/
unzip instantclient-basic-linux.x64-12.2.0.1.0.zip
unzip instantclient-odbc-linux.x64-12.2.0.1.0-2.zip
unzip instantclient-sdk-linux.x64-12.2.0.1.0.zip
unzip instantclient-sqlplus-linux.x64-12.2.0.1.0.zip
unzip instantclient-tools-linux.x64-12.2.0.1.0.zip
rm -rf instantclient-*.zip

Soft link creation

cd instantclient_12_2/
ln -s libocci.so.12.1 libocci.so
ln -s libclntsh.so.12.1 libclntsh.so

Installation libaio

yum install libaio
sh -c "echo /opt/cli/oracle/oracle12c/instantclient_12_2 > /etc/ld.so.conf.d/oracle-instantclient.conf"
ldconfig

Environment Variable

# export LD_LIBRARY_PATH="/opt/cli/oracle/oracle12c/instantclient_12_2:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="/opt/cli/oracle/oracle12c/instantclient_12_2"
export ORACLE_HOME="/opt/cli/oracle/oracle12c/instantclient_12_2"
export PATH="$ORACLE_HOME:$PATH"

Network Configuration

mkdir -p $ORACLE_HOME/network/admin
cd $ORACLE_HOME/network/admin

sqlnet.ora

# $ORACLE_HOME/network/admin/sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES, EZCONNECT, ONAMES, HOSTNAME)

tnsnames.ora

# $ORACLE_HOME/network/admin/tnsnames.ora
CKI =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = db.chorke.org)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = CKI)
    )
  )

Kill Process

# kill -9 pid
kill -9 10151

Bash History

# clear all
history -c
# overwrite 
history -w
# delete by offset
history -d 2013
history -w

References