Summary
- Make a directory /var/www/html/my_site
- Edit hosts file /etc/hosts (127.0.0.1 www.my_site.loc)
- Make virtual host entry in /etc/apache2/sites-available/my_site.conf
- Activate site with a2ensite – sudo a2ensite my_site.conf
- Change owner of directory to www-data
- Change permissions of directories to 755
- Restart apache with sudo systemctl restart apache2
Commands
Create directory
mkdir /var/www/html/my_site
edit hosts file
sudo nano /etc/hosts
edit virtual host
sudo nano /etc/apache2/sites-available/my_site
ServerName normal_local_site.loc ServerAlias www.normal_local_site.loc DocumentRoot /var/www/html/normal_local_site ErrorLog ${APACHE_LOG_DIR}/normal_local_site.error.log CustomLog ${APACHE_LOG_DIR}/normal_local_site.access.log combined AllowOverride All
activate site
sudo a2ensite my_site
check configuration
apachectl configtest
outputs information
apachectl -S
Change owner of website directory
$ sudo chown -R www-data:www-data /var/www/html/my_site
change permissions
sudo chmod -R 775 /var/www/html/my_site
download and unzip wordpress
wget -c http://wordpress.org/latest.tar.gz
$ tar -xzvf latest.tar.gz
restart apache
sudo service apache2 restart
sudo systemctl restart apache2