Last active
September 5, 2015 08:31
-
-
Save tkuchiki/0ffba4ffc7b80c45f68c to your computer and use it in GitHub Desktop.
isucon4 ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update | |
apt-get remove -y nano | |
echo "mysql-server-5.5 mysql-server/root_password password isucon" | debconf-set-selections | |
echo "mysql-server-5.5 mysql-server/root_password_again password isucon" | debconf-set-selections | |
apt-get install -y mysql-server mysql-common mysql-client | |
mysql -u root --password=isucon -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');" | |
mysql -u root -e "GRANT ALL PRIVILEGES ON isu4_qualifier.* TO isucon@localhost IDENTIFIED BY 'isucon' WITH GRANT OPTION" | |
apt-get install -y nginx | |
apt-get install -y build-essential libxml2-dev libmysqld-dev libssl-dev libreadline-dev pkg-config vim curl git | |
useradd -d /home/isucon -m isucon | |
git clone https://github.com/sstephenson/ruby-build.git /usr/local/ruby-build | |
cd /usr/local/ruby-build | |
./install.sh | |
mkdir -p /home/isucon/.local | |
chown -R isucon: /home/isucon/.local | |
/usr/local/bin/ruby-build 2.1.3 /home/isucon/.local/ruby | |
git clone https://github.com/isucon/isucon4 /home/isucon/isucon4 | |
mv /home/isucon/isucon4/qualifier/* /home/isucon/ | |
cp /home/isucon/ami/files/env.sh /home/isucon/ | |
cp /home/isucon/ami/files/nginx.conf /etc/nginx/ | |
cp /home/isucon/ami/files/my.cnf /etc/ | |
chmod 755 /home/isucon/env.sh | |
/home/isucon/env.sh gem install --no-document foreman bundler | |
cd /home/isucon/webapp/ruby | |
/home/isucon/env.sh bundle install | |
chown -R isucon: /home/isucon/* | |
service nginx restart | |
service mysql restart | |
service irqbalance start | |
wget https://storage.googleapis.com/golang/go1.3.linux-amd64.tar.gz | |
tar -C /usr/local -xzf go1.3.linux-amd64.tar.gz | |
ln -s /usr/local/go/bin/go /usr/bin/ | |
rm -f go1.3.linux-amd64.tar.gz | |
/home/isucon/env.sh gem install --no-document gondler -v 0.2.0 | |
cd /home/isucon/benchmarker | |
/home/isucon/env.sh make debug | |
mv /home/isucon/benchmarker /tmp/ | |
mv /tmp/benchmarker/benchmarker /home/isucon/ | |
apt-get install -y supervisor | |
head -n 26 /home/isucon/ami/files/supervisord.conf > /etc/supervisor/supervisord.conf | |
sed -i -e 's/wheel/root/' /etc/supervisor/supervisord.conf | |
service supervisor restart | |
cd /home/isucon | |
./init.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nginx_conf=/etc/nginx | |
nginx_logdir=/var/log/nginx | |
nginx_tmp=/var/lib/nginx/tmp | |
nginx_cache=/var/cache/nginx | |
apt-get install -y libpcre3 libpcre3-dev libxml2-dev libxslt1-dev libgd2-dev libgeoip-dev perl-base perl-modules libperl-dev | |
mkdir -p /var/lib/nginx/tmp/client_body | |
chown nginx: /var/lib/nginx/tmp/client_body | |
mkdir /var/cache/nginx | |
mkdir -m 700 /var/cache/nginx/{fastcgi_temp,scgi_temp,uwsgi_temp} | |
chown nginx: /var/cache/nginx/* | |
./configure \ | |
--prefix=${nginx_dir} \ | |
--conf-path=${nginx_conf}/nginx.conf \ | |
--sbin-path=/usr/sbin/nginx \ | |
--http-log-path=${nginx_logdir}/access.log \ | |
--error-log-path=${nginx_logdir}/error.log \ | |
--pid-path=/var/run/nginx.pid \ | |
--lock-path=/var/lock/subsys/nginx \ | |
--http-client-body-temp-path=${nginx_tmp}/client_body \ | |
--http-proxy-temp-path=${nginx_tmp}/proxy \ | |
--http-fastcgi-temp-path=${nginx_cache}/fastcgi_temp \ | |
--http-uwsgi-temp-path=${nginx_cache}/uwsgi_temp \ | |
--http-scgi-temp-path=${nginx_cache}/scgi_temp \ | |
--user=nginx \ | |
--group=nginx \ | |
--with-file-aio \ | |
--with-ipv6 \ | |
--with-http_ssl_module \ | |
--with-http_realip_module \ | |
--with-http_addition_module \ | |
--with-http_xslt_module \ | |
--with-http_image_filter_module \ | |
--with-http_geoip_module \ | |
--with-http_sub_module \ | |
--with-http_dav_module \ | |
--with-http_flv_module \ | |
--with-http_mp4_module \ | |
--with-http_gzip_static_module \ | |
--with-http_random_index_module \ | |
--with-http_secure_link_module \ | |
--with-http_degradation_module \ | |
--with-http_stub_status_module \ | |
--with-http_perl_module \ | |
--with-http_iconv_module \ | |
--with-http_gunzip_module \ | |
--with-mail \ | |
--with-mail_ssl_module \ | |
--with-luajit | |
make | |
make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment