daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Jun 29th, 2018 106 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ########### USER ######################################
  2. #création + groupes + droits + home
  3. mkpasswd $pass
  4. useradd -m -p $cryptedpass $username
  5. mkdir /home/$username/www
  6. chown -R $username:www-data /home/$username
  7. chmod -R 775 /home/$username
  8. usermod -a -G $username www-data
  9.  
  10.  
  11. ########### APACHE #####################################
  12. #Virtual host associé (via template)
  13. cp $templateVhost /etc/apache2/sites-available/$username
  14. ... changer les hosts du template... (sed -e 's/\<host\>/$username/g' ?)
  15.  
  16. #blong blong ^^
  17. a2ensite $username
  18. /etc/init.d/apache2 reload
  19.  
  20.  
  21. ########### MYSQL #####################################
  22. #création de la base
  23. mysqladmin -u root -p$passroot create $basename
  24.  
  25. #donner les privilèges sur cette base à un user en créant un mdp
  26. mysql -u root --password=$passroot mysql <<END_COMMANDS
  27. GRANT ALL PRIVILEGES ON $basename.* TO "$username@localhost" IDENTIFIED BY '$pass';
  28. FLUSH PRIVILEGES;
  29. END_COMMANDS
  30.  
  31. #blong blong ^^
  32. mysqladmin -u root -p$passroot reload
  33.  
  34.  
  35. # un vrai cerveau de poisson rouge ce touriste ^^
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top