Re:Ghost for Journalism
by eriknstr on Wednesday January 18, 2017 @12:09PM
(#13428005)
Personally I run FreeBSD, not OpenBSD, but I decided to try installing Ghost on OpenBSD 6.0 in a VirtualBox VM.
1. Downloaded install60.iso from one of the OpenBSD mirror sites.
2. Created VM with virtual network adapter attached to host network interface bridged (which I only ever rarely do so it also requires that I `doas service vboxnet onestart`) and installed OpenBSD on it. This took only a few minutes, I was impressed by how quick the installer config steps for OpenBSD were.
Instructions probably presume that one is familiar with OpenBSD. That's fair. Been a while since last time I used it but it's a well documented system so finding out what to do did not take much time; I needed to copy the sample pkg config file and uncommented the installpath for a country near me.
# cp /etc/examples/pkg.conf /etc/
# vi /etc/pkg.conf
Continued.
# pkg_add node sqlite3-tcl curl
# pkg_add unzip
Ambiguous: choose package for unzip
a 0: <None>
1: unzip-6.0p9
2: unzip-6.0p9-iconv
Your choice: 1
unzip-6.0p9: ok
Although not needed for the task of installing Ghost, I added git, bash, tree and vim while here.
# pkg_add git bash tree
# pkg_add vim
Ambiguous: choose package for vim
a 0: <None>
1: vim-7.4.1467p1-gtk2
2: vim-7.4.1467p1-gtk2-lua
3: vim-7.4.1467p1-gtk2-perl-python-ruby
4: vim-7.4.1467p1-gtk2-perl-python3-ruby
5: vim-7.4.1467p1-no_x11
6: vim-7.4.1467p1-no_x11-lua
7: vim-7.4.1467p1-no_x11-perl-python-ruby
8: vim-7.4.1467p1-no_x11-perl-python3-ruby
9: vim-7.4.1467p1-no_x11-ruby
Your choice: 5
vim-7.4.1467p1-no_x11: ok
And switched the shell for the non-privileged user I created during install.
# chsh -s /usr/local/bin/bash web
In a real production environment I think it would probably be better to run the server under the OpenBSD-provided "www"-user and to run the database under a separate user and then to pledge(2) the web server so that it could only read web files and communicate with the database and pledge(2) the database so that it could only communicate with the web server and read/write the db files. Something like that. Anyway as I said, I just want to test Ghost on OpenBSD quickly so I'm not going to dive into pledge(2) since that would take extra time that I don't want to spend right now.
The only change I made was to set the production URL to www-ghost.example.com instead of my-ghost-blog.com and I changed the listen address from 127.0.0.1 to 0.0.0.0.
On my host machine I added an entry in /etc/hosts pointing www-ghost.example.com to the IP of the OpenBSD VM.
1. Downloaded install60.iso from one of the OpenBSD mirror sites.
2. Created VM with virtual network adapter attached to host network interface bridged (which I only ever rarely do so it also requires that I `doas service vboxnet onestart`) and installed OpenBSD on it. This took only a few minutes, I was impressed by how quick the installer config steps for OpenBSD were.
3. Ejected install CD ISO and rebooted.
4. Attempted to install Ghost.
:/Instructions probably presume that one is familiar with OpenBSD. That's fair. Been a while since last time I used it but it's a well documented system so finding out what to do did not take much time; I needed to copy the sample pkg config file and uncommented the installpath for a country near me.
Continued. Although not needed for the task of installing Ghost, I added git, bash, tree and vim while here. And switched the shell for the non-privileged user I created during install. In a real production environment I think it would probably be better to run the server under the OpenBSD-provided "www"-user and to run the database under a separate user and then to pledge(2) the web server so that it could only read web files and communicate with the database and pledge(2) the database so that it could only communicate with the web server and read/write the db files. Something like that. Anyway as I said, I just want to test Ghost on OpenBSD quickly so I'm not going to dive into pledge(2) since that would take extra time that I don't want to spend right now.Created directory for web files.
Switched to said user and then proceeded. Created config from sample file and edited it. The only change I made was to set the production URL to www-ghost.example.com instead of my-ghost-blog.com and I changed the listen address from 127.0.0.1 to 0.0.0.0.On my host machine I added an entry in /etc/hosts pointing www-ghost.example.com to the IP of the OpenBSD VM.
Completed install of Ghost and ran it.
And then there we have it, both the blog itself http://i.imgur.com/2rBhtdl.png and the admin interface http://i.imgur.com/OqQdvoE.png are working as they should.