Skip to content

Instantly share code, notes, and snippets.

@kzkamiya
Last active November 7, 2016 14:33
Show Gist options
  • Save kzkamiya/627252fe17caf389edd02d3b12a6011c to your computer and use it in GitHub Desktop.
Save kzkamiya/627252fe17caf389edd02d3b12a6011c to your computer and use it in GitHub Desktop.
install moodle to centos 6.8.
#!/bin/bash
##<INSTALL>
rpm -ivh http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
yum install -y wget make gcc openssl-devel lsof file tar zip unzip gzip gunzip tr yum cat ls find ps vi top which sed rpm passwd logrotate iptables grep man bash ntp httpd mysql-server expect
yum -y install php php-devel mod_auth_mysql php-mysql php mbstring php-gd perl-Net-SSLeay php-mbstring php-xmlrpc php-soap php-intl php-pear php-devel httpd-devel --enablerepo=remi
pecl install ZendOpcache
iptables -L --line-numbers
iptables -I INPUT 5 -p tcp -m tcp --dport 80 -j ACCEPT
iptables -I INPUT 6 -p tcp -m tcp --dport 443 -j ACCEPT
service iptables save
chkconfig httpd on
chkconfig mysqld on
service mysqld start
service httpd start
wget https://download.moodle.org/download.php/direct/stable31/moodle-latest-31.zip
mv moodle-latest-31.zip /var/www/html
cd /var/www/html
unzip moodle-latest-31.zip
chown -R apache:apache /var/www/html/moodle
cd ..
mkdir moodledata
chmod 0777 moodledata/
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h 127.0.0.1 password 'new-password'
vi /etc/php.ini
[opcache]
zend_extension=/usr/lib64/php/modules/opcache.so
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
##<EOF>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment