{"id":77,"date":"2007-09-01T21:32:37","date_gmt":"2007-09-02T05:32:37","guid":{"rendered":"http:\/\/learnbyblogging.com\/?p=77"},"modified":"2007-09-01T21:32:37","modified_gmt":"2007-09-02T05:32:37","slug":"installing-apache2-with-ssl-httpd-on-solaris-10","status":"publish","type":"post","link":"https:\/\/learnbyblogging.com\/?p=77","title":{"rendered":"Installing Apache2 with SSL (httpd) on Solaris 10"},"content":{"rendered":"<p>Most of the below are copied from Mel Lester Jr. (meljr@meljr.com) with some minor modifications to <a href=\"http:\/\/meljr.com\/~meljr\/apache2_Sol10.html\">his tips<\/a>: <\/p>\n<p>Apache 2.xx is included with Solaris 10. A few configuration details need to be addressed prior to starting Apache 2.xx:<br \/>\n\t1. Login as root<br \/>\nwired# _<\/p>\n<p>\t2. Copy the file, \/etc\/apache2\/httpd.conf-example to \/etc\/apache2\/httpd.conf<br \/>\nwired# cp \/etc\/apache2\/httpd.conf-example \/etc\/apache2\/httpd.conf<\/p>\n<p>\t3. Edit \/etc\/apache2\/httpd.conf<br \/>\n\t\t? Set ServerName if necessary (default is 127.0.0.1)<br \/>\n\t\t? Set ServerAdmin to a valid email address<br \/>\n\t4. From the command line type:<br \/>\nwired# svcadm enable apache2<\/p>\n<p>That is all it takes to to start the basic Apache 2 web server bundled with Solaris 10. In fact, the Apache 2 web service should persist through server and\/or zone boots. The actual web pages are located in the \/var\/apache2\/htdocs directory by default.<\/p>\n<p><strong><a href=\"http:\/\/meljr.com\/~meljr\/ssl_cert_Sol10.html\">SSL Certificate Configuration for Apache2 on Solaris 10<br \/>\nBy: Mel Lester Jr. (meljr@meljr.com)<br \/>\nVersion 1.04 June 21, 2006)<\/a><\/strong><br \/>\n\t1. Enable SSL Service Property if necessary. Log in as root and issue the following command:<br \/>\nweb# svcprop -p httpd\/ssl svc:network\/http:apache2<\/p>\n<p>If the response is &#8220;false&#8221;, issue these three commands:<br \/>\nweb# svccfg -s http:apache2 setprop httpd\/ssl=true<br \/>\nweb# svcadm refresh http:apache2<br \/>\nweb# svcprop -p httpd\/ssl svc:network\/http:apache2<\/p>\n<p>If the response is &#8220;true&#8221;, continue to the next step.<br \/>\n\t2. Create a Certificate Directory and a Key Directory.<br \/>\nweb# mkdir \/etc\/apache2\/ssl.crt<br \/>\nweb# mkdir \/etc\/apache2\/ssl.key<\/p>\n<p>\t3. Generate a RSA Key.<br \/>\nweb# \/usr\/local\/ssl\/bin\/openssl genrsa -des3 1024 > \/etc\/apache2\/ssl.key\/server.key<br \/>\nGenerating RSA private key, 1024 bit long modulus<br \/>\n&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..++++++<br \/>\n&#8230;&#8230;&#8230;++++++<br \/>\ne is 65537 (0x10001)<br \/>\nEnter pass phrase: ********<br \/>\nVerifying &#8211; Enter pass phrase: ********<\/p>\n<p>\t4. Generate a Certificate Request.<br \/>\nweb# \/usr\/local\/ssl\/bin\/openssl req -new -key \/etc\/apache2\/ssl.key\/server.key > \\<br \/>\n> \/etc\/apache2\/ssl.crt\/server.csr<br \/>\nEnter pass phrase for \/etc\/apache2\/ssl.key\/server.key: ********<br \/>\nYou are about to be asked to enter information that will be incorporated<br \/>\ninto your certificate request.<br \/>\nWhat you are about to enter is what is called a Distinguished Name or a DN.<br \/>\nThere are quite a few fields but you can leave some blank<br \/>\nFor some fields there will be a default value,<br \/>\nIf you enter &#8216;.&#8217;, the field will be left blank.<br \/>\n&#8212;&#8211;<br \/>\nCountry Name (2 letter code) [US]::US<br \/>\nState or Province Name (full name) [Some-State]:OR<br \/>\nLocality Name (eg, city) []:Blodgett<br \/>\nOrganization Name (eg, company) [Unconfigured OpenSSL Installation]:DIS<br \/>\nOrganizational Unit Name (eg, section) []:IT<br \/>\nCommon Name (eg, YOUR name) []:Big Cheese<br \/>\nEmail Address []:meljr@meljr.com<br \/>\nPlease enter the following &#8216;extra&#8217; attributes<br \/>\nto be sent with your certificate request<br \/>\nA challenge password []: ********<br \/>\nAn optional company name []: Live Free or Die<\/p>\n<p>\t5. Install a Self-Signed Certificate. If you are going to install a certificate from an authoritative source, follow their instructions and skip this step.<br \/>\nweb# \/usr\/local\/ssl\/bin\/openssl  req -x509 -days 3650 -key \\<br \/>\n> \/etc\/apache2\/ssl.key\/server.key \\<br \/>\n> -in \/etc\/apache2\/ssl.crt\/server.csr > \\<br \/>\n> \/etc\/apache2\/ssl.crt\/server.crt<br \/>\nEnter pass phrase for \/etc\/apache2\/ssl.key\/server.key: ********<\/p>\n<p>\t6. Modify the ssl.conf file to use your certificate.<br \/>\nweb# cd \/etc\/apache2<br \/>\nweb# ls -l<br \/>\ntotal 334<br \/>\n-rw-r&#8211;r&#8211; 1 root bin 1987 Jan 6 21:10 highperformance-std.conf<br \/>\n-rw-r&#8211;r&#8211; 1 root bin 1987 Jan 6 21:10 highperformance.conf<br \/>\n-rw-r&#8211;r&#8211; 1 root bin 37519 Jan 6 21:10 httpd-std.conf<br \/>\n-rw-r&#8211;r&#8211; 1 root root 37660 Jan 18 21:49 httpd.conf<br \/>\n-rw-r&#8211;r&#8211; 1 root bin 37661 Jul 20 2005 httpd.conf-example<br \/>\n-rw-r&#8211;r&#8211; 1 root bin 12959 Jan 6 21:10 magic<br \/>\n-rw-r&#8211;r&#8211; 1 root bin 15020 Jan 6 21:10 mime.types<br \/>\n-rw-r&#8211;r&#8211; 1 root bin 10759 Jan 6 21:10 ssl-std.conf<br \/>\n-rw-r&#8211;r&#8211; 1 root bin 10996 Jan 6 21:10 ssl.conf<br \/>\ndrwxr-xr-x 2 root root 512 Jan 19 03:24 ssl.crt<br \/>\ndrwxr-xr-x 2 root root 512 Jan 19 02:52 ssl.key<\/p>\n<p>Edit the ssl.conf and change the line that begins with &#8220;ServerAdmin&#8221; to reflect an email address or alias for the Server&#8217;s Administrator.<br \/>\n\t7. Test the SSL Certificate with Apache2<br \/>\n\t\t? If Apache2 is enabled, disable it during testing.<br \/>\nweb# svcs | grep -i apache2<br \/>\nonline 3:29:01 svc:\/network\/http:apache2<br \/>\nweb# svcadm disable apache2<\/p>\n<p>\t\t? Use the legacy script to manually test start Apache2 with SSL.<br \/>\nweb# \/usr\/apache2\/bin\/apachectl startssl<br \/>\nApache\/2.0.52 mod_ssl\/2.0.52 (Pass Phrase Dialog)<br \/>\nSome of your private key files are encrypted for security reasons.<br \/>\nIn order to read them you have to provide us with the pass phrases.<br \/>\nServer 127.0.0.1:443 (RSA)<br \/>\nEnter pass phrase: ********<br \/>\nOk: Pass Phrase Dialog successful.<\/p>\n<p>If this test fails with an error similar to &#8216;vhost.c:232 assertion &#8220;rv == APR_SUCCESS&#8221; failed on startssl&#8217;, your server may not be configured to use DNS to resolve host names. This failure is due to a known bug in Apache2 2.0.nn. A quick fix is be to edit the hosts line in your server&#8217;s \/etc\/nsswitch.conf to look like the following:<br \/>\nhosts: files dns<\/p>\n<p>More information about this issue may be found at:<br \/>\nhttp:\/\/issues.apache.org\/bugzilla\/show_bug.cgi?id=27525<\/p>\n<p>After editing \/etc\/nsswitch.conf or otherwise resolving the issue, repeat the test until you are able to manually start and stop Apache2 using your SSL Certificate and Pass Phrase.<br \/>\nweb# ps -ef | grep httpd<br \/>\nroot 1392 575 0 03:45:16 ? 0:01 \/usr\/apache2\/bin\/httpd -k start -DSSL<br \/>\nroot 1400 1116 0 03:45:51 pts\/3 0:00 grep httpd<br \/>\nwebservd 1393 1392 0 03:45:18 ? 0:00 \/usr\/apache2\/bin\/httpd -k start -DSSL<br \/>\nwebservd 1397 1392 0 03:45:18 ? 0:00 \/usr\/apache2\/bin\/httpd -k start -DSSL<br \/>\nwebservd 1396 1392 0 03:45:18 ? 0:00 \/usr\/apache2\/bin\/httpd -k start -DSSL<br \/>\nwebservd 1395 1392 0 03:45:18 ? 0:00 \/usr\/apache2\/bin\/httpd -k start -DSSL<br \/>\nwebservd 1394 1392 0 03:45:18 ? 0:00 \/usr\/apache2\/bin\/httpd -k start -DSSL<\/p>\n<p>\t\t? If your results are similar to the one above, use the legacy script to conclude the test. You may also want to verify that a client browser can access your site using https before continuing. Accept the self-signed Certificate if necessary.<br \/>\nweb# \/usr\/apache2\/bin\/apachectl stop<\/p>\n<p>\t8. Enable Apache2 with SSL to be started automatically as a service.<br \/>\nweb# cd \/etc\/apache2\/ssl.key<br \/>\nweb# cp server.key server.key.org<br \/>\nweb# \/usr\/local\/ssl\/bin\/openssl rsa -in server.key.org -out server.key<br \/>\nEnter pass phrase for server.key.org: ********<br \/>\nwriting RSA key<br \/>\nweb# chmod 400 server.key<br \/>\nweb# svcadm enable apache2<br \/>\nweb# svcs | grep -i apache2<br \/>\nonline 4:29:01 svc:\/network\/http:apache2<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most of the below are copied from Mel Lester Jr. (meljr@meljr.com) with some minor modifications to his tips: Apache 2.xx is included with Solaris 10. A few configuration details need to be addressed prior to starting Apache 2.xx: 1. Login as root wired# _ 2. Copy the file, \/etc\/apache2\/httpd.conf-example to \/etc\/apache2\/httpd.conf wired# cp \/etc\/apache2\/httpd.conf-example \/etc\/apache2\/httpd.conf &hellip; <a href=\"https:\/\/learnbyblogging.com\/?p=77\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Installing Apache2 with SSL (httpd) on Solaris 10<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-77","post","type-post","status-publish","format-standard","hentry","category-tips-for-computer"],"_links":{"self":[{"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=\/wp\/v2\/posts\/77","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=77"}],"version-history":[{"count":0,"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=\/wp\/v2\/posts\/77\/revisions"}],"wp:attachment":[{"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=77"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=77"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}