<?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/"
	>

<channel>
	<title>experimental &#187; certificate</title>
	<atom:link href="http://www.tajidyakub.com/tag/certificate/feed" rel="self" type="application/rss+xml" />
	<link>http://www.tajidyakub.com</link>
	<description>Experience the Experiment</description>
	<lastBuildDate>Sat, 10 Oct 2009 19:32:38 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HTTPS, SSL and Nginx</title>
		<link>http://www.tajidyakub.com/web-servers/https-ssl-and-nginx-2008-07-27.html</link>
		<comments>http://www.tajidyakub.com/web-servers/https-ssl-and-nginx-2008-07-27.html#comments</comments>
		<pubDate>Sat, 26 Jul 2008 18:37:15 +0000</pubDate>
		<dc:creator>Tajid Yakub</dc:creator>
				<category><![CDATA[Web Servers]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://tajidyakub.com/?p=15</guid>
		<description><![CDATA[Say you want to run https port on nginx using a self signed SSL Certificate, this article summarized the steps. First we create the SSL Key, CSR (Certificate Signing Request) and CRT (SSL Certificate) and Configure nginx to answer the request from SSL port.

These are the original articles;
http://rubyjudo.com/2006/11/2/nginx-ssl-rails
http://articles.slicehost.com/2007/12/19/ubuntu-gutsy-self-signed-ssl-certificates-and-nginx
 http://blog.skateinmars.net/post/2007/11/01/phpMyAdmin-and-HTTPS-on-nginx
The aim is to run phpMyAdmin in [...]]]></description>
			<content:encoded><![CDATA[<p>Say you want to run https port on nginx using a self signed SSL Certificate, this article summarized the steps. First we <strong>create the SSL Key, CSR (Certificate Signing Request) and CRT (SSL Certificate) and Configure nginx</strong> to answer the request from SSL port.</p>
<p><span id="more-15"></span></p>
<p><strong>These are the original articles;</strong></p>
<p><a href="http://articles.slicehost.com/2007/12/19/ubuntu-gutsy-self-signed-ssl-certificates-and-nginx" target="_blank">http://rubyjudo.com/2006/11/2/nginx-ssl-rails<br />
</a><a href="http://articles.slicehost.com/2007/12/19/ubuntu-gutsy-self-signed-ssl-certificates-and-nginx" target="_blank">http://articles.slicehost.com/2007/12/19/ubuntu-gutsy-self-signed-ssl-certificates-and-nginx</a><br />
<a href="http://blog.skateinmars.net/post/2007/11/01/phpMyAdmin-and-HTTPS-on-nginx" target="_blank"> http://blog.skateinmars.net/post/2007/11/01/phpMyAdmin-and-HTTPS-on-nginx</a></p>
<p>The aim is to run <a title="phpMyAdmin" href="http://www.phpmyadmin.net/" target="_blank">phpMyAdmin</a> in secured mode served by <a title="Nginx" href="http://nginx.net" target="_blank">nginx</a>.<br />
<strong></strong></p>
<p><strong>Create Keys and Certificates</strong></p>
<p>Make a temp directory and remove it later after the setup succeed.</p>
<pre class="brush: bash">mkdir /home/username/temp
cd /home/username/temp
</pre>
<p>Create the private key, it will require a passphrase (it will be removed later on)</p>
<pre class="brush: bash">openssl genrsa -des3 -out pma.key 1024</pre>
<p>Create the CSR (Certificate Signing Request), and enter the information required;</p>
<pre class="brush: bash">openssl req -new -key pma.key -out pma.csr</pre>
<p>Then we remove the passphrase entered earlier when we create the key, if not, the box will ask us to enter the passphrase on every reboot.</p>
<pre class="brush: bash">cp pma.key pma.key.org
openssl rsa -in pma.key.org -out pma.key</pre>
<p>Afterward, the digital certificate itself</p>
<pre class="brush: bash">openssl x509 -req -days 365 -in pma.csr -signkey pma.key -out pma.crt</pre>
<p>The last thing is to put the files in the right place, to be called later by nginx, the final directory will depend on your config, in my case I want to put it inside nginx directory.</p>
<pre class="brush: bash">mkdir /usr/local/nginx/cert
cp pma.crt pma.key /usr/local/nginx/cert</pre>
<p>Feel free to delete the temporary directory created for this purpose, or you might want to wait until your setup is done.</p>
<p><strong>Nginx Virtual Host HTTPS</strong></p>
<p>This is my final setup on phpMyAdmin subdomain (only the server part), I really can&#8217;t explain anything for now :), I just now it worked.</p>
<pre class="brush: bash">server {
listen pma.yourdomain.com:443;
client_max_body_size 10M;
index index.php;
server_name pma.yourdomain.com;
root /var/www/pma.yourdomain.com;

ssl on;
ssl_certificate /usr/local/nginx/certs/pma.crt;
ssl_certificate_key /usr/local/nginx/certs/pma.key;

location / {
proxy_set_header X_FORWARDED_PROTO https;
proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect false;
proxy_max_temp_file_size 0;
}

location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param HTTPS on;
include /usr/local/nginx/conf/fastcgi_params;

}

}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tajidyakub.com/web-servers/https-ssl-and-nginx-2008-07-27.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
