Skip to content

Instantly share code, notes, and snippets.

@natanfelles
Last active May 23, 2016 22:17
Show Gist options
  • Save natanfelles/dc3bc068c2d896a330de3ee3f90fa636 to your computer and use it in GitHub Desktop.
Save natanfelles/dc3bc068c2d896a330de3ee3f90fa636 to your computer and use it in GitHub Desktop.
LEMP install on Debian distros
update-rc.d -f nginx disable;
update-rc.d -f php5-fpm disable;
update-rc.d -f mysql disable;
update-rc.d -f memcached disable;
update-rc.d -f fcgiwrap disable;
#!/bin/bash
# Created by Natan Felles
echo 'Welcome to the LEMP installation';
echo 'You need to be a sudo user and have other terminal to edit some files during the installation.'
echo 'Do you wants procced (Y/n)?'
read option;
if [ "$option" = "n" ]
exit;
else
# Nginx
echo 'Nginx installation will start:';
./nginx.sh
echo 'If you edited the /etc/nginx/nginx.conf press Enter else do it was is showing up.';
echo 'Nginx installation finished.';
# PHP5-FPM e extras
echo 'PHP5-FPM installation will start:';
./php.sh
echo 'If you edited the /etc/php5/fpm/php.ini press Enter else do it was is showing up.';
echo 'PHP5-FPM installation finished.';
# MySQL
echo 'MySQL installation will start:';
./mysql.sh
echo 'MySQL installation finished.';
echo 'LEMP install is complete!';
fi
sudo apt-get install mysql-client mysql-server;
sudo apt-get install nginx-extras;
echo "Open /etc/nginx/nginx.conf and add in the http block:";
echo "
## Detect when HTTPS is used
map $scheme $fastcgi_https {
default off;
https on;
}
";
sudo apt-get install php5-fpm;
sudo apt-get install php-apc;
sudo apt-get install php5-mysql php5-curl php5-cgi php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl snmp fcgiwrap memcached;
sudo php5enmod mcrypt;
echo "Open /etc/php5/fpm/php.ini and set:
cgi.fix_pathinfo=0
date.timezone='America/Sao_Paulo'";
#!/bin/bash
# You cat put this file in /usr/local/bin and with chmod 755
# Created by Natan Felles
echo 'Starting Web Server';
sudo service memcached start;
echo '- Memcached started';
sudo service fcgiwrap start;
echo '- FCGI Wrap started';
sudo service nginx start;
echo '- Nginx started';
sudo service php5-fpm start;
echo '- PHP5-FPM started';
sudo service mysql start;
echo '- MySQL started';
echo 'All services are started';
sleep 2;
echo 'Be creative. Bye!';
sleep 5;
#!/bin/bash
# You cat put this file in /usr/local/bin and with chmod 755
# Created by Natan Felles
echo 'Stoping Web Server';
sudo service nginx stop;
echo '- Nginx stoped';
sudo service php5-fpm stop;
echo '- PHP5-FPM stoped';
sudo service mysql stop;
echo '- MySQL stoped';
sudo service memcached stop;
echo '- Memcached stoped';
sudo service fcgiwrap stop;
echo '- FCGI Wrap stoped';
echo 'All services are stoped';
sleep 2;
echo 'Sleep well. Bye!';
sleep 5;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment