Deploy multiple websites using apache on Ubuntu 16.04

Steps

  1. Redirect custom domain DNS's A record to new server ip address
  2. Create website directory. For example static websites could be placed in /etc/www/example.com/public_html
  3. Create a dummy index.html test file
  4. Update server file in /etc/apache2/sites-available, if using apache 2 copy standard template 000-domain.conf and update configuration
  5. Enter commands to enable site (this actually creates a sym-link in sites-enabled folder) and restart apache
  6. Consider changing the host file on local computer - because DNS propagation can take upto 24hrs
  7. Test
  8. Pull repo to server, note you may want to enter 'git clone {repo address} .' so it copies files into current folder and doesn't create another subfolder

References

Tags: