Skip to content

Instantly share code, notes, and snippets.

View MathieuLescure's full-sized avatar

Mathieu Lescure MathieuLescure

View GitHub Profile
@MathieuLescure
MathieuLescure / newsite.sh
Last active December 22, 2015 20:19
A shell script to add and configure a new web site on a Linode with Debian 7. A Git repository with a hook to automatically deploy the site is also created. Prerequisite: The folder /srv/www_git exist The user belongs to the group "developers" (sudo groupadd developers && sudo usermod -G developers -a [username]) Usage: sudo newsite.sh www.mydom…
#!/bin/sh
WWW_ROOT_DIR=/srv/www/$1
WWW_LOGS_DIR=${WWW_ROOT_DIR}/logs
WWW_HTML_DIR=${WWW_ROOT_DIR}/public_html
mkdir $WWW_ROOT_DIR
mkdir $WWW_LOGS_DIR
mkdir $WWW_HTML_DIR
chown root:developers $WWW_HTML_DIR
chmod g+w $WWW_HTML_DIR