#!/bin/sh apt-get --yes install libapache2-mod-php5 php5-mysql mysql-server php-mail /etc/init.d/apache2 restart # hint: remove ! in the next line to reset mysql pw if ! true; then /etc/init.d/mysql stop mysqld --skip-grant-tables & sleep 3 mysql <<'EOT' UPDATE mysql.user SET Password=PASSWORD('') WHERE User='root'; FLUSH PRIVILEGES; EOT /etc/init.d/mysql restart fi rm -rf /var/www/lms wget -qO- http://www.lms.org.pl/download/1.11/lms-1.11.13.tar.gz|tar xzvC /var/www mkdir -p /etc/lms cp -v /var/www/lms/sample/lms.ini /etc/lms cp -v /var/www/lms/sample/lms-mgc.ini /etc/lms perl -pi -e 's/;.*(user.*=).*mysql/\1 lms/' /etc/lms/lms.ini #mysql -u[user name with database creation rights] -p mysql -uroot <<'EOT' drop database if exists lms; #CREATE DATABASE lms CHARACTER SET utf8 COLLATE utf8_polish_ci; CREATE DATABASE lms CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT USAGE ON lms.* TO lms@localhost; #GRANT ALL ON lms.* TO lms@localhost IDENTIFIED BY '[your_password]'; GRANT ALL ON lms.* TO lms@localhost; flush privileges; use lms; source /var/www/lms/doc/lms.mysql; EOT echo use http://localhost/lms