User Tools

Site Tools


aws:apache

This is an old revision of the document!


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

``` #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 ``` ``` <VirtualHost *:80> 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 </VirtualHost> ```

#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

aws/apache.1632170272.txt.gz · Last modified: by ltsover9000