1. Startseite
  2. Anleitungen
  3. Installieren von Ghost

Installieren von Ghost

Übersicht

Ghost is a gorgeous blogging platform supported on Developer+ accounts on v6+ platforms. Ghost requires terminal access to deploy and hooks into Passenger affording simple process management.

Basic layout from a fresh Ghost install

Basic layout from a fresh Ghost install

 

Schnellstart

This guide is designed to get Ghost up and running with the fewest steps. Ghost will be SQLite as a database backend, but you might want to configure it to take advantage of MySQL’s improved throughput.

  1. Login to the Terminal
  2. Create a subdomain to serve Ghost. Since it’s launched with Passenger, you will need to make a Passenger-compatible filesystem layout
    • cd /var/www
      mkdir -p ghost/{tmp,public}
      cd ghost
  3. Download Ghost from ghost.org. At the time of writing, 0.6.4 is the latest version:
    • wget https://ghost.org/zip/ghost-0.6.4.zip
      unzip ghost-0.6.4.zip
      rm -f ghost-0.6.4.zip
  4. Ghost has been downloaded and extracted to /var/www/ghost. Ghost is a Node.js application that relies on third-party dependencies to run. These can be installed used the Node.js package manager (npm)
    • Install missing dependencies:
      npm install --production 
  5. Verbinden Sie öffentlich/ to a subdomain within the Bedienfeld unter WebSubdomains

    Connecting Ghost to a subdomain within the control panel.

    Connecting Ghost to a subdomain within the control panel

  6. Erstellen einer .htaccess control file in öffentlich/ and set PassengerNodejs to inform the web server that this is a Node.js application to be launched with Passenger. `which node` is shorthand to resolve the location of your Node interpreter as selected by nvm:
    • echo "PassengerNodejs `which node`" >> public/.htaccess
  7. Erstellen einer MySQL database. Ghost connects over TCP socket, so ensure that remote permissions on 127.0.0.1 are granted to the user. By default, when a user is created, permissions are only granted to “localhost” and not 127.0.0.1.
  8. Edit core/server/config/env/config.production.json with your database credentials. Change user, password, und database fields.
    • nano core/server/config/env/config.production.json
  9. Populate the database
    • env NODE_ENV=production knex-migrator init
  10. Finally, Passenger expects the entry-point to be named “app.js“. Ghost uses index.js as its startup file. Create a symbolic link from index.js an app.js to satisfy Passenger:
    • ln -s index.js app.js
  11. Once done, access /signup on the subdomain to setup your admin account
    • For example, in this walkthrough, the URL on ghost.example.com would be http://ghost.example.com/ghost
  12. Viel Spaß!

    Ghost administrative dialog after setup

    Ghost administrative dialog after setup

Odds and Ends

Neustart von

Node.js piggybacks Passenger, and in doing so, can be easily restarted using the tmp/ control directory. Follow the general guide to restarting a Passenger-backed application.

Siehe auch

Aktualisiert am März 7, 2021

Verwandte Artikel