Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ########### USER ######################################
- #création + groupes + droits + home
- mkpasswd $pass
- useradd -m -p $cryptedpass $username
- mkdir /home/$username/www
- chown -R $username:www-data /home/$username
- chmod -R 775 /home/$username
- usermod -a -G $username www-data
- ########### APACHE #####################################
- #Virtual host associé (via template)
- cp $templateVhost /etc/apache2/sites-available/$username
- ... changer les hosts du template... (sed -e 's/\<host\>/$username/g' ?)
- #blong blong ^^
- a2ensite $username
- /etc/init.d/apache2 reload
- ########### MYSQL #####################################
- #création de la base
- mysqladmin -u root -p$passroot create $basename
- #donner les privilèges sur cette base à un user en créant un mdp
- mysql -u root --password=$passroot mysql <<END_COMMANDS
- GRANT ALL PRIVILEGES ON $basename.* TO "$username@localhost" IDENTIFIED BY '$pass';
- FLUSH PRIVILEGES;
- END_COMMANDS
- #blong blong ^^
- mysqladmin -u root -p$passroot reload
- # un vrai cerveau de poisson rouge ce touriste ^^
Add Comment
Please, Sign In to add comment