- Install Ghost (CMS) Blog Publishing Platform on Debian and Ubuntu
- Ghost Features:
- Requirements:
- Step 1: Installing Nodejs on Debian and Ubuntu
- Step 2: Installing Ghost On Debian and Ubuntu
- Step 3: Start and Access Default Ghost Blog
- Step 4: Install and Configure Nginx for Ghost
- If You Appreciate What We Do Here On TecMint, You Should Consider:
- Установить Ghost в Debian
- Installing Ghost CMS on Debian 10
- In This Guide
- Before you Begin
- Install Prerequisites
- Install NGINX
- Install MariaDB Server
- Install Node.js and NPM
- Install and Configure Ghost
- Install Ghost-CLI
- Install Ghost
- Complete the Setup
- Защита сервера Linux от уязвимости GHOST
- Проверка системы
- Системы Ubuntu и Debian
- Системы CentOS и RHEL
- Устранение уязвимости GHOST
- Ubuntu /Debian
- CentOS/RHEL
- Заключение
Install Ghost (CMS) Blog Publishing Platform on Debian and Ubuntu
Ghost is a free, open source and lightweight platform intended for blogging or online publications. It is written in Nodejs and comes with an assortment of modern publishing tools designed for easily building and running online publications.
It is feature-rich and now has a desktop app (runs on Linux, Windows and Mac OS) which provides all the functionalities and power of Ghost, simply on your computer. This implies that you can easily switch between multiple sites on the go: making it absolutely efficient.
Ghost Features:
- Fast, scalable and efficient.
- Offers a markdown based editing environment.
- Comes with a desktop app.
- Comes with beautiful handlebars templates.
- Supports for simple content management.
- Supports for multiples roles for authors, editors and administrators.
- Allows scheduling content in advance.
- Supports accelerated mobile Pages.
- Fully supports search engine optimization.
- Provides detailed structured data.
- Supports subscriptions by RSS, Email and Slack.
- Enables simple site editing and so much more.
Requirements:
- A Debian Server Minimal Install with 1GB Memory
- A Ubuntu Server Minimal Install with 1GB Memory
- Node v6 LTS – Install Latest Node.js and NPM in Debian and Ubuntu
- A Debian/Ubuntu server with Nginx installed
Important: Before you begin installing Ghost yourself, you’ll need to have a good VPS hosting, we highly recommend BlueHost.
In this article, we will explain how to install an open source Ghost (Content Management System) blogging platform on a Debian and Ubuntu system.
Step 1: Installing Nodejs on Debian and Ubuntu
1. Nodejs is not available in the default Debian and Ubuntu software repositories, therefore first add its repositories and then install as follows.
2. Once nodejs installed, you can verify that you have the recommended version of Nodejs and npm installed using the commands.
Check Node and NPM Version
Step 2: Installing Ghost On Debian and Ubuntu
3. Now create a Ghost root directory which will store the application files in the /var/www/ghost, which is the recommended installation location.
4. Next, grab the latest version of Ghost from Ghost’s GitHub repository and unzip the archive file into the directory you just created above.
5. Now move to the new ghost directory, and install Ghost (production dependencies only) with the below commands.
Step 3: Start and Access Default Ghost Blog
6. To start Ghost, run the following command from the /var/www/ghost directory.
Start Ghost Production
7. By default, Ghost should be listening on port 2368. To see your newly setup Ghost blog, open a web browser and type the URL below:
Note: After launching Ghost for the first time, the file config.js will be created in the root directory of Ghost. You can use it to set environment level configuration for ghost; where you can configure options such as your site URL, database, mail settings etc.
Step 4: Install and Configure Nginx for Ghost
9. In this section, we will install and configure Nginx to server our Ghost blog on port 80, so that users can access Ghost blog without adding port :2368 at the end of the url.
First stop the Ghost service by hitting the CTRL+C keys on the terminal and then install nginx as shown.
10. Once nginx has been installed, create a new file under /etc/nginx/sites-available/ghost.
Add the following configuration and make sure to change the following highlighted lines to your_domain_or_ip_address.
Save the file and active this configuration by creating a symlink under /etc/nginx/sites-enabled directory.
11. Now open /etc/nginx.conf file. include the configuration files in the sites-enabled directory and disable the default site as shown.
Now add the following line inside the http block to include the configuration files in the sites-enabled directory.
Then totally comment out the default server block found inside the http block.
Finally, save and restart nginx web server.
Once again, visit http://your_domain_or_ip_address and you’ll see your Ghost blog.
For additional information, go to the Ghost official website: https://ghost.org/
That’s all! In this article, we showed how to setup Ghost in Debian and Ubuntu. Send us your queries or any thoughts concerning this guide via the feedback form below.
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
Источник
Установить Ghost в Debian
Мне давно хотелось пощупать Node.js поближе, но все время не было повода для этого. В этой статье решил рассказать о первом опыте работы с этой платформой. Свое знакомство с работой Node.js мне пришлось начать с установки Ghost на Debian.
Хотелось бы упомянуть интересные факты из истории Ghost. Ghost был создан Джоном О’Ноланом, который в свое время выполнял функции заместителя руководителя разработки пользовательского интерфейса WordPress. Изначально Ghost создавался как альтернатива WordPress, но со временем он вырос из движка для блога и превратился в сложную CMS.
Если использовать Ghost в качестве блог-платформы, то его можно считать одним из основных конкурентов WordPress. Одно из преимуществ Ghost — его лаконичность, простота и скорость работы. Что касается функциональности этих CMS, Ghost сильно уступает возможностям WordPrees.
Как вариант, можно использовать Ghost вместе с Nginx. Веб-сервер Nginx будет прослушивать трафик, поступающий на порт 80, а затем передавать все запросы платформе Ghost. Благодаря разнообразию вариантов установки Ghost, вам нет необходимости обязательно устанавливать MySQL или Nginx.
Из недостатков Ghost, хочу отметить потребление ресурсов плаформой Node.js. В моем случае, на сервере Debian 8 х64, под виртуализацией KVM я увидел следующую картину:
Под нагрузкой процесс Ghost создает сильную нагрузку на процессор. Этот недостаток устраняется кэшированием в Nginx. Потребление памяти должно компенсироваться за счет отсутствия необходимости держать в системе процессы PHP и MySQL, но это не устраняет проблем с ее утечками.
Как я уже говорил, чтобы установить Ghost в Debian, вам не нужно устанавливать PHP, MySQL и Nginx. Платформа Ghost выполняет функции движка и веб-сервера одновременно. За хранение данных по умолчанию отвечает SQLite, вы можете ее изменить на MySQL или PostgreSQL при необходимости.
Установить Ghost в Debian
Установить Ghost достаточно просто. Вам нужно установить пакеты nodejs , npm и их зависимости. Запустите в консоли команды ниже:
Чтобы установить Ghost на сервер, используйте npm :
После завершения установки Ghost, важно выполнить первый запуск, после чего можно переходить к изменению настроек.
Фрагмент результата выполнения команды:
Остановите процесс при помощи клавиш Ctrl-C. Откройте файл:
Здесь необходимо изменить адрес и порт на котором Ghost будет принимать входящие соединения. Находим секцию и меняем значения параметров на свои:
Повторно запускаем Ghost:
Автоматический запуск Ghost
После установки Ghost, необходимо добавить добавить запуск платформы в автозагрузку. Для контроля запуска и управления работой Ghost я буду использовать пакет supervisor :
Создадим файл с параметрами запуска Ghost:
Добавьте в него следующие строки:
В целях безопасности, создадим отдельного пользователя, под которым будем выполнять запуск Ghost:
Дадим пользователю права на каталог установки Ghost:
После установки supervisor и изменения настроек, обязательно нужно перезагрузить сервер. Теперь для управления процессом Ghost вручную, можно использовать следующие команды:
Подробнее о различных способах управления процессом Ghost, можно прочитать на этой странице .
Установить Ghost вместе с Nginx
Когда Ghost установлен и работает, займемся оптимизацией работы сервера. В качестве примера я настрою Nginx в роли фронтенда. Веб-сервер Nginx, который запущен на внешнем интерфейсе, будет принимать и передавать соединения от клиентов к серверу Ghost. Затем в обход сервера Ghost, Nginx будет отдавать из кэша статику клиентам. Использование Nginx позволит нам более гибко настроить работу сервера.
Для начала меняем host и port в конфигурационном файле Ghost:
Устанавливаем веб-сервер Nginx:
Создайте конфигурационный файл Nginx и добавьте в него следующие строки:
Чтобы применить настройки, выполните команду:
После изменения настроек Nginx перестал запускаться:
В качестве решения проблемы, мне помог перезапуск сервера.
Источник
Installing Ghost CMS on Debian 10
Ghost is an open source blogging platform that helps you easily create a professional-looking online blog. Ghost is a robust content management system (CMS) with a Markdown editor, an easy-to-use user interface, and beautiful themes. It is easy to install and update with Ghost-CLI.
In This Guide
In this guide, you’ll set up, deploy, and secure a Ghost v3.5.1 blog on a Linode running Debian 10, using NGINX, MySQL, Node.js, NPM, Ghost-CLI, and Let’s Encrypt. For installation instructions for other distributions, click here.
This guide is written for a non-root user. Commands that require elevated privileges are prefixed with sudo . If you’re not familiar with the sudo command, consult our Users and Groups guide.
Replace each instance of example.com in this guide with your site’s domain name.
Before you Begin
This guide assumes that you’ve followed the steps in our Getting Started and Securing Your Server guides and have created a new user for Ghost with elevated sudo privileges. The example username used in this guide is ghostexample .
Ensure that you have a valid domain name and properly configured DNS records for your domain.
Ensure that your system is up to date:
Install Prerequisites
Install NGINX
NGINX will be used as a reverse proxy for your Ghost application:
Install MariaDB Server
Download and install MariaDB Server:
Log into MariaDB Server:
Set a password for the root user with this command, replacing password with a strong password:
Install Node.js and NPM
Ghost is built on Node.js and follows Node’s Long Term Support (LTS) plan. Ghost only supports LTS versions of Node.js.
Download and install Node.js:
Install and Configure Ghost
Install Ghost-CLI
Ghost-CLI is a command line interface (CLI) tool that makes installing and updating Ghost easy. It sets up the database, configures NGINX as a reverse proxy, enables TLS/SSL security using Let’s Encrypt CA, automatically renews your SSL, and initializes Ghost as a systemd service.
Install Ghost
Install Ghost using the Ghost-CLI tool.
Create the document root directory:
Change ownership of the /var/www/ghost directory to the non-root user with sudo privileges that you created. In this example, ghostexample is our username:
Navigate to the Ghost root directory:
Ensure that the directory is empty to avoid file conflicts:
Install Ghost in production mode:
By default Ghost looks for Ubuntu and will display this warning if it detects a different operating system.
It will ask you if you would like to continue anyway, answer yes.
Answer each question as prompted. For more information about each question, visit the Ghost documentation:
After installation is complete, run ghost ls to view running Ghost processes:
In the future when a newer version of Ghost is released, run ghost update from the /var/www/ghost directory to update to the newest version.
Complete the Setup
To complete the setup process, navigate to the Ghost configuration page by appending /ghost to the end of your blog’s URL or IP. This example uses https://example.com/ghost .
On the welcome screen, click Create your account:
Источник
Защита сервера Linux от уязвимости GHOST
27 января 2015 года была обнаружена уязвимость в библиотеке GNU C Library (или glibc) по имени GHOST. Вкратце, уязвимость дает удаленному злоумышленнику полный контроль над системой, используя переполнение буфера (англ. buffer overflow) в функции GetHOST (отсюда и название уязвимости). Как и недавно обнаруженные Shellshock и Heartbleed, эта уязвимость представляет серьезную угрозу и может затронуть многие серверы.
Злоумышленник может воспользоваться уязвимостью GHOST в системах Linux, использующих версии библиотеки glibc до glibc-2.18. То есть, системы, которые используют версии с glibc-2.2 по glibc-2.17, находятся в опасности. Следующие дистрибутивы считаются потенциально уязвимыми для GHOST и нуждаются в исправлении (включая, но не ограничиваясь):
- CentOS 6 и 7
- Debian 7
- Red Hat Enterprise Linux 6 и 7
- Ubuntu 10.04 и 12.04
- последние дистрибутивы Linux.
Настоятельно рекомендуется обновить и перезапустить все уязвимые серверы Linux. В данной статье описано, как проверить свой сервер на GHOST, а также как обновить библиотеку glibc, чтобы исправить уязвимость.
Проверка системы
Самый простой способ проверить сервер на уязвимость GHOST – это узнать используемую версию библиотеки glibc. Смотрите раздел, соответствующий вашему серверу.
Системы Ubuntu и Debian
Чтобы узнать текущую версию библиотеки glibc, нужно проверить версию утилиты ldd (которая использует glibc):
Первая строка появившегося результата будет содержать номер версии eglibc (это вариант библиотеки glibc для Ubuntu и Debian). Вывод имеет примерно такой вид (версия выделена):
ldd (Ubuntu EGLIBC 2.15-0ubuntu10.7 ) 2.15
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
Если версия eglibc совпадает с указанной в примере или вышла еще позже, значит, сервер в безопасности. Безопасные версии библиотеки в Ubuntu и Debian:
- Ubuntu 12.04 LTS: 2.15-0ubuntu10.10
- Ubuntu 10.04 LTS: 2.11.1-0ubuntu7.20
- Debian 7 LTS: 2.13-38+deb7u7
Если же на данный момент сервер использует более старую версию eglibc, система страдает от уязвимости GHOST. Обновите библиотеку eglibc до одной из указанных безопасных версий.
Системы CentOS и RHEL
Чтобы узнать версию glibc, проверьте версию утилиты ldd (которая использует glibc):
Нужная информация находится в первой строке вывода, который имеет примерно такой вид (версия glibc выделена):
ldd (GNU libc) 2.17
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
Если текущая версия библиотеки входит в диапазон 2.2–2.17, система в опасности и нуждается в срочном обновлении. Чтобы устранить уязвимость GHOST, обновите библиотеку glibc до версии 2.18 и выше.
Устранение уязвимости GHOST
Проще всего устранить уязвимость GHOST при помощи стандартного менеджера пакетов системы. Используйте его для обновления glibc. Следующие подразделы описывают способы обновления библиотеки в различных дистрибутивах Linux.
Ubuntu /Debian
Стандартный менеджер пакетов систем Ubuntu/Debian называется apt-get. С его помощью можно обновить все пакеты системы до последних доступных версий. Для этого используйте apt-get dist-upgrade:
sudo apt-get update && sudo apt-get dist-upgrade
и подтвердите запуск команды, нажав y.
После завершения обновления перезапустите сервер:
Перезагрузка сервера необходима потому, что библиотека GNU C Library используется многими приложениями, которые необходимо перезапустить, чтобы новые пакты вступили в действие.
Повторите проверку системы на уязвимость, описанную в предыдущем разделе.
CentOS/RHEL
Примечание: на момент написания статьи обновленная версия glibc для CentOS не доступна через yum.
Чтобы обновить glibc до последней доступной версии, используйте стандартный менеджер пакетов yum:
sudo yum update glibc
Подтвердите команду, нажав y.
После обновления перезапустите сервер:
Поскольку библиотека GNU C Library используется многими приложениями, сервер необходимо перезапустить, чтобы новая версия вступила в действие.
Снова выполните описанную ранее процедуру проверки системы на уязвимость GHOST.
Заключение
Обязательно обновите glibc на всех уязвимых серверах Linux . также не забывайте постоянно обновлять пакеты системы до последних доступных версий. Это значительно повысит уровень безопасности сервера Linux.
Источник