2-apache-php74-mysql.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/bash
  2. # Author: admin@serverok.in
  3. # Web: https://serverok.in
  4. export DEBIAN_FRONTEND=noninteractive
  5. apt-get -y install apache2
  6. apt -y install libapache2-mod-ruid2
  7. systemctl enable apache2
  8. a2enmod rewrite
  9. a2enmod ssl
  10. a2enmod headers
  11. sed -i 's/#Mutex file:..APACHE_LOCK_DIR. default/Mutex posixsem/g' /etc/apache2/apache2.conf
  12. apt-get install software-properties-common
  13. add-apt-repository ppa:ondrej/php
  14. apt -y upgrade
  15. apt install -y php7.4
  16. apt install -y php7.4-bcmath php7.4-bz2 php7.4-cgi php7.4-cli php7.4-common php7.4-curl php7.4-dba php7.4-dev php7.4-enchant php7.4-gd php7.4-gmp php7.4-imap php7.4-intl php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-pgsql php7.4-pspell php7.4-readline php7.4-soap php7.4-sqlite3 php7.4-sybase php7.4-tidy php7.4-xml php7.4-xmlrpc php7.4-zip php7.4-xsl php7.4-gmp php7.4-imagick
  17. apt install -y libapache2-mod-php7.4
  18. a2enmod php7.4
  19. service apache2 restart
  20. apt-get -y install mariadb-client mariadb-server
  21. systemctl enable mariadb
  22. apt install automysqlbackup -y
  23. echo "postfix postfix/mailname string `hostname`" | debconf-set-selections
  24. echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections
  25. apt-get install -y postfix
  26. systemctl enable apache2
  27. systemctl restart apache2
  28. apt install -y monit
  29. ln -s /etc/monit/conf-available/apache2 /etc/monit/conf-enabled/
  30. ln -s /etc/monit/conf-available/mysql /etc/monit/conf-enabled/
  31. systemctl enable monit
  32. systemctl start monit