<?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>Rule of Tech &#187; sysadmin</title>
	<atom:link href="http://ruleoftech.com/journal/tag/sysadmin/feed" rel="self" type="application/rss+xml" />
	<link>http://ruleoftech.com</link>
	<description>Everything and nothing but still something about Tech</description>
	<lastBuildDate>Thu, 02 Feb 2012 14:58:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using CAcert.org signed certificates for TLS</title>
		<link>http://ruleoftech.com/journal/using-cacert-org-signed-certificates-for-tls</link>
		<comments>http://ruleoftech.com/journal/using-cacert-org-signed-certificates-for-tls#comments</comments>
		<pubDate>Mon, 09 Jan 2012 19:26:56 +0000</pubDate>
		<dc:creator>Marko</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[certs]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://ruleoftech.wordpress.com/?p=31</guid>
		<description><![CDATA[<p>Setting up Transport Layer Security (TLS), or as previously known as Secure Sockets Layer (SSL), for Apache, Postfix and IMAP like Dovecot is fairly easy. You just need some digital certificates and configuration. If you don&#8217;t want to pay for certificates from trusted sources like Thawte or you just don&#8217;t need that kind of trust (for development purposes), you can always produce your own certificates.&#8230; <a href="http://ruleoftech.com/journal/using-cacert-org-signed-certificates-for-tls" class="read_more">Continue reading <span class=\\\"meta-nav\\\">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p>Setting up Transport Layer Security (TLS), or as previously known as Secure Sockets Layer (SSL), for Apache, Postfix and IMAP like Dovecot is fairly easy. You just need some digital certificates and configuration. If you don&#8217;t want to pay for certificates from trusted sources like Thawte or you just don&#8217;t need that kind of trust (for development purposes), you can always produce your own certificates. But there is also a middle way: using <a href="http://www.cacert.org/">CAcert.org</a> signed certificates.</p>
<p><strong>Background</strong><br />
<a href="http://en.wikipedia.org/wiki/CAcert.org">Wikipedia tells us that CAcert.org is</a> a community-driven certificate authority that issues free public key certificates. CAcert automatically signs certificates for email addresses controlled by the requester and for domains for which certain addresses (such as &#8220;hostmaster@example.com&#8221;) are controlled by the requester. Thus it operates as a robot certificate authority. CAcert certificates can be used like any other SSL certificates although they are considered weak because CAcert does not emit any information in the certificates other than the domain name or email address. To create higher-trust certificates, users can participate in a web of trust system whereby users physically meet and verify each other&#8217;s identities. They are also not as useful in web browsers as certificates issued by commercial CAs such as VeriSign, because most installed web browsers do not distribute CAcert&#8217;s root certificate. Thus, for most web users, a certificate signed by CAcert behaves like a self-signed certificate. </p>
<p><strong>Generating Certificates</strong><br />
The procedure to sign your certificate at CAcert is rather simple. This guide assumes that the certificates are in <em>/etc/ssl/cacert/</em> and you are as <em>root</em>.</p>
<p>0. <a href="https://wiki.cacert.org/HELP/6">Join CAcert.org</a> and fill in your details. After email verification and login, add domain and service will try to verify that you can read mail on one of following accounts: root, hostmaster, postmaster, admin, webmaster or email addresses that can be found on whois data of domain that you provided.</p>
<p>1. Generate a private key that is not file encrypted:</p>
<pre>
<code>openssl genrsa -out domainname.key 1024
chown root:root domainname.key
chmod 0400 domainname.key</code>
</pre>
<p>Private keys should belong to &#8220;root&#8221; and be readable only by root.</p>
<p>You could also create a private key that is encrypted: <code>openssl genrsa -des3 -out domainname.key 1024</code></p>
<p>2. Create a CSR with the RSA private key (output will be PEM format). Do not enter extra attributes at the prompt and leave the challenge password blank (press enter): </p>
<pre>
<code>openssl req -new -key domainname.key -out domainname.csr</code>
</pre>
<p>3. Verify the contents of the CSR or private key:</p>
<pre>
<code>openssl req -noout -text -in domainname.csr</code>
<code>openssl rsa -noout -text -in domainname.key</code>
</pre>
<p>4. Send your public key to be signed by and request new server certificate from CAcert.org web site (Class 1 certificate). When you are asked for CSR paste content of <em>domainname.csr</em>. It should look like this:</p>
<pre>
-----BEGIN CERTIFICATE REQUEST-----
MIIB3TCCAUYCAQAwgZwxCzAJBgNVBAYTAkZJMRAwDgYDVQQIEwdVdXNpbWFhMQ8w
...clip...
MQ==
-----END CERTIFICATE REQUEST-----
</pre>
<p>You can verify the content of request before sending it</p>
<pre>
<code>openssl req -in domainname.csr -text -verify -noout</code>
</pre>
<p>5. Copy the Server Certificate from the CAcert.org webpage and put it in <em>domainname.crt</em> file and add permissions.</p>
<pre>
<code>chmod a=r domainname.crt</code>
</pre>
<p>Check at least the contents of Validity and Subject fields:</p>
<pre>
<code>openssl x509 -in domainname.crt -text -noout</code>
</pre>
<p>6. Get CAcert.org root certificate</p>
<pre>
<code>wget -nv https://www.cacert.org/certs/root.crt -O cacert-org.crt
chmod a=r cacert-org.crt</code>
</pre>
<p>Check the contents:</p>
<pre>
<code>openssl x509 -in cacert-org.crt -text -noout</code>
</pre>
<p>After that you&#8217;re ready to configure your services like Apache, Postfix and Dovecot to use the new certificate. Read about it later.</p>
<h2  class="related_post_title">Related journal entries</h2><ul class="related_post"><li><a href="http://ruleoftech.com/journal/installing-sun-jdk-1-6-on-centos" title="Installing Sun JDK 1.6 on CentOS">Installing Sun JDK 1.6 on CentOS</a></li><li><a href="http://ruleoftech.com/journal/wordpress-mod_rewrite-rules-taking-over-mod_status-and-mod_info" title="WordPress mod_rewrite rules taking over mod_status and mod_info">WordPress mod_rewrite rules taking over mod_status and mod_info</a></li><li><a href="http://ruleoftech.com/journal/installing-apache-tomcat-6-on-centos" title="Installing Apache Tomcat 6 on CentOS">Installing Apache Tomcat 6 on CentOS</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://ruleoftech.com/journal/using-cacert-org-signed-certificates-for-tls/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress mod_rewrite rules taking over mod_status and mod_info</title>
		<link>http://ruleoftech.com/journal/wordpress-mod_rewrite-rules-taking-over-mod_status-and-mod_info</link>
		<comments>http://ruleoftech.com/journal/wordpress-mod_rewrite-rules-taking-over-mod_status-and-mod_info#comments</comments>
		<pubDate>Thu, 16 Jun 2011 17:53:31 +0000</pubDate>
		<dc:creator>Marko</dc:creator>
				<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://ruleoftech.com/?p=191</guid>
		<description><![CDATA[<p>After moving <em>Rule of Tech</em> to a new server and setting up monitoring I noticed that server-status and server-info Apache modules weren&#8217;t working as expected. As usual a little bit of Googling <a href="http://www.ducea.com/2009/03/01/wordpress-mod_rewrite-rules-taking-over-mod_status/">solved this problem</a>.</p>
<p>The problem was that the .htaccess rules in WordPress were taking over non-existing server-info and server-status urls given in Apache&#8217;s config and were returning a page not found error.&#8230; <a href="http://ruleoftech.com/journal/wordpress-mod_rewrite-rules-taking-over-mod_status-and-mod_info" class="read_more">Continue reading <span class=\\\"meta-nav\\\">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p>After moving <em>Rule of Tech</em> to a new server and setting up monitoring I noticed that server-status and server-info Apache modules weren&#8217;t working as expected. As usual a little bit of Googling <a href="http://www.ducea.com/2009/03/01/wordpress-mod_rewrite-rules-taking-over-mod_status/">solved this problem</a>.</p>
<p>The problem was that the .htaccess rules in WordPress were taking over non-existing server-info and server-status urls given in Apache&#8217;s config and were returning a page not found error. The rewrite rules by WordPress were setup to handle all the permalinks on the site and for any non-existing file send it to index.php. It really wasn&#8217;t a WordPress problem and should happen with any application that uses the same type of catch-all rewrite rules to handle all the urls inside the application.</p>
<p>The solution was to specifically add a rewrite rule to not have the server-status and server-info urls processed by adding a rule like: <code>RewriteCond %{REQUEST_URI} !=/server-status</code>. The other way is to stop the rewriting process when the urls are found by adding a rule like: <code>RewriteRule ^(server-info|server-status) - [L]</code>.</p>
<p>The WordPress rewrite rules should look like this:</p>
<pre>
<code># BEGIN WordPress
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
# server info and status
RewriteRule ^(server-info|server-status) - [L]
# RewriteCond %{REQUEST_URI} !=/server-status
# /server info and status
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . index.php [L]
&lt;/IfModule&gt;
# END WordPress</code>
</pre>
<h2  class="related_post_title">Related journal entries</h2><ul class="related_post"><li><a href="http://ruleoftech.com/journal/using-cacert-org-signed-certificates-for-tls" title="Using CAcert.org signed certificates for TLS">Using CAcert.org signed certificates for TLS</a></li><li><a href="http://ruleoftech.com/journal/installing-sun-jdk-1-6-on-centos" title="Installing Sun JDK 1.6 on CentOS">Installing Sun JDK 1.6 on CentOS</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://ruleoftech.com/journal/wordpress-mod_rewrite-rules-taking-over-mod_status-and-mod_info/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing Sun JDK 1.6 on CentOS</title>
		<link>http://ruleoftech.com/journal/installing-sun-jdk-1-6-on-centos</link>
		<comments>http://ruleoftech.com/journal/installing-sun-jdk-1-6-on-centos#comments</comments>
		<pubDate>Thu, 15 Jul 2010 14:28:52 +0000</pubDate>
		<dc:creator>Marko</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://ruleoftech.com/?p=138</guid>
		<description><![CDATA[<p>CentOS doesn&#8217;t have a package for Sun JDK so it has to installed manually. It&#8217;s fairly easy but there are some steps to do that. This guide has been tested on CentOS 5.4 x64_86.</p>
<p><strong>Step 1. Initial setup for building RPM</strong><br />
-!- Do this with a non-root user</p>
<ol>
<li>Create ~/.rpmmacros
<ul class="listcodeblock">
<li>
<pre>
$ vim ~/.rpmmacros
%_topdir /home/<username>/rpmbuild
%_tmppath %{_topdir}/tmp
</username></pre>
</li>
</ul>
</li>
<li>Create needed folders:
<ul class="listcodeblock">
<li>
<pre>
$ mkdir -p ~/rpmbuild/{SOURCES,SRPMS,SPECS,RPMS,tmp,BUILD}
</pre>
</li>
</ul>
</li>
<li>Build environment needs to be complete.</li>&#8230; <a href="http://ruleoftech.com/journal/installing-sun-jdk-1-6-on-centos" class="read_more">Continue reading <span class=\\\"meta-nav\\\">&#8594;</span></a></ol>]]></description>
			<content:encoded><![CDATA[<p>CentOS doesn&#8217;t have a package for Sun JDK so it has to installed manually. It&#8217;s fairly easy but there are some steps to do that. This guide has been tested on CentOS 5.4 x64_86.</p>
<p><strong>Step 1. Initial setup for building RPM</strong><br />
-!- Do this with a non-root user</p>
<ol>
<li>Create ~/.rpmmacros
<ul class="listcodeblock">
<li>
<pre>
$ vim ~/.rpmmacros
%_topdir /home/<username>/rpmbuild
%_tmppath %{_topdir}/tmp
</pre>
</li>
</ul>
</li>
<li>Create needed folders:
<ul class="listcodeblock">
<li>
<pre>
$ mkdir -p ~/rpmbuild/{SOURCES,SRPMS,SPECS,RPMS,tmp,BUILD}
</pre>
</li>
</ul>
</li>
<li>Build environment needs to be complete. Some needed packages are:
<ul class="listcodeblock">
<li>
<pre>
$ sudo yum install -y rpm-build gcc gcc-c++ redhat-rpm-config
</pre>
</li>
</ul>
</li>
</ol>
<p><strong>Step 2. Installing your favorite JDK</strong></p>
<ol>
<li>Download Sun JDK 1.6 update 14 from Sun Java download or the <a href="http://java.sun.com/products/archive/">Sun JDK archive</a>.
<ul>
<li>Choose the correct platform (for me it&#8217;s Linux x64) and download jdk-6u18-linux-x64-rpm.bin</li>
</ul>
</li>
<li>Give it executable rights: <code>$ chmod 755 jdk-6u18-linux-x64-rpm.bin</code></li>
<li>Run the binary to extract it into RPM form: <code>$ ./jdk-6u18-linux-x64-rpm.bin</code></li>
<li>Install it:
<ul class="listcodeblock">
<li>
<pre>
$ sudo rpm -Uvh jdk-6u18-linux-amd64.rpm
</pre>
</li>
</ul>
</li>
<li>Log out and in again to make the changes in the paths take effect</li>
<li>Check the install
<ul class="listcodeblock">
<li>
<pre>
$ java -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) 64-Bit Server VM (build 16.0-b13, mixed mode)
</pre>
</li>
</ul>
</li>
<li>Java is now installed on <code>/usr/bin/java</code></li>
</ol>
<h2  class="related_post_title">Related journal entries</h2><ul class="related_post"><li><a href="http://ruleoftech.com/journal/using-cacert-org-signed-certificates-for-tls" title="Using CAcert.org signed certificates for TLS">Using CAcert.org signed certificates for TLS</a></li><li><a href="http://ruleoftech.com/journal/wordpress-mod_rewrite-rules-taking-over-mod_status-and-mod_info" title="WordPress mod_rewrite rules taking over mod_status and mod_info">WordPress mod_rewrite rules taking over mod_status and mod_info</a></li><li><a href="http://ruleoftech.com/journal/installing-apache-tomcat-6-on-centos" title="Installing Apache Tomcat 6 on CentOS">Installing Apache Tomcat 6 on CentOS</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://ruleoftech.com/journal/installing-sun-jdk-1-6-on-centos/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

