Set up a drupal site on heroku

Drupal is an open-sourced PHP-based content management system. It is very easy to extend and customize because of its modular structure.

Heroku is a great cloud hosting platform. At the beginning it only supported Ruby on Rails framework. Now it also supports PHP, NodeJS, Scala, Python, Java and Clojure. It is great because you can make a full-fledged live website in minute at zero cost.

Like with many other web applications, a machine which runs Linux operating system is preferred, and this post will assume you have knowledge of how to configure a local PHP environment. The tools you will use includes githeroku toolbelt.

Without dragging anymore, here are the steps you need to do:

  1. Download newest drupal package from the official drupal site
  2. Extract the file
  3. Download Composer to the extracted folder
  4. Get a copy of sample php application from the Get Started with PHP on Heroku
  5. Copy composer.json and composer.lock in the sample app to your drupal folder
  6. Modify composer.json, delect default modules and add ext-gb and ext-mbstring module to require field
  7. Run php composer.phar update
  8. Run heroku create –http-git to make a new Heroku app
  9. Rename the new app by heroku apps:rename newname –app oldname
  10. Add heroku to git remote ropository by heroku git:remote -a yourapp (this step is only necessary when heroku complains it’s not a remote ropository)
  11. Run heroku addons:add heroku-postgresql:hobby-dev to add a PostgreSQL database
  12. Copy database.setting.php to setting.php in sites/default folder under your drupal folder
  13. Open you Heroku website, go to your new app, open database setting to see your database information
  14. Add database information found in last step to setting.php
  15. Use git push to deploy the site to heroku

That’s it.

Get comfortable with imperfection

Writing may be the simplest way to create. But writing in a foreign language may not be that easy.

Whenever I started to write something I’d always keep looking back at what I’ve just written down. I’d often get stuck and don’t know what to write at a point. It still doesn’t feel natural to me.

One reason could be that I always want to get things done perfectly. When I started to do something, I’d like to see a beautiful result. But it’s always been hard to meet my own expectations. Because of this, it’s become difficult to start to do things. Procrastination became a habit. Efficiency and productivity left me. Creativity is dying inside of me. To tackle this problem, I just need to put my judgmental ego away and focus on little improvements I’ve made. I need to get comfortable with my own imperfection.

Another reason is that I don’t have too much to express. I’m not used to quickly form opinions about things. Throughout my life I’ve never been put to situations that require intense problem solving and imagination. Even if maths problems from school count, I’ve been away from that for a long time. My mind has become rusty and dull. Few things make me excited and passionate nowadays. To tackle this problem, I need to do some mental exercises, especially those can bring satisfaction and stimulation.

The biggest obstacle I’m facing now is my own pessimistic attitude towards self-education. But as long as I can always remind myself to stop second-guessing myself when things don’t go perfectly, maybe I’ll regain confidence and become a better person.

Install redmine on heroku

Basically follow this post. There are a few steps you probably need to take:

  1. Install heroku toolbelt : this one is obvious if you are using a PC
  2. Install rubyinstaller : I’m not so sure about this one, but if you want to use the bundle install command you’ll need to have the rails environment installed on your local PC
  3. Use bundle install without rmagick : the rubyinstaller will install a whole bunch of libraries and packages but rmagick. I don’t know how to install it so I just exclude it by bundle install –without rmagick. I suppose if it’s not necessary to build the redmine on your local PC you can just skip these two steps
  4. Generate SSH public key : heroku requires SSH public key authorization

And that’s it.