<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>ssh Archives - Michael Sunarlim</title>
	<atom:link href="https://sunarlim.com/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>https://sunarlim.com/tag/ssh/</link>
	<description>Random blurbs about web development, e-commerce and technology</description>
	<lastBuildDate>Mon, 03 Apr 2017 07:57:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.5</generator>

<image>
	<url>https://i0.wp.com/sunarlim.com/wp-content/uploads/2016/07/cropped-MS_Square_512x512.png?fit=32%2C32&#038;ssl=1</url>
	<title>ssh Archives - Michael Sunarlim</title>
	<link>https://sunarlim.com/tag/ssh/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">30613895</site>	<item>
		<title>SSL certificate installation on DigitalOcean + ServerPilot (Apache)</title>
		<link>https://sunarlim.com/2016/07/ssl-digitalocean-serverpilot-apache/</link>
					<comments>https://sunarlim.com/2016/07/ssl-digitalocean-serverpilot-apache/#comments</comments>
		
		<dc:creator><![CDATA[Michael]]></dc:creator>
		<pubDate>Sat, 30 Jul 2016 07:14:45 +0000</pubDate>
				<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[digitalocean]]></category>
		<category><![CDATA[serverpilot]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ssl]]></category>
		<guid isPermaLink="false">https://sunarlim.com/?p=2211</guid>

					<description><![CDATA[<p>It is not that difficult to manually install an SSL certificate on DigitalOcean and ServerPilot stack. Although you need to have basic knowledge of running UNIX command lines and text editor.</p>
<p>The post <a href="https://sunarlim.com/2016/07/ssl-digitalocean-serverpilot-apache/">SSL certificate installation on DigitalOcean + ServerPilot (Apache)</a> appeared first on <a href="https://sunarlim.com">Michael Sunarlim</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>First things first, finding out about <a href="https://m.do.co/c/286ec30a49ea" target="_blank">DigitalOcean</a> and <a href="https://serverpilot.io/" target="_blank">ServerPilot</a> was one of the best discoveries I have ever had as a web developer. Not saying that it is not fun to spin up a blank server and installing the required stack to host the website I work on or manage, but these steps take time. DigitalOcean and ServerPilot combination allows me to set up a solid, secure and affordable server in a few minutes. The only missing piece was to install an SSL certificate with ease without having to upgrade to ServerPilot paid plan which costs from $10/month.</p>
<p>As it turns out, it is not that difficult. Although you need to have basic knowledge of running UNIX command lines and text editor. You can probably found many detailed tutorials to install SSL certificate on DO + SP stack, but most of them are for Nginx environment. Mine is for Apache, which I am more familiar with.</p>
<p>There is nothing original here. I am merely summarizing the steps from excellent references I found:</p>
<ol>
<li><a href="https://www.digitalocean.com/community/tutorials/how-to-install-an-ssl-certificate-from-a-commercial-certificate-authority" target="_blank">How To Install an SSL Certificate from a Commercial Certificate Authority | DigitalOcean</a></li>
<li><a href="https://www.digitalocean.com/community/questions/install-ssl-certificate-manually-on-serverpilot-for-apache#comment_33544" target="_blank">Install SSL certificate manually on serverpilot for Apache</a></li>
</ol>
<h2>Create a directory for your keys and certificates</h2>
<p>To keep things tidy and make it easier to follow this tutorial, I am going to create a dedicated directory to store all the keys and certificates. So let&#8217;s create a new directory after logging into the server using SSH. We want to put everything under <span class="lang:default decode:true crayon-inline ">/etc/apache-sp/certs/appname</span>  so let&#8217;s do that:</p>
<pre class="font-size:16 line-height:24 toolbar:2 lang:sh decode:true ">mkdir /etc/apache-sp/certs
mkdir /etc/apache-sp/certs/appname
</pre>
<p><em>* replace <span class="lang:default decode:true crayon-inline ">appname</span>  with your application name on ServerPilot</em></p>
<h2 id="generate-a-csr-and-private-key">Generate a CSR and Private Key</h2>
<p>Once it has been created, you want to change into the directory:</p>
<pre class="font-size:16 line-height:24 toolbar:2 lang:sh decode:true">cd /etc/apache-sp/certs/appname</pre>
<p>Then generate a pair of certificate signing request (CSR) and private key:</p>
<pre class="font-size:16 line-height:24 toolbar:2 lang:ps decode:true">openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.com.key -out yourdomain.com.csr</pre>
<p>You will be prompted to enter information about your certificate request. To save time, DigitalOcean already provides excellent instructions on what to enter <a href="https://www.digitalocean.com/community/tutorials/how-to-install-an-ssl-certificate-from-a-commercial-certificate-authority#generate-a-csr-and-private-key" target="_blank">here</a>.</p>
<p>Once that&#8217;s done, copy the content of the generated CSR using this command:</p>
<pre class="font-size:16 line-height:24 toolbar:2 lang:sh decode:true">cat example.com.csr</pre>
<h2>Purchase an SSL certificate</h2>
<p>At this point, I assume you are already familiar in purchasing and requesting an SSL certificate. In case you need some guidance, DigitalOcean gives <a href="https://www.digitalocean.com/community/questions/install-ssl-certificate-manually-on-serverpilot-for-apache#example-ca-1-rapidssl-via-namecheap" target="_blank">a couple of examples</a> to do this using NameCheap and GoDaddy.</p>
<h2>Installing the SSL certificate on the server</h2>
<p>Once you have completed the process of generating SSL certificate, you are most likely will receive 2 files:</p>
<ol>
<li>The SSL certificate</li>
<li>The CA intermediate certificate</li>
</ol>
<p>You need to copy both of these files into the <span class="lang:default decode:true crayon-inline  ">/etc/apache-sp/certs/appname</span>  we created earlier. If you do everything correctly to this point, you should have 4 files within that directory:</p>
<ol>
<li>The certificate signing request (CSR): <span class="lang:default decode:true crayon-inline ">yourdomain.com.csr</span></li>
<li>The private key: <span class="lang:default decode:true crayon-inline ">yourdomain.com.key</span></li>
<li>The SSL certificate: <span class="lang:default decode:true crayon-inline ">yourdomain_com.crt</span></li>
<li>The CA intermediate certificate: <span class="lang:default decode:true crayon-inline ">yourdomain_com.ca-bundle</span></li>
</ol>
<h3>Enabling SSL on your domain</h3>
<p>We have come to the magic moment and most critical step. You will need to edit Apache&#8217;s configuration file to enable the SSL. You have to create a separate configuration file from the default one(s), otherwise ServerPilot might overwrite your custom file when it is updating your server.</p>
<p>The config files are located on <span class="lang:default decode:true crayon-inline ">/etc/apache-sp/vhosts.d</span>  directory so let&#8217;s change the directory to it:</p>
<pre class="font-size:16 line-height:24 toolbar:2 lang:sh decode:true ">cd /etc/apache-sp/vhosts.d</pre>
<p>Then you can view available config files under that directory using the <span class="lang:sh decode:true crayon-inline ">ls</span>  command. There are probably several <span class="lang:default decode:true crayon-inline ">.conf</span>  files there if you are hosting multiple sites on the server.</p>
<p>Now we want to create a new config file related to your app/site name. I am calling it <span class="lang:default decode:true crayon-inline ">appname.ssl.conf</span> .</p>
<pre class="font-size:16 line-height:24 toolbar:2 lang:ps decode:true ">vi appname.ssl.conf</pre>
<p>This is going to open the Vi editor where you are going to enter the <em>edited</em> lines:</p>
<pre class="lang:vim decode:true">Listen 443

&lt;VirtualHost *:443&gt;
    Define DOCUMENT_ROOT /srv/users/serverpilot/apps/appname/public

    SSLEngine on

    SSLCertificateFile /etc/apache-sp/certs/appname/appname_com.crt
    SSLCertificateKeyFile /etc/apache-sp/certs/appname/appname.com.key
        SSLCertificateChainFile /etc/apache-sp/certs/appname/appname_com.ca-bundle

    ServerAdmin webmaster@
    DocumentRoot ${DOCUMENT_ROOT}
        ServerName appname
    ServerAlias appname.com
    ServerAlias www.appname.com


    RemoteIPHeader X-Real-IP
    SetEnvIf X-Forwarded-SSL on HTTPS=on
    IncludeOptional /etc/apache-sp/vhosts.d/appname.d/*.conf

    ErrorLog "/srv/users/serverpilot/log/appname/https_appname_apache.error.log"
    CustomLog "/srv/users/serverpilot/log/appname/https_appname_apache.access.log" common
&lt;/VirtualHost&gt;</pre>
<p>Save the file and restart your Apache server:</p>
<pre class="font-size:16 line-height:24 toolbar:2 lang:sh decode:true ">sudo service apache-sp restart</pre>
<p>Done! Test it out by opening your site using <span class="lang:default decode:true crayon-inline ">https://</span>  prefix, eg: https://www.yourdomain.com.</p>
<p>You may need to adjust your site&#8217;s settings to ensure all components are called using <span class="lang:default decode:true crayon-inline ">https://</span>  instead of <span class="lang:default decode:true crayon-inline ">http://</span> , but that&#8217;s a whole different process and not going to be covered here.</p>
<p>The post <a href="https://sunarlim.com/2016/07/ssl-digitalocean-serverpilot-apache/">SSL certificate installation on DigitalOcean + ServerPilot (Apache)</a> appeared first on <a href="https://sunarlim.com">Michael Sunarlim</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sunarlim.com/2016/07/ssl-digitalocean-serverpilot-apache/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2211</post-id>	</item>
		<item>
		<title>Archiving Commands via SSH</title>
		<link>https://sunarlim.com/2013/02/archiving-commands-ssh/</link>
					<comments>https://sunarlim.com/2013/02/archiving-commands-ssh/#respond</comments>
		
		<dc:creator><![CDATA[Michael]]></dc:creator>
		<pubDate>Sun, 17 Feb 2013 06:13:45 +0000</pubDate>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[archiving]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[terminal]]></category>
		<guid isPermaLink="false">https://sunarlim.com/?p=536</guid>

					<description><![CDATA[<p>Extract compressed file: [syntax_prettify linenums=&#8221;0&#8243;]tar -zxvf file.tar.gz[/syntax_prettify] Extract uncompressed file: [syntax_prettify linenums=&#8221;0&#8243;]tar -xvf file.tar[/syntax_prettify] Takes everything from folder_to_be_archived/ and puts it into archived_filename.tar: [syntax_prettify linenums=&#8221;0&#8243;]tar -cf archived_filename.tar folder_to_be_archived/[/syntax_prettify] &#160;</p>
<p>The post <a href="https://sunarlim.com/2013/02/archiving-commands-ssh/">Archiving Commands via SSH</a> appeared first on <a href="https://sunarlim.com">Michael Sunarlim</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Extract compressed file:</p>
<p>[syntax_prettify linenums=&#8221;0&#8243;]tar -zxvf file.tar.gz[/syntax_prettify]</p>
<p>Extract uncompressed file:</p>
<p>[syntax_prettify linenums=&#8221;0&#8243;]tar -xvf file.tar[/syntax_prettify]</p>
<p>Takes everything from folder_to_be_archived/ and puts it into archived_filename.tar:</p>
<p>[syntax_prettify linenums=&#8221;0&#8243;]tar -cf archived_filename.tar folder_to_be_archived/[/syntax_prettify]</p>
<p>&nbsp;</p>
<p>The post <a href="https://sunarlim.com/2013/02/archiving-commands-ssh/">Archiving Commands via SSH</a> appeared first on <a href="https://sunarlim.com">Michael Sunarlim</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sunarlim.com/2013/02/archiving-commands-ssh/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">536</post-id>	</item>
		<item>
		<title>SSH Cheatsheet</title>
		<link>https://sunarlim.com/2008/08/ssh-cheatsheet/</link>
					<comments>https://sunarlim.com/2008/08/ssh-cheatsheet/#respond</comments>
		
		<dc:creator><![CDATA[Michael]]></dc:creator>
		<pubDate>Mon, 25 Aug 2008 18:56:23 +0000</pubDate>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[web server]]></category>
		<guid isPermaLink="false">http://wp.sunarlim.com.com/?p=116</guid>

					<description><![CDATA[<p>Funny, I never really took any use SSH until recently. So I have a whole lot of commands to learn and remember, and I am lousy at remembering! Good thing I found this Common SSH Commands page. All the basic commands and short description for each of them. Definitely helpful!</p>
<p>The post <a href="https://sunarlim.com/2008/08/ssh-cheatsheet/">SSH Cheatsheet</a> appeared first on <a href="https://sunarlim.com">Michael Sunarlim</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Funny, I never really took any use SSH until recently. So I have a whole lot of commands to learn and remember, and I am lousy at remembering! Good thing I found this <a href="http://www.webhostgear.com/35.html" target="_blank">Common SSH Commands</a> page. All the basic commands and short description for each of them. Definitely helpful!</p>
<p>The post <a href="https://sunarlim.com/2008/08/ssh-cheatsheet/">SSH Cheatsheet</a> appeared first on <a href="https://sunarlim.com">Michael Sunarlim</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sunarlim.com/2008/08/ssh-cheatsheet/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">116</post-id>	</item>
	</channel>
</rss>
