dmartinezla
8/4/2016 - 3:27 PM

Install Bitnami Lampstack

Install Bitnami Lampstack

1.- install bitnami
2.- symbolic link to /opt/bitnami
3.- symbolic link:
	1.- /opt/bitnami/ctlscript.sh /usr/bin/bn-ctlscript
	2.- /opt/bitnami/use_lampstack.sh /usr/bin/bn-lampstack
4.- autoload service: 
	1.- https://wiki.bitnami.com/Native_Installers_Quick_Start_Guide#Debian-like_distribution_(Debian_8_or_greater.2c_Ubuntu_16.04_or_greater.2c_etc)
	2.- 
				[Unit]
				Description=Bitnami LampStack service

				[Service]
				User=david
				Type=forking
				TimeoutStartSec=90
				TimeoutStopSec=90
				ExecStart=/opt/bitnami/ctlscript.sh start
				ExecStop=/opt/bitnami/ctlscript.sh stop
				ExecReload=/opt/bitnami/ctlscript.sh restart
				Restart=on-failure

				[Install]
				WantedBy=multi-user.target

5.- Set bash properties into bitnami bash: edit .bitnamirc (add at the end of the file):
		
			exec bash --rcfile "/home/david/.bashrc"

6.- to recognize both environments (change color of the prompt):
		1.- Edit and add at the end of the .bashrc file (different color and suffix "lamp" in lampstack environment:
			if [ "$BITNAMI_ROOT" != "" ]; then
				PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u-lamp@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
			fi

7.- Set php into environment:
     1.- add at start of path in /etc/environment: /home/david/lampstack-5.6.24-0/php/bin:
     		PATH="/home/david/lampstack-5.6.24-0/php/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

8.- PHPSTORM::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
	1.- Set terminal shell path: /opt/bitnami/use_lampstack
	2.- 
	3.- PHP code sniffer:
			1.- get https://github.com/squizlabs/PHP_CodeSniffer:
				composer global require "squizlabs/php_codesniffer=*"
			2.- Configure into phpstorm:
					php > code sniffer > Local > .composer/vendor/bin/phpcs
	4.- Symfony code sniffer:
			1.- get form https://github.com/djoos/Symfony2-coding-standard and process to enable it