Last active
November 13, 2017 00:12
-
-
Save ferndot/45c007d2ed3cd58ef3ea15b2e6470bef to your computer and use it in GitHub Desktop.
Configures LAMP and other useful things on a fresh Debian 9 install
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
# Update Debian and installed packages | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y dist-upgrade | |
# Install curl, etckeeper, and LAMP | |
apt-get install -y curl etckeeper apache2 mariadb-server mariadb-client mariadb-common php php-dev php-mysqli python-certbot-apache sendmail | |
# Configure apache2 | |
a2enmod rewrite headers | |
systemctl restart apache2 | |
# Install mod_pagespeed | |
curl -O https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb | |
dpkg -i mod-pagespeed-*.deb | |
apt-get -f install | |
rm mod-pagespeed-*.deb | |
# Start apache2 and mariadb if not already active | |
systemctl start {apache2,mariadb} | |
# Configure mysql (mariadb) | |
mysql_secure_installation | |
# Configure sendmail | |
sendmailconfig | |
# Install and configure phpmyadmin | |
apt-get install -y phpmyadmin | |
echo Include /etc/phpmyadmin/apache.conf >> /etc/apache2/apache2.conf | |
systemctl restart apache2 | |
# Configure auto backup for databases | |
apt-get install -y automysqlbackup | |
# Set up a new non-root user with sudo and www-data | |
read -p "Name the new non-root user > " username && adduser $username | |
apt-get install -y sudo | |
usermod -a -G sudo $username | |
usermod -a -G www-data $username | |
systemctl restart ssh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment