Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo "Informe o nome do server (Ex.: project.dev) :"
- read server
- echo "Informe o caminho do site (Ex.: /var/www/project-directory) :"
- read path
- echo "Criando configuraรงรฃo de VHost para o server..."
- echo "
- <VirtualHost *:80>
- ServerAdmin webmaster@localhost
- ServerName $server
- ServerAlias www.$server
- DocumentRoot "$path"
- <Directory "$path">
- Options Indexes FollowSymLinks MultiViews
- AllowOverride All
- Order allow,deny
- Allow from all
- </Directory>
- </VirtualHost>
- " > /etc/apache2/sites-available/$server.conf
- echo "Ativando VHOST $server"
- ln -s /etc/apache2/sites-available/$server.conf /etc/apache2/sites-enabled/$server.conf
- echo "Atualizando arquivo hosts"
- echo "127.0.1.1 $server www.$server" >> /etc/hosts
- echo "Reiniciando apache";
- /etc/init.d/apache2 restart
- echo "VHOST criado sucesso.";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement