apt-get update apt-get upgrade apt-get install git vim apt-get purge apache2.2-common apt-get install postgresql postgresql-contrib-9.1 nginx apt-get install redis-server openssh-server apt-get install build-essential libssl-dev libyaml-dev libtool libxslt-dev libxml2-dev libpq-dev gawk curl pngcrush imagemagick python-software-properties git clone https://github.com/discourse/discourse.git adduser --shell /bin/bash --gecos 'Discourse application' discourse su postgres createuser -s discourse psql -c "alter user discourse password '';" mv discourse /var/www/ chown -R discourse:discourse /var/www/discourse/ su discourse \curl -s -S -L https://get.rvm.io | bash -s stable . ~/.rvm/scripts/rvm rvm --autolibs=read-fail requirements apt-get install libreadline6-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake bison pkg-config libffi-dev rvm install 2.0.0 rvm use 2.0.0 --default gem install bundler cd /var/www/discourse bundle install --deployment --without test RAILS_ENV=production bundle exec rails c > LocaleSiteSetting.values > SiteSetting.default_locale = 'es' db_name = discourse_prod hostname = "forums.myserver.com" smtp_address = mail.mysmtpserver.com smtp_port = 25 smtp_domain = myserver.com smtp_user_name = noreply@myserver.com smtp_password = mySMTPpassword smtp_enable_start_tls = true developer_emails = adminsemail@myserver.com db_username = discourse db_password = yourpasswordhere createdb discourse_prod RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ENV=production bundle exec rake db:migrate RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ENV=production bundle exec rake assets:precompile global.conf /etc/nginx/conf.d/local-server.conf cp /var/www/discourse/config/nginx.sample.conf /etc/nginx/conf.d/discourse.conf mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.disabled # etag off; mkdir /var/nginx /etc/init.d/nginx reload gem install bluepill echo 'alias bluepill="NOEXEC_DISABLE=1 bluepill --no-privileged -c ~/.bluepill"' >> ~/.bash_aliases rvm wrapper $(rvm current) bootup bluepill rvm wrapper $(rvm current) bootup bundle RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ROOT=/var/www/discourseRAILS_ENV=productionNUM_WEBS=2 bluepill --no-privileged-c ~/.bluepill load /var/www/discourse/config/discourse.pill require 'active_support' @reboot RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ROOT=/var/www/discourse RAILS_ENV=production NUM_WEBS=2 /home/discourse/.rvm/bin/bootup_bluepill --no-privileged -c ~/.bluepill load /var/www/discourse/config/discourse.pill