A school project where we have to create a virtual environment that allows 'customers' to have individual webspaces.
From: https://github.com/SpengeSec/Multi-user-vHost-Script
Script to create Apache2 virtualhost for multiple users individually.
This script does the following:
- Creates a new user
- Assings it the www-data group
- Creates a new virtualhost directory in /var/vhosts/
- Creates a valid virtualhost configuration in /etc/apache2/sites-available/<domain.com.conf>
- Enables this vhost config
- Reloads the Apache2 service
- Creates a default index.html page
- Creates a symbolic link from /var/vhosts to /home/ for FTP purposes.
Usage: sudo bash vhost.sh <username> <password> <domain.com>
Example output: