Wednesday, 27 February 2019

LAMP on debian 8 jessie

PHP 7.2 on Debian

You can also install the Latest PHP version on your system. Run the following commands to install PHP 7.2 on Debian 8.
sudo apt update
sudo apt install php7.2
Also install required php modules.
sudo apt install php7.2-cli php7.2-common php7.2-curl php7.2-gd php7.2-json php7.2-mbstring php7.2-mysql php7.2-xml
https://tecadmin.net/install-php7-on-debian/


Install MYSQL on Debian

sudo apt-get install mysql-server

https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-in-ubuntu-16-04




A note about Debian/Ubuntu Linux systemd users

Use the following systemctl command on Debian Linux version 8.x+ or Ubuntu Linux version Ubuntu 15.04+ or above:
## Start command ##
systemctl start apache2.service
## Stop command ##
systemctl stop apache2.service
## Restart command ##
systemctl restart apache2.service
https://www.cyberciti.biz/faq/star-stop-restart-apache2-webserver/



Install Composer for PHP

Download the installer to the /tmp directory.
  • php -r "copy('https://getcomposer.org/installer', '/tmp/composer-setup.php');"
Visit Composer's pubkeys and signatures page and copy the SHA-384 string at the top . Then, run the following command by replacing sha_384_string with the string you copied.
  • php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === 'sha_384_string') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('/tmp/composer-setup.php'); } echo PHP_EOL;"
This command checks the hash of the file you downloaded with the correct hash from Composer's website. If it matches, it'll print Installer verified. If it doesn't match, it'll print Installer corrupt, in which case you should double check that you copied the SHA-384 string correctly.
Next, we will install Composer. To install it globally under /usr/local/bin, we'll use the --install-dirflag; --filename tells the installer the name of Composer's executable file. Here's how to do this in one command:
  • sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-composer-on-debian-8



Git

Step 1 — Installing Git with APT

Before you install Git, make sure that your package lists are updated by executing the following command:
  • sudo apt-get update
Install Git with apt-get in one command:
  • sudo apt-get install git-core

https://www.digitalocean.com/community/tutorials/how-to-install-git-on-debian-8




Install Nodejs NPM using NVM (node -v > 6.0)

How To Install Using nvm

An alternative to installing Node.js through apt is to use a specially designed tool called nvm, which stands for "Node.js version manager". Using nvm, you can install multiple, self-contained versions of Node.js which will allow you to control your environment easier. It will give you on-demand access to the newest versions of Node.js, but will also allow you to target previous releases that your app may depend on.
To start off, we'll need to get the software packages from our Debian repositories that will allow us to build source packages. The nvm command will leverage these tools to build the necessary components:
  • sudo apt-get update
  • sudo apt-get install build-essential libssl-dev
Once the prerequisite packages are installed, you can pull down the nvm installation script from the project's GitHub page. The version number may be different, but in general, you can download it with curl:
  • curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh -o install_nvm.sh
And inspect the installation script with nano:
  • nano install_nvm.sh
Run the script with bash:
  • bash install_nvm.sh
It will install the software into a subdirectory of your home directory at ~/.nvm. It will also add the necessary lines to your ~/.profile file to make the nvm command available.
To gain access to the nvm command and its functionality, you'll need to log out and log back in again, or you can source the ~/.profile file so that your current session knows about the changes:
  • source ~/.profile
Now that you have nvm installed, you can install isolated Node.js versions.
To find out the versions of Node.js that are available for installation, you can type:
  • nvm ls-remote
Output
... v6.8.0 v6.8.1 v6.9.0 (LTS: Boron) v6.9.1 (LTS: Boron) v6.9.2 (Latest LTS: Boron) v7.0.0 v7.1.0 v7.2.0
As you can see, the newest version at the time of this writing is v7.2.0, but v6.9.2 is the latest long-term support release. You can install that by typing:
  • nvm install 6.9.2
You'll see the following output:
Output
Computing checksum with sha256sum Checksums matched! Now using node v6.9.2 (npm v3.10.9) Creating default alias: default -> 6.9.2 (-> v6.9.2)
Usually, nvm will switch to use the most recently installed version. You can explicitly tell nvm to use the version we just downloaded by typing:
  • nvm use 6.9.2



Install unzip:
apt-get install unzip
https://askubuntu.com/questions/86849/how-to-unzip-a-zip-file-from-the-terminal

Unistall node js:
sudo apt-get purge --auto-remove nodejs
https://askubuntu.com/questions/786015/how-to-remove-nodejs-from-ubuntu-16-04



You can use -R with chmod for recursive traversal of all files and subfolders.
You might need sudo as it depends on LAMP being installed by the current user or another one:
sudo chmod 755 -R /opt/lampp/htdocs
https://stackoverflow.com/questions/3740152/how-do-i-change-permissions-for-a-folder-and-all-of-its-subfolders-and-files-in?rq=1



chown - change ownership











No comments:

Post a comment