<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Adam </title>
    <description>The latest articles on DEV Community by Adam  (@adahyto).</description>
    <link>https://dev.to/adahyto</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F240585%2F24db44fb-d98a-4872-a19c-630c6b91a785.jpeg</url>
      <title>DEV Community: Adam </title>
      <link>https://dev.to/adahyto</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adahyto"/>
    <language>en</language>
    <item>
      <title>#question How do you deploy nx.dev angular apps?</title>
      <dc:creator>Adam </dc:creator>
      <pubDate>Thu, 02 Apr 2020 08:14:19 +0000</pubDate>
      <link>https://dev.to/adahyto/question-how-do-you-deploy-nx-dev-angular-apps-43a</link>
      <guid>https://dev.to/adahyto/question-how-do-you-deploy-nx-dev-angular-apps-43a</guid>
      <description>&lt;p&gt;Hi. Usually, I deploy my angular projects following this article &lt;a href="https://itnext.io/how-to-deploy-angular-application-to-heroku-1d56e09c5147"&gt;https://itnext.io/how-to-deploy-angular-application-to-heroku-1d56e09c5147&lt;/a&gt; - creating the express server and serving an angular path. I'm wondering how should I act with multiple apps nx.dev project. Could you describe how you deploy that kind of app? (not necessarily on Heroku)&lt;/p&gt;

</description>
      <category>question</category>
      <category>angular</category>
      <category>nx</category>
      <category>heroku</category>
    </item>
    <item>
      <title>Hands-on Ghost pt.1 - Become an online publisher step-by-step using your server.</title>
      <dc:creator>Adam </dc:creator>
      <pubDate>Sun, 19 Jan 2020 21:47:53 +0000</pubDate>
      <link>https://dev.to/adahyto/hands-on-ghost-pt-1-become-an-online-publisher-step-by-step-using-your-server-19oh</link>
      <guid>https://dev.to/adahyto/hands-on-ghost-pt-1-become-an-online-publisher-step-by-step-using-your-server-19oh</guid>
      <description>&lt;h1&gt;
  
  
  Introduction to Ghost 👻 - modern Node.js publishing platform.
&lt;/h1&gt;

&lt;h4&gt;
  
  
  Table of contents
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Ghost introduction&lt;/li&gt;
&lt;li&gt;General prerequisites&lt;/li&gt;
&lt;li&gt;
Server prerequisites

&lt;ul&gt;
&lt;li&gt;Ubuntu configuration&lt;/li&gt;
&lt;li&gt;NGINX installation&lt;/li&gt;
&lt;li&gt;MySQL configuration&lt;/li&gt;
&lt;li&gt;Nodejs installation&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Ghost-CLI&lt;/li&gt;
&lt;li&gt;
Install Ghost

&lt;ul&gt;
&lt;li&gt;Start Ghost&lt;/li&gt;
&lt;li&gt;SSH&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;First one of the incoming Ghost tutorial series.&lt;br&gt;
The inscription will cover a topic of ghost setup on Ubuntu 18.04, ensuring step by step that prerequisites for installing the &lt;a href="https://github.com/TryGhost/Ghost-CLI"&gt;Ghost-CLI&lt;/a&gt; are met, installing Nginx, MySQL, and nodejs. I will introduce headless CMS of my choice and gather instructions for installing it with all other necessary software and its basic configuration.&lt;/p&gt;
&lt;h2&gt;
  
  
  Ghost introduction
&lt;/h2&gt;

&lt;p&gt;It's an open-source publishing platform, headless Node.js CMS. Started by &lt;a href="https://twitter.com/johnonolan"&gt;John O'Nolan&lt;/a&gt; and &lt;a href="https://twitter.com/erisds"&gt;Hannah Wolfe&lt;/a&gt; in early 2013, after successful &lt;a href="https://www.kickstarter.com/projects/johnonolan/ghost-just-a-blogging-platform/description"&gt;Kickstarter campaign&lt;/a&gt; with the mission &lt;em&gt;to deliver publicly available tools for independent journalists and writers across the world to increase their impact on online media&lt;/em&gt;. Not complicated to configure, relatively fast and quite well-designed out-of-the-box. CMS comes with &lt;a href="https://ghost.org/docs/concepts/features/"&gt;features&lt;/a&gt; which can be customized based on the needs. The basic theme is &lt;a href="https://github.com/TryGhost/Casper"&gt;Casper&lt;/a&gt;, but it's not complicated to craft your one. As we can read on ghost www - they are structured as a &lt;a href="https://ghost.org/about/"&gt;non-profit organization&lt;/a&gt; and product based on the needs of its users - not ones who look for returns. The ghost is licensed under &lt;a href="https://en.wikipedia.org/wiki/MIT_License"&gt;MIT LICENCE&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  General prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ubuntu.com/"&gt;Ubuntu&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.nginx.com/"&gt;NGINX&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.mysql.com/"&gt;MySQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nodejs.org/en/"&gt;Node.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://systemd.io/"&gt;systemd&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;1GB memory&lt;/li&gt;
&lt;li&gt;registered domain name&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eCiRUjeU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/media/Bg8k3ZzIgAAQ8iy%3Fformat%3Dpng%26name%3D900x900" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eCiRUjeU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/media/Bg8k3ZzIgAAQ8iy%3Fformat%3Dpng%26name%3D900x900" alt="alt text" title="The Joy of Programming with Bob Ross"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Server prerequisites
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Ubuntu configuration
&lt;/h3&gt;

