Created
June 4, 2015 18:22
-
-
Save marinhero/b44bc948bf85c839b5a9 to your computer and use it in GitHub Desktop.
LEMP setup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Author: Marin Alcaraz | |
#Fast LEMP stack install | |
apt-get -y update | |
apt-get -y upgrade | |
apt-get install -y mysql-server php5-mysql | |
mysql_install_db | |
/usr/bin/mysql_secure_installation | |
echo "deb http://ppa.launchpad.net/nginx/stable/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sour | |
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C | |
apt-get update | |
apt-get install -y nginx | |
service nginx start | |
apt-get install php5-fpm | |
echo "Find the line, cgi.fix_pathinfo=1, and change the 1 to 0." | |
#If this number is kept as 1, the php interpreter will do its best to process | |
#the file that is as near to the requested file as possible. This is a possible security risk. | |
#If this number is set to 0, conversely, the interpreter will only process the | |
#exact file path—a much safer alternative. | |
vim /etc/php5/fpm/php.ini | |
echo "Find the line, listen = 127.0.0.1:9000, and change the 127.0.0.1:9000 to /var/run/php5-fpm.sock." | |
vim /etc/php5/fpm/pool.d/www.conf | |
service php5-fpm restart | |
echo "Webserver accesible at: " | |
ifconfig eth0 | grep inet | awk '{ print $2 }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment