Last active
March 27, 2017 11:22
-
-
Save nicolaubrasil/42ff4051bb2d2af3a141af5e4f5edea8 to your computer and use it in GitHub Desktop.
Automatização na criação de VHOST
This file contains hidden or 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
#!/bin/bash | |
#1 | |
echo "Informe o nome do servidor (Ex.: siteexemplo) :" | |
read vhost | |
#2 | |
echo "Informe o caminho do site (Ex.: /var/www/sitexemplo) :" | |
read path | |
#3 | |
echo "Criando configuração de VHost para o servidor" | |
echo "<VirtualHost *:80> | |
DocumentRoot /Users/nicolau/Desenvolvimento/Web/$path | |
ServerName $vhost | |
</VirtualHost>" > /etc/apache2/extra/httpd-vhosts.conf | |
#4 | |
echo "Atualizando arquivo hosts" | |
echo "127.0.0.1 $vhost" >> /etc/hosts | |
#5 | |
echo "Reiniciando apache"; | |
apachectl restart | |
echo "VHOST criado"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment