Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sabrysuleiman/098bf389f9b28df2ac7d8c0b40b54470 to your computer and use it in GitHub Desktop.
Save sabrysuleiman/098bf389f9b28df2ac7d8c0b40b54470 to your computer and use it in GitHub Desktop.
Set Up Apache Virtual Hosts on Ubuntu
# Set Up Apache Virtual Hosts on Ubuntu
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/domain.conf
sudo nano /etc/apache2/sites-available/domain.conf
ServerAdmin webmaster@localhost
ServerName your_domain_1
ServerAlias www.your_domain_1
DocumentRoot /var/www/html
sudo a2ensite domain.conf
sudo apache2ctl configtest
sudo systemctl restart apache2
sudo systemctl status apache2
sudo nano /etc/hosts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment