{"id":616,"date":"2010-11-02T12:10:02","date_gmt":"2010-11-02T17:10:02","guid":{"rendered":"http:\/\/it.thelibrarie.com\/weblog\/?p=616"},"modified":"2010-11-02T12:10:02","modified_gmt":"2010-11-02T17:10:02","slug":"add-ssl-to-apache2-ubuntu","status":"publish","type":"post","link":"https:\/\/it.thelibrarie.com\/weblog\/2010\/11\/add-ssl-to-apache2-ubuntu\/","title":{"rendered":"Add SSL To Apache2 Ubuntu"},"content":{"rendered":"<p>This uses a Microsoft Certificate Authority.  If you want a self-signed SSL, check the bottom of the post.<\/p>\n<p>I needed to create a way for end users to go to a site (http:\/\/callmanager) and be able to login to their Cisco Callmanager page without receiving any certificate errors.  Unfortunately the call manager device was named &#8220;imcm1&#8221;, and cisco won&#8217;t let me create a certificate for anything besides the device name.  Our users were trained to use &#8220;callmanager&#8221; as the name.  So I had two options:<br \/>\n1.) Re-Train employees to no longer use the easier to remember &#8220;callmanager&#8221; name<br \/>\n2.) Utilize an Ubuntu webserver to redirect the users where I want them to be<br \/>\nObviously I chose the much harder route &#8211; well it&#8217;s harder technically, but&#8230; yes.<\/p>\n<p>Using Ubuntu 10.04.1 LTS x32.  I installed LAMP and SSH.  This is on a domain (company.local) running windows 2003 and AD.  There is a Certificate Authority installed on one of the domain controllers (2003 Enterprise).  I use Putty and WinSCP.<\/p>\n<p><strong>Update Ubuntu:<\/strong><br \/>\nI run everything as root.  So su to root.<br \/>\n<code>apt-get update<\/code><br \/>\n<code>apt-get upgrade<\/code><br \/>\n<code>apt-get dist-upgrade<\/code><\/p>\n<p><strong>Create the CSR:<\/strong><br \/>\n<code>mkdir \/etc\/apache2\/ssl<br \/>\ncd \/etc\/apache2\/ssl<br \/>\nopenssl genrsa -out callmanager.key 1024<br \/>\nchmod 640 callmanager.key<br \/>\nopenssl req -new -key callmanager.key -out callmanager.csr<\/code><br \/>\nProvide your information:<\/p>\n<blockquote><p>Country Name: US<br \/>\nState: IL<br \/>\nCity: Chicago<br \/>\nOrganization Name: Company<br \/>\nOrganization Unit: IT<br \/>\nCommon Name: FQDN_Here!  I used &#8220;callmanager&#8221;, but you may be utilizing &#8220;callmanager.domain.local&#8221;<br \/>\nEmail: blank<br \/>\nChallenge password: blank<br \/>\nOptional company: blank<\/p><\/blockquote>\n<p><strong>Copy The Certificate To Your Certificate Authority:<\/strong><br \/>\n<code>cat callmanager.csr<\/code><\/p>\n<blockquote><p>Copy everything from &#8220;&#8212;&#8211;BEGIN CERTIFICATE REQUEST&#8230;&#8221; to &#8220;&#8230;END CERTIFICATE REQUEST&#8212;&#8211;&#8221;<br \/>\nConnect to your certificate authority: http:\/\/certificateserver\/certsrv.  My Win7 would <u>not<\/u> work with a 2003 Server CA so I had to run it local on the server (http:\/\/localhost\/certsrv)<br \/>\nClick Request A Certificate<br \/>\nClick advanced certificate request<br \/>\nChoose the middle option (PKCS #10 or PKCS#7)<br \/>\nPaste what you copied above into the Saved Request area<br \/>\nChoose the certificate template &#8220;Webserver&#8221;<br \/>\nClick submit<br \/>\nClick Download certificate (DER encoding!)<\/p><\/blockquote>\n<p><strong>Convert And Install The Certificate On Ubuntu:<\/strong><br \/>\nCopy the .cer file (callmanager.cer) to your linux box in the \/etc\/apache2\/ssl directory<br \/>\n<code>chmod 640 callmanager.cer<br \/>\nopenssl x509 -in callmanager.cer -inform d -out callmanager.pem<br \/>\nchmod 640 callmanager.pem<\/code><\/p>\n<p><strong>Edit Apache To Support SSL:<\/strong><br \/>\n<code>a2enmod ssl<br \/>\napache2ctl restart<br \/>\ncp \/etc\/apache2\/sites-available\/default-ssl ..\/sites-enabled\/<br \/>\nnano \/etc\/apache2\/sites-enabled\/default-ssl<\/code><br \/>\nScroll down to &#8220;SSLCertificateFile \/etc\/ssl&#8230;&#8221;<br \/>\nChange the location to be <code>\/etc\/apache2\/ssl\/callmanager.pem<\/code><br \/>\nThen, scroll down to &#8220;SSLCertificateKeyFile \/etc\/ssl&#8230;&#8221;<br \/>\nChange the location to be <code>\/etc\/apache2\/ssl\/callmanager.key<\/code><\/p>\n<p><strong>Finish The Redirect:<\/strong><br \/>\nUnder the SSLCertificate edits, I added the following:<br \/>\n<code>ServerName callmanager<\/code><br \/>\n<code>Redirect permanent \/ https:\/\/imcm1\/<\/code><br \/>\nSave the file<br \/>\n<code>apache2ctl restart<\/code><\/p>\n<p>Test!  Works for me!<\/p>\n<p>Create A Self-Signed Certificate:<br \/>\nHopefully coming soon.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This uses a Microsoft Certificate Authority. If you want a self-signed SSL, check the bottom of the post. I needed to create a way for end users to go to a site (http:\/\/callmanager) and be able to login to their Cisco Callmanager page without receiving any certificate errors. Unfortunately the call manager device was named &hellip; <a href=\"https:\/\/it.thelibrarie.com\/weblog\/2010\/11\/add-ssl-to-apache2-ubuntu\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Add SSL To Apache2 Ubuntu<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,8],"tags":[],"class_list":["post-616","post","type-post","status-publish","format-standard","hentry","category-linux","category-microsoft"],"_links":{"self":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/comments?post=616"}],"version-history":[{"count":1,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/616\/revisions"}],"predecessor-version":[{"id":617,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/616\/revisions\/617"}],"wp:attachment":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/media?parent=616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/categories?post=616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/tags?post=616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}