<?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>OpenKB::Server Technical Papers &#187; SSL Cert &amp; OpenSSL</title>
	<atom:link href="http://www.openkb.org/category/ssl-cert-openssl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.openkb.org</link>
	<description>Computer , server issues and solutions</description>
	<lastBuildDate>Sat, 17 Jul 2010 21:16:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Generating a SSL Cert for linux</title>
		<link>http://www.openkb.org/generating-a-ssl-cert-for-linux/</link>
		<comments>http://www.openkb.org/generating-a-ssl-cert-for-linux/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 18:27:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SSL Cert & OpenSSL]]></category>

		<guid isPermaLink="false">http://blog.masadmin1.com/?p=29</guid>
		<description><![CDATA[Generating RSA &#38; CSR (Signing Request) [root@yupapa root]# [root@yupapa root]# cd /etc/httpd/conf/ssl.key OPTION 1: Generating a RSA private key without a passphrase (ME recommended) [root@yupapa /etc/httpd/conf/ssl.key]# openssl genrsa -out MYdomain.com.key 1024 OPTION 2: Generating a RSA private key with a passphrase. You will be prompted to enter a passphrase right after you hit enter. [root@yupapa [...]]]></description>
			<content:encoded><![CDATA[<p><span>Generating RSA &amp; CSR (Signing Request)</p>
<p>[root@yupapa root]#<br />
[root@yupapa root]# cd /etc/httpd/conf/ssl.key</p>
<p>OPTION 1: Generating a RSA private key without a passphrase (ME recommended)<br />
[root@yupapa /etc/httpd/conf/ssl.key]# openssl genrsa -out MYdomain.com.key 1024</p>
<p>OPTION 2: Generating a RSA private key with a passphrase. You will be prompted to enter a passphrase right after you hit enter.<br />
[root@yupapa /etc/httpd/conf/ssl.key]# openssl genrsa -des3 -out MYdomain.com.key 1024</p>
<p>You should NOT generate the RSA private key with a passphrase if you have scripts that restart apache automatically. If you have, then apache just sit there and wait for the script to input the passphrase which is a mess!<br />
There is a method that you can disable the passphrase to prompt when you restart apache which I&#8217;ll show you later~</p>
<p>Next generate the CSR using the RSA Private Key</p>
<p>[root@yupapa /etc/httpd/conf/ssl.csr]# openssl req -new -key MYdomain.com.key -out MYdomain.com.csr<br />
[root@yupapa /etc/httpd/conf/ssl.csr]# mv MYdomain.com.csr ../ssl.csr</p>
<p>You will be asked to enter your Common Name, Organization, Organization Unit, City or Locality, State or Province and Country.<br />
Do not enter these characters &#8216;&lt; &gt; ~ ! @ # $ % ^ * / ( ) ?.,&amp;&#8217; because they will not be accepted.</p>
<p>Common Name: the domain for the web server (e.g. MYdomain.com)<br />
Organization: the name of your organization (e.g. YUPAPA)<br />
Organization Unit: the section of the organization (e.g. Sales)<br />
City or Locality: the city where your organzation is located (e.g. Flanders)<br />
State or Province: the state / province where your organzation is located (e.g New Jersey)<br />
Country: the country where your organzation is located (e.g US)</p>
<p>You may be asked for emeow address and challenge challenge password. I just hit enter when I generate the csr~</p>
<p>Now you should have:<br />
/etc/httpd/conf/ssl.key/MYdomain.com.key<br />
/etc/httpd/conf/ssl.csr/MYdomain.com.csr</p>
<p>Make a backup copy of your private key! If you lose it, you have to purchase a new cert!</p>
<p>Now you should submit your csr and they will mail you the certificate.</p>
<p>Installing the Certificate for Apache</p>
<p>[root@yupapa root]# cd /etc/httpd/conf/ssl.crt</p>
<p>Copy the certificate that they mailed you to MYdomain.com.crt<br />
Open your httpd.conf file and place the following to your virtualhost</p>
<p><virtualhost><br />
&#8230; some config like DocumentRoot , etc..<br />
SSLEngine  on<br />
SSLCertificateFile /etc/httpd/conf/ssl.crt/MYdomain.com.crt<br />
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/MYdomain.com.key<br />
</virtualhost></p>
<p>Restart apache<br />
OPTION 1 [root@yupapa /etc/httpd/conf/ssl.crt]# apachectl restart<br />
OPTION 2 (using the sh script) [root@yupapa /etc/httpd/conf/ssl.crt]# /etc/rc.d/init.d/httpd restart</p>
<p>You may be asked to enter the passphrase IF you generated the RSA with a passphrase. If you do NOT want to be asked for a passphrase when restarting apache, re-generate your RSA key file.<br />
[root@yupapa /etc/httpd/conf/ssl.crt]# cd ../ssl.key<br />
[root@yupapa /etc/httpd/conf/ssl.key]# mv MYdomain.com.key MYdomain.com.key.has-passphrase<br />
[root@yupapa /etc/httpd/conf/ssl.key]# openssl rsa -in MYdomain.com.key.has-passphrase -out MYdomain.com.key</p>
<p>And then restart apache again<br />
[root@yupapa /etc/httpd/conf/ssl.crt]# /etc/rc.d/init.d/httpd restart</p>
<p>Now you should be able to access https://MYdomain.com ~ And Finally make sure those directories and files are only writable and readable by root!</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.openkb.org/generating-a-ssl-cert-for-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
