A simple Bash script for creating a standard structure for all websites. Very usefull if are going to manage a webserver without Cpanel or similar software.
It creates a new folder in /var/www/SITENAME/public_html (or wherever you want, just edit the configuration file), with a user assigned (as home) and a log directory inside it (with all logs symlinked to /var/log folder). It also generates the virtual host file for apache and reload the apache service.
At the end of the process creates an index.html page, based on the configuration template files.
git clone https://github.com/CRYX2/Automatic-web-root-generator.git awrg
sudo mv awrg /etc/awrg
sudo chmod +x /etc/awrg/add_vhost.sh
sudo ln -s /etc/awrg/add_vhost.sh /usr/local/sbin/add_vhost
sudo cp /etc/awrg/awrg.cnf.DEFAULT /etc/awrg/awrg.cnf
sudo vi /etc/awrg/awrg.cnf
Check all settings for reflecting your configuration
sudo add_vhost
Enjoy :)
PS. Actually it works only with bash, NOT with fish or zsh