Get the App
SLTechnology News&Howtos  ›  Servers  › 

Deploy the underlying LAMP architecture with one click using the Shell script

Shulou Source: shulou.com Published: 2022-06-02 23:50:12 09月30日 Update

Deploy the underlying LAMP architecture with one click using the Shell script

Installation order: apache → mysql → PHP

Software package needed for experiment: link: https://pan.baidu.com/s/1tKAjqn50NnR7F3JmzyHF1w extraction code: 1xpr

#! / bin/bash# automatically builds LAMP architecture with one click (use source to execute or use. Command execution) # Database default password is 12312remote mount df-hT | grep-o "cifs" if [$?-ne 0]; thenecho "Start mount" yum install expect-yread-p "enter the host IP:" gongip/usr/bin/expect / etc/profilesource / etc/profileecho $PATH | grep-o "mysql" if [$?-eq 0] Then echo "add success" else echo "failed" exit 1fiuseradd-s / sbin/nologin mysqlchown-R mysql:mysql / usr/local/mysql//usr/local/mysql/scripts/mysql_install_db\-- user=mysql\-- ldata=/var/lib/mysql\-- basedir=/usr/local/mysql\-- datadir=/home/mysqlsed-I-e '47d'-e' 46d'-e '45abasedir=/usr/local/mysql\ ndatadir=/home/mysql' / Etc/init.d/mysqldservice mysqld startnetstat-ntuap | grep mysqldif [$?-eq 0] Then echo Mysql database startup else echo startup failed exit 1 fi#read-p "Please enter database password (custom):" mima/usr/bin/expect

Tags: Architecture script data database one-click password input foundation success host command lab hard disk software software package link error sequence lab Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Redmi OPPO Reno Shulou Technology macOS