Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # script screazione virtual host nuovo.sh nomesito
- # nuovo.sh nomesito pub
- sudo -v
- if [ "$2" == "pub" ]
- then
- echo "Creazione virtualhost: $1 con webroot in $HOME/www/$1/public/" #con cartella che punta in www/pub
- sudo cp /etc/apache2/sites-available/template-pub /etc/apache2/sites-available/$1
- else
- echo "Creazione virtual host: $1 con webroot in in $HOME/www/$1/" #con cartella in home/www/
- sudo cp /etc/apache2/sites-available/template /etc/apache2/sites-available/$1
- fi
- sudo sed -i 's/template/'$1'/g' /etc/apache2/sites-available/$1
- sudo sed -i '1s/^/127.0.0.1 '$1'.local\n/' /etc/hosts
- sudo a2ensite $1
- sudo service apache2 reload
- echo "Host $1 Creato!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement