|
sudo apt-get update |
|
sudo apt-get install apache2 -y |
|
sudo a2enmod rewrite mime expires |
|
sudo apt-get install mysql-server -y # Will ask root password twice. |
|
# Configure to allow remote connections. |
|
sudo apt-get install software-properties-common -y |
|
sudo add-apt-repository ppa:ondrej/php -y |
|
sudo apt-get update |
|
sudo apt-get install php5.6 -y |
|
sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml php5.6-curl php5.6-gd php5.6-pdo-mysql php5.6-xml php5.6-xsl -y |
|
sudo apt-get install zip unzip -y |
|
sudo add-apt-repository ppa:certbot/certbot -y |
|
sudo apt-get update |
|
sudo apt-get install python-certbot-apache -y |
|
|
|
# Install and activate mod_pagespeed |
|
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb |
|
sudo dpkg -i mod-pagespeed-*.deb |
|
sudo apt-get -f install |
|
sudo nano /etc/apache2/mods-enabled/pagespeed.conf |
|
# Change the following parameter as follows in the pagespeed configuration file. |
|
# ModPagespeedDisableFilters extend_cache |
|
sudo service apache2 restart |
|
|
|
# Configure permissions. |
|
sudo nano /etc/apache2/envvars |
|
# Add "umask 002" to the end of the file. Save and exit. |
|
sudo usermod -a -G www-data {{user}} |
|
|
|
# Setup Composer |
|
sudo bash composer-setup.sh |
|
sudo mv composer.phar /usr/local/bin/composer |
|
|
|
# Setup a virtual host. Repeat this section for each virtual host you want to create. |
|
sudo mkdir -p /var/www/example.com/public_html |
|
sudo mkdir -p /var/www/example.com/logs |
|
sudo chgrp -R www-data /var/www/example.com/public_html |
|
sudo chgrp -R www-data /var/www/example.com/logs |
|
sudo chmod 2770 /var/www/example.com/public_html |
|
sudo chmod 2770 /var/www/example.com/logs |
|
# deprecated: find /var/www -type d -exec chmod 2775 {} + |
|
# deprecated: find /var/www -type f -exec chmod 0664 {} + |
|
# deprecated: "sudo nano .bashrc" and add "umask 0002" at the end of the file. |
|
|
|
# Upload files... |
|
|
|
sudo nano /etc/apache2/sites-available/example.com.conf |
|
sudo a2ensite example.com.conf |
|
sudo service apache2 reload |
|
|
|
# Make the DNS change. |
|
|
|
# Setup SSL Certificate with Letsencrypt (if you prefer.) |
|
sudo certbot --apache -d example.com -d www.example.com |
|
|
|
# Log out and log in if you can not cd into a public_html directory. |