Skip to content

Instantly share code, notes, and snippets.

@lighta971
Created January 5, 2014 23:05
Show Gist options
  • Save lighta971/8275306 to your computer and use it in GitHub Desktop.
Save lighta971/8275306 to your computer and use it in GitHub Desktop.
#subdomain name
echo -n "Name of your subdomain ?"
read -e subdomain
if [[ $subdomain != "" ]]
then
mkdir ~/$subdomain
sudo touch /etc/apache2/sites-available/$subdomain
sudo echo "<Virtualhost *:80>" >> /etc/apache2/sites-available/$subdomain
sudo echo " ServerName $subdomain.username.kd.io" >> /etc/apache2/sites-available/$subdomain
sudo echo " DocumentRoot ~/$subdomain" >> /etc/apache2/sites-available/$subdomain
sudo echo "</Virtualhost>" >> /etc/apache2/sites-available/$subdomain
sudo a2ensite $subdomain
sudo service apache2 reload
fi
echo "Done! Now go to your profil and add the new subdomain!"
@davidtsong
Copy link

Is the username dynamic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment