-
Notifications
You must be signed in to change notification settings - Fork 203
Installing Journey on Ubuntu Server
Go to https://github.com/kabukky/journey/releases and copy the link to the latest Journey release package for your platform (linux-amd64 or linux-386 for Ubuntu Server). We will be using the linux-amd64 package in this tutorial.
On the server, log in as your standard user (not root).
In your home directory, run:
wget https://link/to/latest/release/journey-linux-amd64.zip
This will download the zip file to your home directory. Then run:
unzip journey-linux-amd64.zip
This will extract the file. You can delete the zip file now:
rm journey-linux-amd64.zip
Then rename the extracted folder from "journey-linux-amd64" to "journey":
mv journey-linux-amd64/ journey
After that, change into the journey folder:
cd journey
Use your favorite text editor to edit the "config.json" file. We will be using nano in this example (if you don't have nano installed, run sudo apt-get install nano
). To edit the file, run:
nano config.json
Then change the values to reflect the following settings (replace "www.kaihag.com" with your own url):
{
"HttpHostAndPort":":80",
"HttpsHostAndPort":":443",
"HttpsUsage":"AdminOnly",
"Url":"https://www.kaihag.com",
"HttpsUrl":"https://www.kaihag.com"
}
A short explanation:
- The "HttpHostAndPort" and "HttpHostAndPort" settings will set the ports Journey is listening on. We changed them to the default HTTP and HTTPS ports.
- "HttpsUsage" tells Journey how redirection to HTTPS should be handled. "AdminOnly" forces the admin area to be transmitted via HTTPS for security. The other settings are "None" (no HTTPS support) and "All" (all connections both to the admin area and to the blog are forced to HTTPS).
- The "Url" setting will be used by Journey to generate links to your blog (e.g. in the rss feed). This can be an HTTP or HTTPS address.
- The "HttpsUrl" setting will be used to redirect incoming HTTP connections to HTTPS. This is almost always the same value as "Url" unless you are using a non-standard port for HTTPS.
Ctrl + X will exit nano. Don't forget to save the file.
We will be using setcap to grant special privileges to the Journey executable. This will allow us to run Journey through our default user while still being able to bind to low ports (80 and 443, which only root can bind to).
Install setcap by running:
sudo apt-get install libcap2-bin
After that, we'll create a new upstart script. Upstart is the Ubuntu init daemon that starts and supervises tasks on the system. It'll start Journey after a reboot and keep it running. However, it is slowly being replaced by systemd.
Ubuntu 14 uses upstart by default, but Ubuntu 15 and later uses systemd. If your Linux distribution ships without upstart, you can use a multitude of alternatives including systemd, restartd, supervise (daemontools), monit, supervisord, or write an init script and place it in /etc/init.d.
Here's how you create the upstart script. Again, using nano as the editor:
sudo nano /etc/init/journey.conf
Paste in the following text (and replace every occurrence of "youruser" with your own user name):
# Journey Daemon
description "Journey Daemon"
author "kabukky"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
console none
pre-start script
setcap 'cap_net_bind_service=+ep' /home/youruser/journey/journey
end script
exec su - youruser -c "/home/youruser/journey/journey -log=/home/youruser/journey/log.txt"
Ctrl + X will exit nano. Don't forget to save the file. Note that this example assumes your journey executable is located in your home directory in a folder named "journey".
Finally, we'll start our newly created Journey service with:
sudo service journey start
And we're done! Journey is now running in the background and will be started automatically after a reboot, crash, etc.
Visit your url in your browser (the one you provided in the "config.json", remember? You have to point it to your Linux server of course). You'll be presented with your new Journey blog in all its glory.
To create your admin account, visit:
https://yourblogurl/admin/
and enter your details. Your browser will probably show you a warning/error about the certificate. This happens because Journey has generated its own certificate upon start up. You can add an exception to your browser if you wish.
However, to make your blog accessible to all readers using https, you'll need to generate certificates via a trusted CA (certificate authority). A free one would be StartSSL. Head over to Using a StartSSL Server Certificate with Journey for detailed instructions on how to set up a StartSSL server certificate.
After you have acquired those, place the certificate and matching private key as "cert.pem" and "key.pem" in the content/https folder of your Journey installation (e.g. /home/youruser/journey/content/https), overwriting the old ones.
After that, restart Journey to load the new certificates:
sudo service journey restart
The Promenade theme is included by default to make Journey work out of the box. However, it is only intended to be used on a one author, personal website.
For a fully fledged blog experience try the Casper theme from the makers of Ghost.
Download it and place the Casper directory in the content/themes folder of your Journey installation (e.g. /home/youruser/journey/content/themes). Then select Casper in your admin panel under Settings/Blog.
After that, try some other themes! There's a whole world of Ghost themes out there. Find the one you like best.
Finally, you can always write your own theme and use it with Journey. Start by visiting http://themes.ghost.org and by reading one of the many tutorials that show you how to create a Ghost theme!
If you're interested in writing a plugin, head over to Creating a Journey Plugin!