#!/bin/bash
             . config.ini
             apt-get update; apt-get upgrade -y; apt-get dist-upgrade -y
             apt-get autoremove -y
             apt-get install apt-utils build-essential -y
             apt-get install git -y
             apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg libxml2 zlib1g-dev -y
             apt-get install -y unzip
             apt-get install -y libicu-dev libcurl4-gnutls-dev libtool
             apt-get install -y libmozjs-24-dev
             apt-get install -y libmozjs-24-bin; sudo ln -sf /usr/bin/js24 /usr/bin/js
             apt-get install openssl libssl-dev libperl-dev libexpat-dev -y
             apt-get install mercurial meld -y
             apt-get install libxslt-dev -y
             apt-get install libgd2-xpm -y
             apt-get install libgd2-xpm-dev -y
             apt-get install libgeoip-dev -y
             apt-get install libssl libssl-dev -y
             apt-get install dh-autoreconf -y
             apt-get install -y software-properties-common
             apt-get install -y python-software-properties
             apt-get install -y libcairo2 libcairo2-dev
             apt-get install -y python-dev
             sudo add-apt-repository ppa:maxmind/ppa -y
             apt-get install aptitude -y
             aptitude update -y
             aptitude upgrade -y
             aptitude install libmaxminddb0 libmaxminddb-dev mmdb-bin -y
             apt-get install libmysqlclient-dev -y
             apt-get install libmariadbclient-dev -y
             apt-get install g++ flex bison curl doxygen libyajl-dev libgeoip-dev libtool dh-autoreconf libcurl4-gnutls-dev libxml2 libpcre++-dev libxml2-dev -y
             apt-get install libuuid1 uuid-dev -y
             apt-get install libgd-dev libc6 -y
             
             useradd nginx
             cd /; wget $ubuntu18build
             unzip nginx.zip; rm -Rf nginx.zip
             chmod +x /etc/init.d/nginx
             chmod +x /usr/sbin/nginx
             rm -Rf /nginx/*.default
             
             mkdir -p /nginx/live
             mkdir -p /nginx/logs
             mkdir -p /nginx/conf.d
             touch /nginx/logs/access.log
             touch /nginx/logs/error.log
             cd /nginx/; rm -Rf nginx.conf*; wget $ubuntu18nginxconf
             
             cd /nginx/live/
             wget $ubuntu18defauconf
             
             mkdir -p /hostdata/default
             mkdir -p /hostdata/default/public_html
             mkdir -p /hostdata/default/logs
             mkdir -p /hostdata/default/cache
             cd /hostdata/default/public_html/
             wget $nginxIndex
             sudo update-rc.d nginx defaults
             cd /nginx/; mkdir db/; cd db/; wget $nginxGeoDB
             
             clear; service nginx stop; service nginx start
