Skip to content

Instantly share code, notes, and snippets.

@Sanjay007
Last active December 19, 2022 08:13
Show Gist options
  • Save Sanjay007/af2d1fe23846f2930d894e7babcfafe6 to your computer and use it in GitHub Desktop.
Save Sanjay007/af2d1fe23846f2930d894e7babcfafe6 to your computer and use it in GitHub Desktop.
Setup Virtual Host Ubuntu Using Apache2
sudo mkdir -p /var/www/inhireapp.com/public_html
sudo chown -R $USER:$USER /var/www/inhireapp.com/public
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/example.com.conf'
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
sudo a2ensite example.com.conf
sudo a2ensite test.com.conf
sudo a2dissite 000-default.conf
sudo systemctl restart apache2
https://thelinuxterminal.com/how-to-install-apache-server-ubuntu-22-10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment