Advertisement
Guest User

Untitled

a guest
May 24th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.40 KB | None | 0 0
  1. #!/bin/bash
  2. # This script must be run as root.
  3.  
  4. echo 'This script must be run as root.'
  5. su
  6.  
  7. echo '192.168.10.210 alpha.dyncomp.local alpha' >> /etc/hosts &&
  8. dnf -y install nfs-utils autofs &&
  9. sed -i '/#Domain = /a #Domain = dyncomp.local' /etc/idmapd.conf &&
  10. systemctl start rpcbind &&
  11. systemctl enable rpcbind &&
  12.  
  13. mkdir -p /srv/alpha/{archive,shares,repository,backups} &&
  14.  
  15. mount -t nfs alpha:/mnt/data/archive/ /srv/alpha/archive/ &&
  16. mount -t nfs alpha:/mnt/data/shares/ /srv/alpha/shares/ &&
  17. mount -t nfs alpha:/mnt/data/repository/ /srv/alpha/repository/ &&
  18. mount -t nfs alpha:/mnt/data/backups/ /srv/alpha/backups/ &&
  19.  
  20. echo '/-    /etc/auto.mount' >> /etc/auto.master &&
  21.  
  22. echo 'alpha:/mnt/data/archive/ /srv/alpha/archive/                       nfs     defaults        0 0' >> /etc/fstab &&
  23. echo 'alpha:/mnt/data/shares/ /srv/alpha/shares/                       nfs     defaults        0 0' >> /etc/fstab &&
  24. echo 'alpha:/mnt/data/repository/ /srv/alpha/repository/                       nfs     defaults        0 0' >> /etc/fstab &&
  25. echo 'alpha:/mnt/data/backups/ /srv/alpha/backups/                       nfs     defaults        0 0' >> /etc/fstab &&
  26.  
  27. echo '/srv/alpha/archive -fstype=nfs,rw  alpha:/mnt/data/archive' >> /etc/auto.mount &&
  28. echo '/srv/alpha/shares -fstype=nfs,rw  alpha:/mnt/data/shares' >> /etc/auto.mount &&
  29. echo '/srv/alpha/repository -fstype=nfs,rw  alpha:/mnt/data/repository' >> /etc/auto.mount &&
  30. echo '/srv/alpha/backups -fstype=nfs,rw  alpha:/mnt/data/backups' >> /etc/auto.mount &&
  31.  
  32. systemctl start autofs &&
  33. systemctl enable autofs &&
  34.  
  35. dnf install mariadb mariadb-server &&
  36. systemctl start mariadb.service &&
  37. systemctl enable mariadb.service &&
  38.  
  39. echo 'Secure MariaDB' &&
  40. /usr/bin/mysql_secure_installation
  41.  
  42. dnf -y install httpd php php-common &&
  43. dnf -y install php-pecl-apcu php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongodb php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml &&
  44. systemctl start httpd.service
  45. #mysqladmin -u root password [your_password_here]
  46.  
  47. dnf -y install phpMyAdmin php-mysqlnd php-mcrypt php-php-gettext &&
  48. echo 'Enter the lines below into mysql' &&
  49. echo "update user set plugin='' where user='root';" &&
  50. echo 'flush privileges;' &&
  51. echo exit  &&
  52.  
  53. mysql -u root -p mysql
  54.  
  55. echo '<?php phpinfo(); ?>' > /var/www/html/test.php &&
  56.  
  57. systemctl restart httpd
  58.  
  59. echo 'Test phpMyadmin, http://localhost/phpMyAdmin/'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement