2-nginx-php74-mysql.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. # Author: admin@serverOk.in
  3. # Web: https://serverok.in
  4. export DEBIAN_FRONTEND=noninteractive
  5. apt install -y software-properties-common
  6. add-apt-repository ppa:ondrej/php
  7. apt update
  8. apt -y upgrade
  9. apt update
  10. apt -y install nginx
  11. apt -y install php7.4-cli php7.4-curl php7.4-gd php7.4-mysql php7.4-imagick php7.4-imap php7.4-json \
  12. php7.4-xml php7.4-mbstring php7.4-zip php7.4-xmlrpc php7.4-soap php7.4-intl php7.4-bcmath \
  13. php7.4-fpm
  14. apt -y install mariadb-client mariadb-server
  15. echo "postfix postfix/mailname string `hostname`" | debconf-set-selections
  16. echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections
  17. apt-get install -y postfix
  18. apt install automysqlbackup -y
  19. systemctl enable mysql
  20. systemctl restart mysql
  21. systemctl enable nginx
  22. systemctl restart nginx
  23. systemctl enable php7.4-fpm
  24. systemctl restart php7.4-fpm
  25. apt install -y monit
  26. ln -s /etc/monit/conf-available/nginx /etc/monit/conf-enabled/
  27. ln -s /etc/monit/conf-available/mysql /etc/monit/conf-enabled/
  28. systemctl enable monit
  29. systemctl start monit