install LAMP+ (Nginx, PHP7, MySQL, ImageMagick, curl, zip, php-mbstring, GIT, Composer)

What is ‘LAMP’?
Wikipedia said that LAMP is:

LAMP is an archetypal model of web service stacks, named as an acronym of the names of its original four open-source components: the Linux operating system, the Apache HTTP Server, the MySQL relational database management system (RDBMS), and the PHP programming language. The LAMP components are largely interchangeable and not limited to the original selection. As a solution stack, LAMP is suitable for building dynamic web sites and web applications.

 

Install LAMP+ on Linux Debian
Whether you run a VPS, dedicated server, or any cloud solution (Amazon EC2, Google GCE) on linux, you may need to install some programs in order to start developing things.

This LAMP bash installation include some extra programs that can make life easier with Debian, and will allows you run Laravel 5.2 / 5.3 / 5.4 / 5.5 without any problem.

#!/bin/bash

# This bash script will install LAMP+ (Nginx, PHP7, MySQL, ImageMagick, curl, zip, php-mbstring, GIT, Composer) to run Laravel 5.4 on Debian
# 
# Do not forget to make this bash script executable
# chmod +x install-lamp.sh

#!/bin/bash
if [ "$EUID" -ne 0 ]
  then echo "Please run as root"
  exit
fi

export DEBIAN_FRONTEND=noninteractive

# Update Package List
apt-get update

# Update System Packages
#apt-get -y upgrade

# Force Locale
echo "LC_ALL=en_US.UTF-8" >> /etc/default/locale
locale-gen en_US.UTF-8


echo "deb http://packages.dotdeb.org jessie all" | tee -a /etc/apt/sources.list.d/dotdeb.list
echo "deb-src http://packages.dotdeb.org jessie all" | tee -a /etc/apt/sources.list.d/dotdeb.list
wget -qO - http://www.dotdeb.org/dotdeb.gpg | apt-key add -
apt-get update -y

#nginx
apt-get install nginx -y
service nginx reload

#mysql 5.7 (with json type)
wget http://dev.mysql.com/get/mysql-apt-config_0.8.0-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.0-1_all.deb
apt-key adv --keyserver pgp.mit.edu --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5
apt-get update
apt-get install mysql-server

mysql_secure_installation

cd ~

#php7
apt-get install php7.0-cli php7.0-curl php7.0-dev php7.0-fpm php7.0-gd php7.0-mysql php7.0-mcrypt php7.0-gd php7.0-intl php7.0-xsl

apt-get install php-fpm php-mysql
systemctl restart php7.0-fpm -y

#nano /etc/php/7.0/fpm/php.ini
cd ~

#curl
apt-get install curl -y
cd ~

#zip
apt-get install zip -y

# zip for PHP (use ZipArchive;)
sudo apt-get -f install
apt-get install php7.0-zip

#then add to the end of the ini file: zip.so
echo extension=zip.so >> /etc/php/7.0/cli/php.ini
echo extension=zip.so >> /etc/php/7.0/fpm/php.ini
cd ~

#php-mbstring
apt-get install php-mbstring -y
#then add to the end of the ini file: mbstring.so
echo extension=mbstring.so >> /etc/php/7.0/cli/php.ini
echo extension=mbstring.so >> /etc/php/7.0/fpm/php.ini
cd ~


#imagemagick
apt-get install pkg-config libmagickwand-dev -y
cd /tmp
wget https://pecl.php.net/get/imagick-3.4.0.tgz
tar xvzf imagick-3.4.0.tgz
cd imagick-3.4.0
phpize
./configure
make install
echo extension=imagick.so >> /etc/php/7.0/cli/php.ini
echo extension=imagick.so >> /etc/php/7.0/fpm/php.ini
service php7.0-fpm restart
service nginx restart
rm -rf /tmp/imagick-3.4.0*

cd ~


#git
apt-get install git-core -y
cd ~

curl -sS https://getcomposer.org/installer | php

mv composer.phar /usr/local/bin/composer
cd ~

Install Sudo On Linux Debian (jessie)

What is ‘sudo’?
Wikipedia said that sudo is:

sudo is a program for Unix-like computer operating systems that allows users to run programs with the security privileges of another user, by default the superuser. It originally stood for “superuser do” as the older versions of sudo were designed to run commands only as the superuser. However, the later versions added support for running commands not only as the superuser but also as other (restricted) users, and thus it is also commonly expanded as “substitute user do”.Although the latter case reflects its current functionality more accurately, sudo is still often called “superuser do” since it is so often used for administrative tasks.”

 

This bash script can help you install the sudo command under Linux Debian (jessie):

#!/bin/bash

# This bash script will install sudo on Debian
# 
# Do not forget to make this bash script executable
# chmod +x install-sudo.sh
#
# change the user name (ron) to the current user name

if [ "$EUID" -ne 0 ]
  then echo "Please run as root"
  exit
fi

apt-get install sudo -y

# Add the current user to the end of the sudoers
echo "ron   ALL=(ALL:ALL) ALL" >> "/etc/sudoers"

echo "Done."

WiserBit is Back!

  print "Hello World!";

WiserBit website is now online.

WiserBit is the main frame of many digital projects that was developed by us, from solutions to the end users on desktop devices to the online apps that can be run under mobile devices.

Here, under this website (WP blog) I will share my works, ideas, features, tips and tricks about software developing(or ‘Apps’ as they called those days ? ).

Currently, you can contact me via the main email at: wiserbit@gmail.com