Setup https://www.liquidweb.com/kb/configure-apache-virtual-hosts-ubuntu-18-04/?irgwc=1&clickid=QgCxlm1W8xyOR%3AdwUx0Mo34BUkBWwRXL0RdISI0&iradid=278394&irpid=269814&sharedid=758569e3e537cb06600256e489557d51&_ir=1&utm_medium=affiliate #Step 1: Make a Directory for Each Site ``` sudo mkdir -p /var/www/domain.com/public_html ``` #Step 2: Set Folder Permissions ``` sudo chmod -R 755 /var/www ``` if you are having problems with permissions just open it up and revoke access after (by running the first command above) ``` sudo chmod ugo+wrx -R /var/www ``` #Step 3: Set up an Index Page ``` sudo nano /var/www/domain.com/public_html/index.html #testing for domain.com ``` #Step 4: Copy the Config File for Each Site ``` cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/domain.com.conf ``` #Step 5: Edit the Config File for Each Site ``` sudo nano /etc/apache2/sites-available/domain.com.conf ``` ``` ServerAdmin admin@example.com ServerName domain.com ServerAlias www.domain.com DocumentRoot /var/www/domain.com/public_html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined ``` #Step 6: Enable Your Config File So, we will need to disable the default file. ``` a2dissite 000-default.conf ``` Enable new: ``` a2ensite domain.com.conf ``` restart service: ``` systemctl restart apache2 ``` #Step 7: Verify Apache Configurations