监控端操作
#!/bin/bash
lamp(){
systemctl stop firewalld.service
systemctl disable firewalld.service &> /dev/null
setenforce 0
sed -i "7cSELINUX=disabled" /etc/sysconfig/selinux
yum install -y \
httpd \
mariadb-server mariadb \
php \
php-mysql \
php-gd \
libjpeg* \
php-ldap \
php-odbc \
php-pear \
php-xml \
php-xmlrpc \
php-mhash \
expect
sed -i -e "95aServerName www.kgc.com" -e "/DirectoryIndex/s/index.html/index.html index.php/" /etc/httpd/conf/httpd.conf
sed -i "878cdate.timezone = PRC" /etc/php.ini
systemctl start httpd.service
systemctl enable httpd.service
systemctl start mariadb.service
systemctl enable mariadb.service
/usr/bin/expect <<EOF
spawn mysqladmin -u root -p password 123123
expect {
"Enter*"
{send "\r"}
}
expect eof
EOF
}
service httpd