fitdhruv
11/22/2016 - 10:26 AM

Programming Software Commnd ( install, remove, services, dependencies ) Ubuntu Enviroment

Programming Software Commnd ( install, remove, services, dependencies ) Ubuntu Enviroment


##############  UPDATE UBUNTU	##############
sudo local-gen UTF-8
sudo apt-get update
sudo apt-get upgrade


##############  GIT	##############
$ sudo add-apt-repository ppa:git-core/ppa
$ sudo apt-get update
$ sudo apt-get install git


##############  Apache	##############
Installing Apache
sudo apt-get install apache2

Removing Apache
sudo apt-get remove apache2
sudo apt-get autoremove
sudo apt-get remove apache2*

sudo a2enmod setenvif headers deflate filter expires rewrite include

Apache Service
sudo /etc/init.d/apache2 restart
sudo service apache2 restart
sudo a2enmod headers
sudo a2enmod rewrite // enable apache rewrite
sudo a2enmod setenvif headers deflate filter expires rewrite include

sudo nano /etc/apache2/apache2.conf
<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>


##############	PHP	##############  
Installing PHP
sudo apt-get install php5 libapache2-mod-php5

Removing PHP
sudo apt-get -y purge php*

Support Modules
sudo apt-get install libapache2-mod-php5 curl openssl unzip php5-mcrypt

sudo apt-get install php5-mcrypt

php5enmod mcrypt  // enabling mcrypt manually

##############  COMPOSER  ##############  
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

Error --
Composer – curl: Failed to connect to getcomposer.org port 443 Network is unreachable

echo ipv4 >> ~/.curlrc


##############  MYSQL	##############  
Installing MYSQL
sudo apt-get install mysql-server mysql-client

Removing MYSQL
sudo apt-get -y purge php*

Service
sudo service mysql restart

##############  ORACLE JAVA    ##############
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer


##############  Elasticsearch	##############
Dependencies - Install Oracle Java

Remove old elasticsearch
sudo dpkg -r elasticsearch

Install
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.deb
sudo dpkg -i elasticsearch-1.3.2.deb

Serivces
sudo /etc/init.d/elasticsearch start


##############  MONGODB    ##############
Install

***********************************************

sudo apt-get install php5-dev php5-cli php-pear
sudo pecl install mongo

Then, add the following to your php.ini file:
extension=mongo.so

sudo apt-get install mongodb-clients
sudo apt-get install mongodb-server

*****************************************************************************
sudo apt-get install mongodb-clients

sudo apt-get install php5-dev make php-pear curl libcurl4-openssl-dev php5-cli 
wget https://github.com/mongodb/mongo-php-driver/archive/master.zip
unzip master.zip
cd mongo-php-driver
$ phpize
$ ./configure
$ make all
$ sudo make install

Then, add the following to your php.ini file:
extension=mongo.so

sudo apt-get install mongodb-clients



Service
sudo status mongodb   //tell status of mongodb start or stop
sudo service mongodb restart | stop | start

Config
#bind_ip = 127.0.0.1 //comment it which so anyone can connect using mongo client

Start mongod as a Daemon
The following command starts mongod as a daemon and records log output to
mongod --fork --logpath /var/log/mongodb.log

##############  RUBY    ##############

sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev

sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.1
rvm use 2.1.1 --default
ruby -v


gem install mysql2
gem install mysql
gem install bson_ext
gem install mongo
gem install json
gem install sanitize
gem install nokogiri
gem install bundler


##############  phusion passenger standalone    ##############
steps for phusion passenger standalone

https://www.phusionpassenger.com/documentation/Users%20guide%20Standalone.html#install_add_apt_repo

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7

Create a file /etc/apt/sources.list.d/passenger.list and insert
##### !!!! Only add ONE of these lines, not all of them !!!! #####
# Ubuntu 14.04
deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main


sudo chown root: /etc/apt/sources.list.d/passenger.list
sudo chmod 600 /etc/apt/sources.list.d/passenger.list
sudo apt-get update

sudo apt-get install passenger




######################################   MIRROR  AND WEBSITE  ######################################
 wget -np -nv -m   http://preview.byaviators.com/template/realsite/
 
 
 
 ######################################   OH MY ZSH  ######################################
 
 RVM is not working in ZSH
 ~/.zshrc
 [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" 
 
 
  ######################################   REDIS  ######################################
$ sudo apt-get install -y python-software-properties
$ sudo add-apt-repository -y ppa:rwky/redis
$ sudo apt-get update
$ sudo apt-get install -y redis-server