Installing LAMP on Ubuntu 16.04 (Xenial Xerus)
# enable ssl module for apache2
a2enmod ssl
# create symlink to sites-enabled from sites-available
a2ensite default-ssl
# remove symlink from sites-enabled
a2dissite default-ssl
=========
# uncomment in /etc/apache2/apache2.conf
<Directory /srv/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# vi /etc/php/7.0/apache2/php.ini
upload_max_filesize = 100M
post_max_size = 100M
# /etc/php/7.0/apache2/php.ini
opcache.enable=1
opcache.memory_consumption=128
opcache.max_accelerated_files=4000
opcache_revalidate_freq = 240
# phpenmod opcache
service apache2 restart
# setup basic firewall UFW
sudo ufw app list
sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw status
### Mysql
# Step 1: Update your system by typing the following command
sudo apt update
sudo apt dist-upgrade
# Step 2: Install mysql version 5.7 on Ubuntu 16.04
sudo apt install mysql-server
# Step 3: Run mysql_secure_installation to secure your installation
sudo mysql_secure_installation
### Apache
# Step 1: install apache
apt install apache2
# If you look at the Apache Full profile, it should show that it enables traffic to ports 80 and 443:
sudo ufw app info "Apache Full"
# Allow incoming traffic for this profile:
sudo ufw allow in "Apache Full"
sudo ufw allow in "OpenSSH"
# fiing error: apache2: Could not reliably determine the server's fully qualified domain name
touch /etc/apache2/conf-available/servername.conf
# put inside servername.conf
ServerName srv.webium.me
# assuming you called the file added to conf-available on step 1 'servername.conf'
sudo a2enconf servername
# turn on mods for drupal
a2enmod rewrite headers
# install unzip
apt install unzip
service apache2 reload
### PHP
sudo apt install php libapache2-mod-php php-mcrypt php-mysql
# move index.php to the start of line
vi /etc/apache2/mods-enabled/dir.conf
# install required by drupal php modules
apt install php7.0-curl php7.0-xml php7.0-gmp php7.0-gd php7.0-mbstring php7.0-xmlrpc php7.0-zip
# you can search for php modules this way
apt-cache search php7.0 | less
# restart apache2
service apache2 restart