&lt;p&gt;Assuming that you already have access to your Ubuntu terminal, let's create a new user&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ adduser ghostuser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and add it to the &lt;em&gt;sudo&lt;/em&gt; group using &lt;em&gt;usermod&lt;/em&gt; with --append &amp;amp; --groups options.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Usage: usermod [options] LOGIN

:~$ usermod -aG sudo ghostuser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we need to set up &lt;a href="https://help.ubuntu.com/community/UFW"&gt;Uncomplicated Firewall&lt;/a&gt; :D&lt;br&gt;
CLI lines speak for themselves I believe, as we could expect from the name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ ufw allow OpenSSH
:~$ ufw enable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ ufw status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Allowing &lt;a href="https://www.openssh.com/"&gt;OpenSSH&lt;/a&gt; will let us through the firewall while connecting using the SSH protocol.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ ssh ghostuser@server_ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  NGINX installation
&lt;/h3&gt;

&lt;p&gt;Nginx is available in Ubuntu's default repository, so we can get it using apt.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ sudo apt-get update
:~$ sudo apt-get upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ sudo apt install nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The software adds itself to UFW upon installation but as it is recommended we need to enable the most restrictive profile that will still allow the traffic you’ve configured.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ sudo ufw app list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ sudo ufw allow 'Nginx HTTP'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you should be able to see Nginx &lt;em&gt;Hello World&lt;/em&gt; page at &lt;a href="http://server_ip"&gt;http://server_ip&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  MySQL configuration
&lt;/h3&gt;

&lt;p&gt;A headless CMS focus is to store and deliver structured content. Ghost uses MySQL for the content to read and write.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ sudo apt-get install mysql-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ sudo mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As it is on the &lt;a href="https://ghost.org/docs/install/ubuntu/"&gt;Ghost docs&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Now update your user with this password
# Replace 'password' with your password, but keep the quote marks!

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

# Then exit MySQL

quit

# and login to your Ubuntu user again

su - &amp;lt;user&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Nodejs installation
&lt;/h3&gt;

&lt;p&gt;To run Ghost you need to have nodejs repository downloader and installed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash

:~$ sudo apt install nodejs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you met some problems here, please check different installation methods at &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04"&gt;digitalocean&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The npm CLI.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ sudo apt install npm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some npm packages to work require compiling code from the source - you will need to install the build-essential package to run them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ sudo apt install build-essential
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Ghost-CLI
&lt;/h2&gt;

&lt;p&gt;Now when you're sure about server met the prerequisites you can proceed to &lt;a href="https://github.com/TryGhost/Ghost-CLI"&gt;Ghost-CLI&lt;/a&gt; installation.&lt;/p&gt;

&lt;p&gt;The project goal is to make setting up and maintaining a Ghost site as straight forward as possible. Mainly ensuring that everyone that uses the recommended system stack can install, configure, start, stop, restart, update &amp;amp; list their Ghost sites. It makes possible to install or update Ghost in a single command.&lt;/p&gt;

&lt;p&gt;We can get it using npm CLI.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ sudo npm install ghost-cli -g

:~$ ghost help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install Ghost
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Before installing ghost, remember to register your domain. Here we use &lt;em&gt;server-domain.com&lt;/em&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a directory, set its owner and permissions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ sudo mkdir -p /var/www/ghost
:~$ sudo chown &amp;lt;ghostuser&amp;gt;:&amp;lt;ghostuser&amp;gt; /var/www/ghost
:~$ sudo chmod 775 /var/www/ghost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then navigate to the new directory and install the ghost.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ cd /var/www/ghost
:~$ ghost install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change your Nginx configuration to display your blog.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ cd /etc/nginx/
:~$ rm sites-enabled/default
:~$ cd sites-available
:~$ touch ghost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
        listen 0.0.0.0:80;
        server_name *server-domain-name*;
        access_log /var/log/nginx/*server-domain-name*.log;

        location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header HOST $http_host;
        proxy_set_header X-NginX-Proxy true;

        proxy_pass http://127.0.0.1:2368;
        proxy_redirect off;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nginx reads from sites-enabled directory during startup, so we need to link that file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ cd..
:~$ sudo ln -s sites-available/ghost sites-enabled/ghost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As there are possible hash bucket memory problem, but they're easy to solve by editing a single file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ sudo nano /etc/nginx/nginx.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
http {
    ...
    server_names_hash_bucket_size 64;
    ...
}
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To be sure we can check for the errors and restart Nginx using commands bellow.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ sudo nginx -t
:~$ sudo systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Start Ghost
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:~$ ghost start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  SSH
&lt;/h3&gt;

&lt;p&gt;Ghost has integration with Let's Encrypt SSL and thanks to that you can add a new SSL certificate in a couple of steps using a single command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ghost setup ssl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;In the next part, I will cover adding Ghost to upstart to be sure that it runs whenever your server does.&lt;br&gt;
I will also show how to host your blog on Heroku and AWS.&lt;br&gt;
Later I'm going to show how to create a custom theme and more.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>ubuntu</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
