Created
July 9, 2015 20:12
-
-
Save adampiotrowski/ccf6342d9308a3abd897 to your computer and use it in GitHub Desktop.
lemp.sh
This file contains hidden or 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
# Install updates | |
sudo apt-get update && sudo apt-get upgrade | |
# Update kernel | |
sudo apt-get update && sudo apt-get dist-upgrade | |
# Install LEMP | |
sudo apt-get update && sudo apt-get install software-properties-common | |
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db | |
sudo add-apt-repository 'deb http://mariadb.kisiek.net//repo/10.0/ubuntu trusty main' | |
sudo add-apt-repository ppa:nginx/stable | |
sudo apt-get update | |
sudo apt-get install htop nginx-extras mariadb-server ntp php5 php5-fpm php5-mysql php5-gd php5-cli php5-curl libssh2-php rsync ufw unzip | |
# Start services | |
sudo service nginx start | |
sudo service mysql start | |
sudo service php5-fpm start | |
# Tweak PHP settings | |
sudo sed -i "s/^expose_php = On/expose_php = Off/g" /etc/php5/fpm/php.ini | |
sudo sed -i "s/^;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php5/fpm/php.ini | |
sudo sed -i "s/^session.gc_probability = 0/session.gc_probability = 1/g" /etc/php5/fpm/php.ini | |
sudo sed -i "s/^;display_errors = Off/display_errors = Off/g" /etc/php5/fpm/php.ini | |
sudo sed -i "s/^max_input_time = -1/max_input_time = 60/g" /etc/php5/fpm/php.ini | |
sudo sed -i "s/^disable_functions = /disable_functions = passthru,shell_exec,proc_open,popen,show_source,/g" /etc/php5/fpm/php.ini | |
sudo sed -i "s/^;listen.mode = 0660/listen.mode = 0660/g" /etc/php5/fpm/pool.d/www.conf | |
sudo service php5-fpm restart | |
# Setup MariaDB | |
sudo killall mysqld | |
sudo rm /var/lib/mysql/aria_log_control | |
sudo mysql_install_db | |
sudo service mysql start | |
sudo mysql_secure_installation | |
# Clock | |
sudo dpkg-reconfigure tzdata | |
sudo ntpdate pool.ntp.org | |
sudo service ntp start | |
# Set swap and reboot | |
sudo chmod 600 /swapfile | |
sudo chown root:root /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo sh -c 'echo "/swapfile none swap sw 0 0" >> /etc/fstab' | |
sudo sysctl -w vm.swappiness=15 | |
sudo sh -c 'echo "vm.swappiness = 15" >> /etc/sysctl.conf' | |
sudo reboot | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment