Created
January 5, 2014 23:05
-
-
Save lighta971/8275306 to your computer and use it in GitHub Desktop.
Create subdomain on Koding.com http://learn.koding.com/koding-subdomains-and-vhosts/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is the username dynamic?